Nodes/ComfyUI API Toolkit/Kling Image Generation
ComfyUI Node

Kling Image Generation

Kling text-to-image straight into your ComfyUI graph

By IxMxAMAR·Created 5 months ago·Updated 2 months ago· 1
Kling Image Generation
  • auth
  • image
  • url
  • task_id
prompt
negative_prompt
model_namekling-v3
aspect_ratio1:1
resolution1k
fidelity0.50
n1

The flagship image node of the Kling half of this pack. You type a prompt, Kling's kling-v3 model draws it, and the result drops back into your graph as a normal IMAGE tensor - ready for a preview node, a save node, a VAE, or the next stage of your workflow. If you've never used a cloud-image node before, this is the one to start with: one prompt, one click, image comes back. It's the cleanest possible demo of why API-wrapper nodes exist at all.

Mechanically it's a submit-and-poll cloud task: the node sends your prompt and settings to Kling's API (via the Singapore endpoint), gets a task_id, then polls until the image is done. Unlike a local sampler, this runs on Kling's GPUs - your only cost is credits and a few seconds of waiting. The pack handles the JWT signing, retries with backoff, and gives you a readable hint instead of a bare error code when something breaks.

Inputs worth your attention:

  • prompt and negative_prompt - the text. Kling is a Chinese-model-born-now-global generator; plain English descriptive prompts work fine.
  • model_name - currently locked to kling-v3. Nothing to pick yet.
  • aspect_ratio - 16:9, 9:16, 1:1, 3:2, 2:3, 4:3, 3:4.
  • resolution - 1k (~1024px) or 2k (~2048px). 2k costs more credits and takes longer; don't default to it.
  • fidelity - the fun one. 0.0 = creative, 1.0 = faithful to the prompt. 0.5 is the default middle ground. If generations keep ignoring your prompt, nudge this up; if they're stiff and over-literal, drop it.
  • n - how many images (1–9). More is not free.

Outputs are image (tensor), url (hosted copy), and task_id.

Installing it

Bundled in ComfyUI-API-Toolkit. Manager: search "API Toolkit". Manual:

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

Restart ComfyUI. You'll also need the Kling AI Authentication node wired in with access/secret keys from app.klingai.com - that's where Kling's "no open weights" (KB: closed-source-models) really shows: no model to download, just keys.

Gotchas

The big one is the same across every node in this pack: this is not free and not local. Every queue spends credits, and your prompt leaves your machine. The community line is clear about when that's acceptable - API nodes are the right tool for models you can't run locally, and kling-v3 is exactly that. Also watch the error codes: 1102 is "balance not enough," 1003 is "API access not activated yet" (new accounts need KYC/approval), and 1302 is a content-policy rejection. The pack prints all of these with hints. And because the node implements IS_CHANGED, re-queueing re-runs - you won't get served yesterday's image.

CategoryAPI Toolkit/Kling AI/Image

Inputs (8)

NameTypeDefaultDescription
authKLING_AUTH
promptSTRINGText description of the image to generate.
negative_promptSTRINGThings to avoid in the generated image.
model_nameCOMBOkling-v3Kling image model version.
aspect_ratioCOMBO1:1Output image aspect ratio.
resolutionCOMBO1kOutput resolution: 1k (~1024px) or 2k (~2048px).
fidelityFLOAT0.500–1Image fidelity/detail level (0.0 = creative, 1.0 = faithful).
nINT11–9Number of images to generate (1-9).

Outputs (3)

NameTypeDescription
imageIMAGE
urlSTRING
task_idSTRING