Nodes/ComfyUI-Kling-Direct/Kling Advanced Lip Sync
ComfyUI Node

Kling Advanced Lip Sync

Lip-Sync That Knows Which Face to Move

By IxMxAMAR·Created 5 months ago·Updated 2 months ago· 4
Kling Advanced Lip Sync
  • auth
  • video
  • video_file
  • audio
  • url
  • task_id
video_url
audio_url
face_index0
volume10

Kling Advanced Lip Sync is the upgrade over the pack's plain Lip Sync node: it's face-aware. Before it syncs anything, it runs Kling's face-identification step on the source video, finds the faces in the frame, and then syncs the lips of a specific face you choose - with control over the audio volume. The plain node syncs "the video's audio," full stop. This one asks "which face, and how loud?"

That's the differentiator and the reason it exists: videos with multiple people, or a face that isn't the obvious speaker, are exactly where a dumb lip-sync goes wrong. Point the Advanced node at face index 1 and it moves that person's mouth. It's the right tool whenever you need the sync to be precise rather than just present.

How it works

The flow is two-phase, and the node hides the first phase from you:

  1. Identify the face. The node calls Kling's face-identification endpoint with your video_url, gets back a session ID plus a list of detected faces with IDs.
  2. Sync the chosen face. It picks the face at your face_index, then submits the advanced lip-sync task with that face ID and your volume, polls, downloads, and loads the result.

Inputs:

  • auth - the KLING_AUTH object.
  • video_url - URL of the source video. Note it's a URL, not a tensor - you'll need the video hosted somewhere Kling can fetch it. The pack's Cloud Uploader or a video already online are the usual sources.
  • audio_url - URL of the audio to sync (mp3/wav).
  • face_index - integer, 0..10, default 0. 0 = the first detected face. This is your "which person is talking" dial.
  • volume - integer, 0..100, default 10. Volume of the synced audio. If you find the result quiet, this is the knob.

Outputs: video (IMAGE), video_file (path), audio (AUDIO), url, task_id - the standard video quintet, with video ready for a saver or further processing.

How to get it right

  • Count your faces before you set the index. Kling detects faces in the order it finds them; if your video has a clear single subject, 0 is safe. With multiple people, you may need to try 0, then 1, until the right mouth moves. The node picks min(face_index, faces-1), so an out-of-range index silently clamps to the last face - worth knowing if it "always syncs the same person."
  • Host both media. The URL requirement means your video and audio need to be reachable by Kling. If they're local, run them through the Cloud Uploader first (and mind its public-URL privacy warning - lip-sync clips are exactly the kind of thing you may not want permanently public).
  • Volume is the second dial. volume scales the synced audio; if the speech is buried under the original track, raise it. Don't confuse it with face_index - one picks the face, the other the loudness.

Common issues

  • "No faces detected" - the video's subject is too small, occluded, stylized, or off-frame for Kling's detector. Crop or re-record; a clear frontal face is the precondition.
  • "returned no session_id" - the identification step failed server-side; usually a bad video_url (unreachable, wrong scheme, or blocked by the pack's SSRF guard). Check the URL is public and HTTPS.
  • Wrong person's lips move - you're at the wrong face_index, or the index clamped. Step through 0..2 to find the target.

Install

Part of ComfyUI-Kling-Direct:

cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-Kling-Direct

or ComfyUI Manager → search "Kling Direct" → install → restart. No models, no GPU, no extra dependencies - Kling does the face detection and syncing server-side, billed per call. If your lip-sync needs are "one talking head," the plain node is enough; the moment there's a second person in frame, this is the one you want.

CategoryKling AI/Video

Inputs (5)

NameTypeDefaultDescription
authKLING_AUTH
video_urlSTRINGURL of the source video.
audio_urlSTRINGURL of the audio to sync.
face_indexINT00–10Index of the detected face to sync (0 = first face).
volumeINT100–100Volume of the synced audio (0-100).

Outputs (5)

NameTypeDescription
videoIMAGE
video_fileSTRING
audioAUDIO
urlSTRING
task_idSTRING