lipsync_generate
Generates a lip-sync video from one portrait image and an audio track, so the mouth follows the song or speech. Requires the LocModel models and runtime pre-installed; rendering is slow.
Instructions
Generate a singing / talking head video: one portrait image + one audio file -> mp4 whose mouth follows the song. Same pipeline as GUI 视频 → 对口型视频 (InfiniteTalk, Wan2.1-I2V-14B-480P fp8 or GGUF, Demucs vocal separation, chinese-wav2vec2). Requires the dedicated models and runtime downloaded and mounted inside LocModel first (about 24.2 GB models + 6 GB CUDA torch); without them the job fails outright. Slow: a 1-minute song takes tens of minutes even on a 4090.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image": "<image>",
"audio": "<audio>"
},
"name": "lipsync_generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crf | No | H.264 CRF for the mp4, default 18 (LocModel's GUI ships 17); higher = smaller and softer. | |
| res | No | Resolution bucket: 480 (default, fits 8 GB VRAM) / 720 / custom (then width+height are required). | |
| crop | No | 'full' (default) / 'head' (upper-middle square, best for talking heads) / 'upper' (upper half) or {x,y,w,h} normalised 0..1. | |
| sage | No | Use SageAttention when the venv has it (default true). | |
| seed | No | Seed, -1 = random (default -1). | |
| accel | No | Use the lightx2v distill LoRA (default true -> 4 steps). | |
| audio | Yes | Absolute path to the song or voice track (mp3/wav/m4a/flac/ogg/aac). | |
| image | Yes | Absolute path to a portrait photo (jpg/png/webp/bmp). | |
| steps | No | Sampling steps (default 4 with accel, 40 without). | |
| width | No | Only for res=custom; rounded to 16, range 256..1920. | |
| height | No | Only for res=custom; rounded to 16, range 256..1920. | |
| prompt | No | Scene / behaviour description, e.g. 'a young woman singing warmly to the camera in a cafe'. Default 'a person is singing and speaking to the camera'. | |
| vocals | No | auto (default) separates the vocals with Demucs to drive the mouth; none uses the raw audio. | |
| dry_run | No | Assemble and validate the job without running inference. | |
| negative | No | Negative prompt (default: LocModel's built-in one). | |
| color_fix | No | Colour-correction strength, 1.0 = LocModel default. | |
| timeout_s | No | Hard timeout in seconds (default: no limit; long songs take a long time). | |
| vae_tiled | No | Tiled VAE decode to fit smaller VRAM (default false). | |
| output_dir | No | Folder for the mp4 (default: config output_dir or ~/Pictures/LocModel). | |
| max_seconds | No | Render only the first N seconds of the audio (0 = whole song). |