{"id":21917528,"url":"https://github.com/numz/wav2lip_uhq","last_synced_at":"2025-04-19T09:54:21.565Z","repository":{"id":164289993,"uuid":"639714370","full_name":"numz/wav2lip_uhq","owner":"numz","description":"Wav2Lip UHQ Improvement with ControlNet 1.1","archived":false,"fork":false,"pushed_at":"2023-08-03T15:13:41.000Z","size":77524,"stargazers_count":73,"open_issues_count":4,"forks_count":18,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T07:05:30.565Z","etag":null,"topics":["deep-fakes","deepfake","lipsync","python","wav2lip"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-12T04:12:46.000Z","updated_at":"2024-07-30T02:34:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"674af7f3-c2a0-4741-ad75-1de6650344b2","html_url":"https://github.com/numz/wav2lip_uhq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numz%2Fwav2lip_uhq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numz%2Fwav2lip_uhq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numz%2Fwav2lip_uhq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numz%2Fwav2lip_uhq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numz","download_url":"https://codeload.github.com/numz/wav2lip_uhq/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249668854,"owners_count":21308544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-fakes","deepfake","lipsync","python","wav2lip"],"created_at":"2024-11-28T19:33:29.714Z","updated_at":"2025-04-19T09:54:21.559Z","avatar_url":"https://github.com/numz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wav2Lip UHQ Improvement Script\n\nThis repository contains a script designed to enhance videos generated by the [Wav2Lip tool](https://github.com/Rudrabha/Wav2Lip). \n\n# :fire: New Update : Automatic1111 extension can be found here, https://github.com/numz/sd-wav2lip-uhq with big improvement !!\n\n![Illustration](temp/example.gif)\n\nResult video can be find here : https://www.youtube.com/watch?v=-3WLUxz6XKM\n\n## Description\n\nThis script provides an enhancement to the videos generated by the Wav2Lip tool. It improves the quality of the lip-sync videos by applying specific post-processing techniques with controlNet 1.1.\n\n## Prerequisites\n- Stable diffusion webui automatic1111 + ControlNet 1.1 extension\n- Python 3.6 or higher\n- FFmpeg\n\n1. You can install Stable Diffusion Webui by following the instructions on the [Stable Diffusion Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) repository.\n2. You can install ControlNet 1.1 extension by following the instructions on the [ControlNet 1.1](https://github.com/Mikubill/sd-webui-controlnet) repository.\n3. Download ControlNet model **control_v11f1e_sd15_tile** at [ControlNet Models]https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main and install it in controlnet models folder in automatic1111\n4. FFmpeg : download it from the [official FFmpeg site](https://ffmpeg.org/download.html). Follow the instructions appropriate for your operating system.\n\n## Installation\n\n1. Clone this repository.\n```bash\ngit clone https://github.com/numz/wav2lip_uhq.git\n```\n2. go to the directory\n```bash\ncd wav2lip_uhq\n```\n\n3. Create venv and activate it.\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n3. Install the required Python libraries using the command :\n```bash \npip install -r requirements.txt\n```\n\n## Usage\n1. Launch Stable diffusion webui with \"--api\" flag.\n2. Choose your model in stable diffusion webui.\n3. Run using the following command:\n\n```bash\npython wav2lip_uhq.py -f \u003cfile\u003e -i \u003cinput_file\u003e\n```\n\nHere is a description of each argument:\n\n- `-f` or `--file`: Path to the video generated by Wav2Lip.\n- `-i` or `--input_file`: Path to the original video.\n- `-p` or `--post_process`: if set to false script only create images and mask for alternative process\n\n## Operation\n\nThis script operates in several stages to improve the quality of Wav2Lip-generated videos:\n\n1. **Mask Creation**: The script first creates a mask around the mouth in the video.\n\n2. **Video Quality Enhancement**: It takes the low-quality Wav2Lip video and overlays the low-quality mouth onto the high-quality original video. \n\n3. **ControlNet Integration**: The script then sends the original image with the low-quality mouth and the mouth mask to ControlNet. Using the `automatic1111` API, it requests ControlNet to perform a render on the mouth, thereby enhancing the final quality of the video.\n\n## Payload\n\nin the file \"payloads/controlNet.json\" you'll find the payload send to automatic1111 api. feel free to change it to your needs.\nfollowing parameters could drastically change the result:\n- denoising_strength (0.2 - 1.0) default 1, high value can create flickering, low value can create blurry result\n- mask_blur (0 - 50) default 8\n- alwayson_scripts \u003e controlnet \u003e args \u003e threshold_a (1 - 32) default 1\n- alwayson_scripts \u003e controlnet \u003e args \u003e threshold_b (1 - 32) default 32\n- inpainting_fill (0 - 3) default 2, 0 = fill, 1 = original, 2 = latent noise, 3 = latent nothing\n- steps (1 - 100) default 30, number of steps for diffusion\n\n## alternative usage\nif you set `-p` or `--post_process` to \"False\", the script will only create images and masks. you can then use those folders in automatic1111 webui in img2img Batch mode:\n![Illustration](temp/img2img.png)\nIt will give you more control over the result\n\n## Quality tips\n- use a high quality video as input\n- use a high quality model in stable diffusion webui like [delibarate_v2](https://civitai.com/models/4823/deliberate)\n- play with the payload parameters\n\n## Contributing\n\nContributions to this project are welcome. Please ensure any pull requests are accompanied by a detailed description of the changes made.\n\n## License\n\nSpecify the open-source license under which your project is published here.\n\n## Contact\n\nProvide your contact details here for any questions or comments about the project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumz%2Fwav2lip_uhq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumz%2Fwav2lip_uhq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumz%2Fwav2lip_uhq/lists"}