KLingAI Text to Video
Text to video on Kling's servers, from inside ComfyUI
- task_id
- task_status
- created_at
- updated_at
- seed
You want Kling-quality video - the closed model people rate roughly on par with Wan 2.2 at its best - but you don't want to babysit a 30 GB video checkpoint on a GPU you may not even have. This node is the answer to that specific trade-off. It fires a text-to-video job at the Kling AI API and hands back a task ID. Everything heavy runs on Kling's servers, so your rig just needs to run ComfyUI.
Before you wire anything, get the mental model straight, because it's the one thing that confuses every first-timer with this pack: Kling generation is asynchronous. The node does not return a video. It returns a task ID plus a status, and you're expected to feed that into the KLingAI Query Status node, which polls until the job finishes and hands you the result URL. Then a downloader node pulls it to disk. Three-hop pipeline, always.
How it works
The node POSTs your prompt to https://api.klingai.com/v1/videos/text2video with Authorization: Bearer <your jwt>, where the JWT comes from the KLingAI API Key node. On success the API returns task_id, task_status, created_at, updated_at - and those four strings plus the local seed are exactly what the node outputs. The request itself is a couple of seconds; the actual generation takes minutes on Kling's side.
Inputs that matter
- api_token (required) - wire in the
api_tokenoutput from the API Key node. - prompt (required) - up to 2500 characters. This is your main lever; Kling reads long, specific prompts well.
- model_name - this node only offers
kling-v1andkling-v1-6. The fancierkling-v2-*models live on the image2video node. - negative_prompt - up to 2500 chars, used the way you'd expect.
- mode -
stdorpro. Pro is better quality and costs more credits. - duration -
5or10seconds. - aspect_ratio -
16:9,9:16, or1:1. - cfg_scale - 0 to 1, default 0.5.
- seed - here's the trap: the seed is local only. The code literally prints "Using local seed (not sent to API)." It controls whether ComfyUI re-runs the node (set a fixed value to stop re-firing) but does not give you reproducible generations on Kling's side.
The output
task_id, task_status, created_at, updated_at (all STRING) and seed (INT). The one you care about is task_id → into Query Status. task_status at creation time is basically always submitted or similar - don't read anything into it.
Getting it running
Install the pack first (ComfyUI Manager → search "ComfyUI-JM-KLing-API", or git clone into custom_nodes + pip install -r requirements.txt). Then: API Key node → this node → Query Status → Video Downloader, run the queue, wait, collect.
Where people get burned
- Prompt too long. Over 2500 characters and the node doesn't raise - it returns
"Error: ..."as your task_id and"failed"as status. Check the console. - Missing token. Same pattern:
"API token is required"comes back as a string, not a crash. - Cost shock. Every successful run bills your Kling account, and this pack re-executes when inputs change. The KB has people quoting roughly $1.50 for a 5-second 1080p clip on Kling's pricier tier. A fixed seed stops the node from re-firing on workflow edits - worth knowing before you queue something overnight.
- Expecting a video out. Not here. If your graph ends at this node you get a task ID and nothing to watch. It's always Task → Query → Download.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| api_token | STRING | — | |
| prompt | STRING | — | |
| model_nameopt | COMBO | kling-v1 | 2 options: kling-v1, kling-v1-6 |
| negative_promptopt | STRING | — | |
| cfg_scaleopt | FLOAT | 0.50–1 | — |
| modeopt | COMBO | std | 2 options: std, pro |
| aspect_ratioopt | COMBO | 16:9 | 3 options: 16:9, 9:16, 1:1 |
| durationopt | COMBO | 5 | 2 options: 5, 10 |
| seedopt | INT | -1-1–18446744073709550000 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| task_id | STRING | — |
| task_status | STRING | — |
| created_at | STRING | — |
| updated_at | STRING | — |
| seed | INT | — |