Nodes/ComfyUI-JM-KLing-API/KLingAI Image Generation
ComfyUI Node

KLingAI Image Generation

Kling text-to-image with reference-image modes

By juemingai·Created about a year ago·Updated 11 months ago· 3
KLingAI Image Generation
  • image
  • task_id
  • task_status
  • created_at
  • updated_at
  • seed
api_token
prompt
image_typeBase64
image_url
image_referencesubject
model_namekling-v1
negative_prompt
image_fidelity0.50
human_fidelity0.45
n1
aspect_ratio16:9
callback_url
seed-1

You probably didn't install a Kling pack for the image node - the video is the headline - but KLingAI Image Generation is a solid surprise. It's Kling's text-to-image API (/v1/images/generations) wrapped as an async task node, and it's the natural feeder for the image2video node in the same pack: generate a frame, then animate it. If you're building "image → video" pipelines entirely inside ComfyUI, this node closes the loop so you never leave the graph.

It's async like every generation node here - POST, get task_id, poll with Query Status, download. But it has one genuinely interesting wrinkle: reference-image modes. Kling's image API isn't just prompt → picture. You can pass a reference image and tell it whether to preserve the subject (clothing, pose, object identity) or the face (the person's appearance), with separate fidelity controls for each.

Inputs that matter

  • api_token (required) - from the API Key node.
  • prompt (required) - the generation prompt, freeform.
  • image / image_url / image_type - optional reference image, fed as a tensor (Base64) or a URL.
  • image_reference - subject or face. Subject locks onto the thing/outfit in the reference; face locks onto the person. Pick based on what you're preserving.
  • image_fidelity - 0 to 1, default 0.5. How hard to hold onto the reference image. Higher = more literal.
  • human_fidelity - 0 to 1, default 0.45. Only relevant for face references; how closely the result matches the person.
  • model_name - kling-v1, kling-v1-5, kling-v2.
  • negative_prompt - the usual.
  • n - 1 to 9. How many images per request. Kling will happily make you a contact sheet's worth in one task.
  • aspect_ratio - eight options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9. More ratios than the video nodes offer, so you can produce landscape frames to feed i2v.
  • seed - local-only, same caveat as everywhere.

The output

task_id, task_status, created_at, updated_at, seed - the pack's standard shape. Query Status handles the polling and returns the image URL; the Image Downloader saves it and converts it to an IMAGE tensor you can feed straight into image2video. When n is more than 1, note that Query Status returns the first image's URL - the rest are in the task result, which the downloader won't chase for you.

A neat closed loop

API Key → this node (prompt + reference) → Query Status → Image Downloader → Image2Video → Query Status → Video Downloader. Frame first, then animate it. That's a full "brand image to motion" pipeline with zero VRAM spent on a diffusion model.

Where people get burned

  • Fidelity sliders doing nothing visible. If you don't pass a reference image, image_reference, image_fidelity, and human_fidelity are inert. They only bite when an image is connected.
  • Face mode without a clear face. face reference works best with a tight, well-lit shot of the person; wide group shots tend to come back weak or drift.
  • Multi-image tasks. Set n to 4 and you'll get a task that succeeds with four URLs, but this node's Query Status pairing only surfaces the first. If you need all four, that's the one gap.
  • Standard async reminder. No Query Status, no image on disk. URL → Downloader, always.
CategoryJM-KLingAI-API/image-generation

Inputs (14)

NameTypeDefaultDescription
api_tokenSTRING
promptSTRING
image_typeoptCOMBOBase642 options: Base64, URL
imageoptIMAGE
image_urloptSTRING
image_referenceoptCOMBOsubject2 options: subject, face
model_nameoptCOMBOkling-v13 options: kling-v1, kling-v1-5, kling-v2
negative_promptoptSTRING
image_fidelityoptFLOAT0.500–1
human_fidelityoptFLOAT0.450–1
noptINT11–9
aspect_ratiooptCOMBO16:98 options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, +2
callback_urloptSTRING
seedoptINT-1-1–18446744073709550000

Outputs (5)

NameTypeDescription
task_idSTRING
task_statusSTRING
created_atSTRING
updated_atSTRING
seedINT