Nodes/ComfyUI API Toolkit/Kling Video Extend
ComfyUI Node

Kling Video Extend

Extend a Kling clip without rerolling the whole video

By IxMxAMAR·Created 5 months ago·Updated 2 months ago· 1
Kling Video Extend
  • auth
  • video
  • video
  • video_file
  • audio
  • url
  • task_id
video_id
prompt
negative_prompt
cfg_scale0.50

Kling Video Extend is the "what happens next" button for a Kling generation. You got a 5-second clip you actually like, and you want it to keep going - same look, same motion, more story - without re-rolling the whole thing and betting the second render matches the first. You feed it the task ID of the clip that made the original, give it a prompt for the new stretch, and Kling appends more frames onto the end. It's the cheapest way to turn a short test into a longer take, and the node exists because that's genuinely not something you can do locally with this model.

Like every node in this pack, this one doesn't run anything on your GPU. It's an API wrapper: your prompt goes up to Kling's servers, the job runs there, and the finished clip gets downloaded back into your output folder. That means no VRAM hit, but it also means your prompt (and whatever video you're extending) leaves your machine, and every job costs credits. For a model with no open weights, that's the only door in - the local path simply doesn't exist for Kling.

The inputs that matter

Only four of them, and two are easy:

  • auth - plug in a KLING_AUTH from the Kling AI Authentication node (access key + secret key, get them from app.klingai.com/global/dev after you activate the API).
  • video_id - this is the trap. It's not a filename and it's not a URL; it's the task ID of a previous Kling generation. Wire the task_id output of any earlier Kling video node straight into this field. If you clear that link, you'll be hunting in the console logs for an ID to paste.
  • prompt - describes the extended portion. Think "what happens after this shot ends," not a re-description of the clip you already have.
  • negative_prompt - things to avoid, same job it does locally.
  • cfg_scale - classifier-free guidance, on a 0–1 scale with a default of 0.5. That's the Kling idiom: local samplers live at 4–8, Kling lives below 1. Leave it alone until you've seen a couple of outputs.

There's also an optional video IMAGE input, which lets you supply a frame as context if you're chaining things oddly. You'll rarely need it.

What comes out

Five outputs, and you only really use two. video is the extended clip as an IMAGE batch (frames you can feed into a preview node or a local video saver), and task_id is the gold - that's the ID you hand to the next Video Extend if you're building a longer sequence, or to Kling AI Upscale if you want to blow the finished clip up. video_file is the path of the .mp4 saved in your output directory, url is the hosted link Kling returned, and audio is the soundtrack pulled from the clip. Because every API node here implements IS_CHANGED, each queue run fires a fresh (and fresh-billed) job - no stale caching.

Installing

ComfyUI Manager, search "API Toolkit", install, restart. Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-API-Toolkit
cd ComfyUI-API-Toolkit
pip install -r requirements.txt   # requests + PyJWT is all Kling needs

Then add the Kling AI Authentication node to your workflow and wire its auth output in.

Common issues

The big one: this node looks frozen for minutes and isn't. Kling video jobs are async - the node submits the task, then polls it every few seconds for up to 20 minutes, printing status lines to your console the whole time. A 5-second extension can take a couple of minutes in "pro" mode. That's normal, and yes, it's slower and pricier than local video - that's the trade for a model you can't download. If a task actually fails, the console prints the Kling error and the node raises it. And if your video_id is empty or stale, you'll get an error back from the API fast, not a mysterious hang - so double-check the task_id link first.

Kling also enforces its own content moderation on everything you send. There's no local weights to patch and no community bypass; if Kling refuses a prompt, the node refuses it, full stop.

CategoryAPI Toolkit/Kling AI/Video

Inputs (6)

NameTypeDefaultDescription
authKLING_AUTH
video_idSTRINGTask ID of the video to extend (from a previous generation).
promptSTRINGPrompt for the extended portion.
negative_promptSTRINGThings to avoid in the extended video.
cfg_scaleFLOAT0.500–1Classifier-free guidance scale.
videooptIMAGE

Outputs (5)

NameTypeDescription
videoIMAGE
video_fileSTRING
audioAUDIO
urlSTRING
task_idSTRING