Skip to main content
Glama

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

NameRequiredDescriptionDefault
crfNoH.264 CRF for the mp4, default 18 (LocModel's GUI ships 17); higher = smaller and softer.
resNoResolution bucket: 480 (default, fits 8 GB VRAM) / 720 / custom (then width+height are required).
cropNo'full' (default) / 'head' (upper-middle square, best for talking heads) / 'upper' (upper half) or {x,y,w,h} normalised 0..1.
sageNoUse SageAttention when the venv has it (default true).
seedNoSeed, -1 = random (default -1).
accelNoUse the lightx2v distill LoRA (default true -> 4 steps).
audioYesAbsolute path to the song or voice track (mp3/wav/m4a/flac/ogg/aac).
imageYesAbsolute path to a portrait photo (jpg/png/webp/bmp).
stepsNoSampling steps (default 4 with accel, 40 without).
widthNoOnly for res=custom; rounded to 16, range 256..1920.
heightNoOnly for res=custom; rounded to 16, range 256..1920.
promptNoScene / 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'.
vocalsNoauto (default) separates the vocals with Demucs to drive the mouth; none uses the raw audio.
dry_runNoAssemble and validate the job without running inference.
negativeNoNegative prompt (default: LocModel's built-in one).
color_fixNoColour-correction strength, 1.0 = LocModel default.
timeout_sNoHard timeout in seconds (default: no limit; long songs take a long time).
vae_tiledNoTiled VAE decode to fit smaller VRAM (default false).
output_dirNoFolder for the mp4 (default: config output_dir or ~/Pictures/LocModel).
max_secondsNoRender only the first N seconds of the audio (0 = whole song).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and usefully discloses the pipeline, ~30 GB model/runtime requirement, outright failure without those assets, and long runtimes even on a 4090. However, it does not disclose job lifecycle behavior such as whether it returns a job ID, whether status must be polled with lipsync_status, or how cancellation works.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the critical operational constraints, model prerequisites and slowness, are stated early. The technical pipeline detail is dense but mostly earns its place for a complex 20-parameter video-generation tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers purpose, required inputs, runtime prerequisites, failure mode, and slowness, which is substantial for a complex tool. Because there is no output schema, it should do more to explain return behavior and async job handling, neither of which is described.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all 20 parameters are already documented in the input schema. The description adds no parameter-specific semantics beyond what the schema provides, which is the baseline case for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: generate a singing/talking head video from one portrait image plus one audio file into an mp4. It does not explicitly differentiate this from sibling tools such as generate_video or explain why lipsync_generate is the right choice.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear usage context by specifying the required portrait+audio input and the prerequisite that dedicated models and runtime be mounted first, otherwise the job fails. It lacks explicit alternatives or a when-not-to-use comparison against generate_video.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.