Nodes/ComfyUI API Toolkit/Kling Avatar Generation
ComfyUI Node

Kling Avatar Generation

Kling avatar generation from one image

By IxMxAMAR·Created 5 months ago·Updated 2 months ago· 1
Kling Avatar Generation
  • auth
  • image
  • audio
  • video
  • video_file
  • audio
  • url
  • task_id
prompt
modepro
audio_url

A "digital human" avatar is what Kling calls its talking-head generation: you feed it a single portrait and it produces a video of that person speaking, gesturing, and subtly moving like a real presenter. No motion capture, no video of the subject - one image in, a talking-head clip out. This is the node behind a lot of "AI presenter" content, and it's one of the flashier things this pack can do.

You'd reach for it when you need a person to talk on camera and you only have a still: a news-style anchor, a product spokesperson, a character from a generated portrait. The optional audio input is the magic part - give it a voice (from the Gemini TTS node, a local TTS, or an audio file) and the avatar speaks that audio with matching lip movement. Without audio, you get a silent animated portrait driven by the prompt instead.

How it works

Another asynchronous Kling task. The node uploads your image as a base64 asset, and if you supplied an audio tensor it converts and uploads that as a material asset too (or uses a audio_url directly). Then it submits the avatar job to Kling's image-to-video endpoint with your prompt and mode, polls until the video finishes, downloads it to your output folder, and hands back the video as a tensor, the file path, the extracted audio, the hosted URL, and the task ID.

The mode input (pro vs std) picks the generation tier - pro is the better-quality default; std is cheaper and faster for test runs.

Inputs and outputs that matter

  • auth - the KLING_AUTH object. Required on every Kling node.
  • image - the portrait to animate. A clean, front-facing, well-lit face gets the best results; the more the image looks like a headshot, the better the avatar.
  • audio - optional AUDIO. The speech the avatar will sync to. This is what makes it a talking head rather than a moving one.
  • audio_url - alternative to the audio tensor: point at a hosted audio URL instead.
  • prompt - optional; guides the animation when there's no audio ("wave slowly and smile").
  • mode - pro or std.

Outputs: video (IMAGE batch - frames of the result), video_file (saved file path), audio (the clip's audio), url (hosted), task_id.

How to install it

Pack-level install:

cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-API-Toolkit
cd ComfyUI-API-Toolkit
pip install -r requirements.txt

or "API Toolkit" in ComfyUI Manager. Kling needs requests and PyJWT. The audio path also wants soundfile/scipy from the requirements file.

Common issues

The failure you'll meet most is on the input side: Kling rejects images that are too large or badly proportioned (the client's error map calls this 1101 "invalid image"), and it flags content its policy doesn't like - including, notably, faces of real people if you're using them without authorization. Use a clean, well-cropped portrait and expect the filter to be strict.

Also, this is one of the pricier Kling jobs - avatar video is billed per generation and the pack's API nodes always re-run on Queue, so every run costs. Test with std mode and a short silent clip before spending on the pro pass with a full narration.

CategoryAPI Toolkit/Kling AI/Video

Inputs (6)

NameTypeDefaultDescription
authKLING_AUTH
imageIMAGE
promptSTRINGOptional text prompt for the avatar animation.
modeCOMBOproGeneration mode.
audiooptAUDIO
audio_urloptSTRINGURL of audio for the avatar to speak.

Outputs (5)

NameTypeDescription
videoIMAGE
video_fileSTRING
audioAUDIO
urlSTRING
task_idSTRING