This node provides lip-sync capabilities in ComfyUI using ByteDance's LatentSync model. It allows you to synchronize video lips with audio input.
Unofficial LatentSync implementation for ComfyUI on windows.
This node provides lip-sync capabilities in ComfyUI using ByteDance's LatentSync model. It allows you to synchronize video lips with audio input.
https://github.com/user-attachments/assets/49c40cf4-5db1-46c5-99a4-7fbb2031c907
Before installing this node, you must install the following in order:
ComfyUI installed and working
Python 3.8-3.11 (mediapipe is not yet compatible with Python 3.12)
FFmpeg installed on your system:
If you get PYTHONPATH errors:
Only proceed with installation after confirming all prerequisites are installed and working.
cd ComfyUI/custom_nodes
git clone https://github.com/ShmuelRonen/ComfyUI-LatentSyncWrapper.git
cd ComfyUI-LatentSyncWrapper
pip install -r requirements.txt
diffusers
transformers
huggingface-hub
omegaconf
einops
opencv-python
mediapipe>=0.10.8
face-alignment
decord
ffmpeg-python
safetensors
soundfile
The models can be obtained in two ways:
The node will attempt to automatically download required model files from HuggingFace on first use. If automatic download fails, use Option 2.
latentsync_unet.pt
whisper/tiny.pt
ComfyUI/custom_nodes/ComfyUI-LatentSyncWrapper/checkpoints/
├── latentsync_unet.pt
└── whisper/
└── tiny.pt
The processed video will be saved in ComfyUI's output directory.
video_path
: Path to input video fileaudio
: Audio input from AceNodes audio loaderseed
: Random seed for reproducible results (default: 1247)A complementary node that helps manage video length and synchronization with audio.
normal
: Passes through video frames with added padding to prevent frame losspingpong
: Creates a forward-backward loop of the video sequenceloop_to_audio
: Extends video by repeating frames to match audio durationnormal
for standard lip-syncpingpong
for back-and-forth animationloop_to_audio
to match longer audio durationsIf you encounter mediapipe installation errors:
python --version
)pip install mediapipe>=0.10.8
This is an unofficial implementation based on:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.