BYOKey Kling Text to Video
Kling text-to-video — pick your mode/duration/model combo, go
- output
- video_id
- duration
Kling is the Chinese video generator that earned a real reputation for strong motion and cinematic output, and BYOKey_Kling_Text2Video is how it gets into your ComfyUI graph. It calls Kling's API (api.klingai.com) with your key as a Bearer token and returns a real ComfyUI VIDEO - no Comfy proxy, no credits. Same bring-your-own-key pitch as the rest of the pack, pointed at one of the more interesting hosted video models.
What's distinctive about this node is how the config works: instead of separate model/duration/mode dropdowns, Kling's text-to-video path gives you one combined mode selector that packs all three together - the tooltip spells out the pattern: "Configuration: mode / duration / model_name." Ten presets like "pro mode / 5s duration / kling-v2-master" or "standard mode / 10s duration / kling-v1-6." It's opinionated, and it's actually convenient: you pick a preset that matches your budget and quality target instead of mixing incompatible options yourself.
How it works
Standard submit-and-poll: POST a generation request, poll until it's done, download the result, wrap it in ComfyUI's VIDEO output. The node blocks while it waits, governed by poll_interval (default 10s) and max_wait (default 600s).
The inputs that matter
mode- the combined preset dropdown described above. The choices map cleanly: standard mode is cheaper, pro mode is higher quality, and the model in each preset (kling-v1-6 through kling-v2-master / v2-5-turbo) climbs in capability with the price. Default is "pro mode / 5s duration / kling-v2-5-turbo."prompt+negative_prompt- the video prompt and what to avoid. Both go up to 2500 characters, so you have room for a real shot description and a meaningful negative.cfg_scale- 0 to 1, default 1. How closely the video follows the prompt. Lower if the model is over-adhering (stiff, literal motion); higher if it drifts.aspect_ratio- 16:9, 9:16, or 1:1.poll_interval/max_wait- the queue-waiting knobs.
The outputs are the interesting bit: alongside output (VIDEO) you also get video_id and duration as STRINGs - Kling returns a task id, and if your workflow tracks generations by id (or you want the actual duration for downstream timing), those are there.
Installing it
It's one of 37 nodes in comfyui-byokey, no extra dependencies beyond ComfyUI's bundled torch/aiohttp/PIL/numpy/av. Install via ComfyUI Manager (search "byokey") or:
cd ComfyUI/custom_nodes
git clone https://github.com/MeteorAndy/comfyui-byokey.git
Restart, and it's under api/byokey/video. No model downloads - Kling does the work.
Gotchas
Two things to internalize. First, the preset system means you can't mix "standard mode with kling-v2-5-turbo" - and there's a reason: the tooltip on the pack's image-to-video sibling notes v2-5-turbo forces pro mode anyway. If a preset combination doesn't exist, that's not a bug, it's Kling's constraint. Second, the mode default ("pro / 5s / v2-5-turbo") is the priciest starting point - switch down to a standard preset for iteration and only spend pro credits on takes you care about. Video is the expensive end of this pack, and Kling pro mode is no exception. Standard hygiene: your key is saved into the workflow JSON, so scrub before sharing. If Kling is the motion quality you want, this node is the clean path.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Kling API key (Bearer token) | |
| base_url | STRING | https://api.klingai.com | Kling API host. Override for relays/proxies. |
| prompt | STRING | Positive text prompt. Max 2500 characters. | |
| negative_prompt | STRING | Negative text prompt. Max 2500 characters. | |
| cfg_scale | FLOAT | 1.000–1 | How closely the video follows the prompt. |
| aspect_ratio | COMBO | 16:9 | 3 options: 16:9, 9:16, 1:1 |
| mode | COMBO | pro mode / 5s duration / kling-v2-5-turbo | Configuration: mode / duration / model_name. |
| poll_intervalopt | INT | 101–120 | Seconds between status polls. |
| max_waitopt | INT | 60030–3600 | Max seconds to wait for completion. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output | VIDEO | — |
| video_id | STRING | — |
| duration | STRING | — |