Unlimited-length talking video generation that supports image-to-video and video-to-video generation
Unlimited-length talking video generation that supports image-to-video and video-to-video generation
TL; DR: InfiniteTalk is an unlimited-length talking video generation model that supports both audio-driven video-to-video and image-to-video generation
We propose InfiniteTalk, a novel sparse-frame video dubbing framework. Given an input video and audio track, InfiniteTalk synthesizes a new video with accurate lip synchronization while simultaneously aligning head movements, body posture, and facial expressions with the audio. Unlike traditional dubbing methods that focus solely on lips, InfiniteTalk enables infinite-length video generation with accurate lip synchronization and consistent identity preservation. Beside, InfiniteTalk can also be used as an image-audio-to-video model with an image and an audio as input.
conda create -n multitalk python=3.10
conda activate multitalk
pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu121
pip install -U xformers==0.0.28 --index-url https://download.pytorch.org/whl/cu121pip install misaki[en]
pip install ninja
pip install psutil
pip install packaging
pip install wheel
pip install flash_attn==2.7.4.post1pip install -r requirements.txt
conda install -c conda-forge librosaconda install -c conda-forge ffmpegor
sudo yum install ffmpeg ffmpeg-devel| Models | Download Link | Notes |
|---|---|---|
| Wan2.1-I2V-14B-480P | Huggingface | Base model |
| chinese-wav2vec2-base | Huggingface | Audio encoder |
| MeiGen-InfiniteTalk | Huggingface | Our audio condition weights |
Download models using huggingface-cli:
huggingface-cli download Wan-AI/Wan2.1-I2V-14B-480P --local-dir ./weights/Wan2.1-I2V-14B-480P
huggingface-cli download TencentGameMate/chinese-wav2vec2-base --local-dir ./weights/chinese-wav2vec2-base
huggingface-cli download TencentGameMate/chinese-wav2vec2-base model.safetensors --revision refs/pr/1 --local-dir ./weights/chinese-wav2vec2-base
huggingface-cli download MeiGen-AI/InfiniteTalk --local-dir ./weights/InfiniteTalk
Our model is compatible with both 480P and 720P resolutions.
Some tips
- Lip synchronization accuracy: Audio CFG works optimally between 3–5. Increase the audio CFG value for better synchronization.
- FusionX: While it enables faster inference and higher quality, FusionX LoRA exacerbates color shift over 1 minute and reduces ID preservation in videos.
- V2V generation: Enables unlimited length generation. The model mimics the original video's camera movement, though not identically. Using SDEdit improves camera movement accuracy significantly but introduces color shift and is best suited for short clips. Improvements for long video camera control are planned.
- I2V generation: Generates good results from a single image for up to 1 minute. Beyond 1 minute, color shifts become more pronounced. One trick for the high-quailty generation beyond 1 min is to copy the image to a video by translating or zooming in the image. Here is a script to convert image to video.
- Quantization model: If your inference process is killed due to insufficient memory, we suggest using the quantization model, which can help reduce memory usage.
…python generate_infinitetalk.py \
--ckpt_dir weights/Wan2.1-I2V-14B-480P \
--wav2vec_dir 'weights/chinese-wav2vec2-base' \
--infinitetalk_dir weights/InfiniteTalk/single/infinitetalk.safetensors \
--input_json examples/single_example_image.json \
--size infinitetalk-480 \
--sample_steps 40 \
--mode streaming \
--motion_frame 9 \
--save_file infinitetalk_res
If you want run with 720P, set --size infinitetalk-720:
python generate_infinitetalk.py \
--ckpt_dir weights/Wan2.1-I2V-14B-480P \
--wav2vec_dir 'weights/chinese-wav2vec2-base' \
--infinitetalk_dir weights/InfiniteTalk/single/infinitetalk.safetensors \
--input_json examples/single_example_image.json \
--size infinitetalk-720 \
--sample_steps 40 \
--mode streaming \
--motion_frame 9 \
--save_file infinitetalk_res_720p
If you want run with very low VRAM, set --num_persistent_param_in_dit 0:
python generate_infinitetalk.py \
--ckpt_dir weights/Wan2.1-I2V-14B-480P \
--wav2vec_dir 'weights/chinese-wav2vec2-base' \
--infinitetalk_dir weights/InfiniteTalk/single/infinitetalk.safetensors \
--input_json examples/single_example_image.json \
--size infinitetalk-480 \
--sample_steps 40 \
--num_persistent_param_in_dit 0 \
--mode streaming \
--motion_frame 9 \
--save_file infinitetalk_res_lowvramGPU_NUM=8
torchrun --nproc_per_node=$GPU_NUM --standalone generate_infinitetalk.py \
--ckpt_dir weights/Wan2.1-I2V-14B-480P \
--wav2vec_dir 'weights/chinese-wav2vec2-base' \
--infinitetalk_dir weights/InfiniteTalk/single/infinitetalk.safetensors \
--dit_fsdp --t5_fsdp \
--ulysses_size=$GPU_NUM \
--input_json examples/single_example_image.json \
--size infinitetalk-480 \
--sample_steps 40 \
--mode streaming \
--motion_frame 9 \
--save_file infinitetalk_res_multigpupython generate_infinitetalk.py \
--ckpt_dir weights/Wan2.1-I2V-14B-480P \
--wav2vec_dir 'weights/chinese-wav2vec2-base' \
--infinitetalk_dir weights/InfiniteTalk/multi/infinitetalk.safetensors \
--input_json examples/multi_example_image.json \
--size infinitetalk-480 \
--sample_steps 40 \
--num_persistent_param_in_dit 0 \
--mode streaming \
--motion_frame 9 \
--save_file infinitetalk_res_multiperson[FusioniX](https://huggingface.co/vrgamedevgirl84/Wan14BT2VFusion
InfiniteTalk inference is TOO SLOW. How did you speed up inference?
Unable to Generate Full-Body Walking(e.g., TED Talk Style)
视频对口型会改变视频内容,有什么办法避免吗
tongflow has created a dedicated plugin for InfiniteTalk
Nodes Installation
按官方的配置部署完成后,运行不起来呀?是不是配置不对呢?
安装flash_attn==2.7.4.post1失败。torch环境已安装
MeiGen-AI/InfiniteTalk 这个模型下载159G,怎么这么大呀?
multi-person scenario does not work.
wan 2.2 version?