User Manual

This manual provides detailed instructions on MultiTalk usage, including basic operations, parameter configuration, and advanced techniques.

Basic Usage

Preparing Input Files

MultiTalk requires preparing specific input formats. The project uses JSON files to define generation parameters, including audio paths, image paths, and text prompts.

For single-person generation, the input JSON format requires specifying the audio file path, reference image path, video save name, and other parameters. Example files are located in the examples directory, such as single_example_1.json.

For multi-person conversational generation, the input JSON needs to contain multiple audio streams and corresponding person region definitions. Example files are located in the examples directory, such as multitalk_example_2.json.

Running Basic Generation

After installation and configuration is complete, enter the project directory and run the following command for video generation:

python generate_multitalk.py \
 --ckpt_dir weights/Wan2.1-I2V-14B-480P \
 --wav2vec_dir weights/chinese-wav2vec2-base \
 --input_json examples/single_example_1.json \
 --sample_steps 40 \
 --mode streaming \
 --use_teacache \
 --save_file single_exp

Parameter Description

--ckpt_dir specifies the model weight directory path. --wav2vec_dir specifies the audio encoder directory path. --input_json specifies the input parameter JSON file path. --sample_steps specifies the number of sampling steps; higher values produce better quality but slower speed. --mode specifies the generation mode, streaming for long videos, clip for short videos. --use_teacache enables TeaCache acceleration. --save_file specifies the output file save name.

Advanced Usage Techniques

Adjusting Generation Quality

Sampling steps are key parameters affecting generation quality. The default 40 steps provides good results. For faster generation, steps can be reduced to 10, which has minimal impact on lip synchronization but affects motion smoothness and visual quality. Increasing steps improves detail representation.

Lip synchronization strength is controlled by the audio guidance coefficient. Audio CFG values between 3 and 5 work best. Increasing this value achieves better lip synchronization.

Long Video Generation

MultiTalk supports generating videos up to 15 seconds long. Use streaming mode to generate longer video clips:

python generate_multitalk.py \
 --ckpt_dir weights/Wan2.1-I2V-14B-480P \
 --wav2vec_dir weights/chinese-wav2vec2-base \
 --input_json examples/single_example_1.json \
 --sample_steps 40 \
 --mode streaming \
 --save_file single_long_exp

When generating very long videos, there may be color tone differences between segments. Setting Audio CFG to 3 helps maintain color consistency.

Low VRAM Operation

If VRAM is limited, you can use the following parameters to reduce memory usage:

python generate_multitalk.py \
 --ckpt_dir weights/Wan2.1-I2V-14B-480P \
 --wav2vec_dir weights/chinese-wav2vec2-base \
 --input_json examples/single_example_1.json \
 --sample_steps 40 \
 --mode streaming \
 --num_persistent_param_in_dit 0 \
 --use_teacache \
 --save_file lowvram_exp

Adding --num_persistent_param_in_dit 0 enables 480P video generation on a single RTX 4090.

Enabling Acceleration

The project supports multiple acceleration methods to improve generation speed.

TeaCache acceleration can significantly improve speed while maintaining quality. Recommended --teacache_thresh values are between 0.2 and 0.5:

python generate_multitalk.py \
 --ckpt_dir weights/Wan2.1-I2V-14B-480P \
 --wav2vec_dir weights/chinese-wav2vec2-base \
 --input_json examples/single_example_1.json \
 --sample_steps 40 \
 --use_teacache \
 --teacache_thresh 0.3 \
 --save_file teacache_exp

Using LoRA Acceleration

Using LoRA can significantly reduce sampling steps. FusioniX LoRA requires only 8 steps, while lightx2v LoRA requires only 4 steps:

python generate_multitalk.py \
 --ckpt_dir weights/Wan2.1-I2V-14B-480P \
 --wav2vec_dir weights/chinese-wav2vec2-base \
 --input_json examples/single_example_1.json \
 --lora_dir weights/Wan2.1_I2V_14B_FusionX_LoRA.safetensors \
 --lora_scale 1.0 \
 --sample_text_guide_scale 1.0 \
 --sample_audio_guide_scale 2.0 \
 --sample_steps 8 \
 --mode streaming \
 --save_file fusionx_exp

Using Gradio Interface

The project provides a Gradio web interface for interactive use. Enter the project directory and run:

python app.py

Or use the low VRAM version:

python app.py --num_persistent_param_in_dit 0

Integrating TTS Speech Synthesis

MultiTalk supports direct text input. Through integrated TTS technology, it generates speech from text and then creates videos:

python generate_multitalk.py \
 --ckpt_dir weights/Wan2.1-I2V-14B-480P \
 --wav2vec_dir weights/chinese-wav2vec2-base \
 --input_json examples/single_example_tts_1.json \
 --sample_steps 40 \
 --mode streaming \
 --audio_mode tts \
 --save_file tts_exp

Multi-GPU Configuration

Generating 720P high-resolution videos requires multiple GPUs. Use the following command to configure multi-GPU:

GPU_NUM=8
torchrun --nproc_per_node=$GPU_NUM --standalone generate_multitalk.py \
 --ckpt_dir weights/Wan2.1-I2V-14B-480P \
 --wav2vec_dir weights/chinese-wav2vec2-base \
 --dit_fsdp --t5_fsdp \
 --ulysses_size=$GPU_NUM \
 --input_json examples/single_example_1.json \
 --sample_steps 40 \
 --mode streaming \
 --use_teacache \
 --save_file multi_gpu_exp

Using ComfyUI

The project also supports integration into ComfyUI workflows. You need to install the ComfyUI-WanVideoWrapper extension, then load the MultiTalk model for workflow orchestration.