Nodes/ComfyUI-KLingAI-API/Video Extender
ComfyUI Node

Video Extender

Keep a KLing clip going past its original ending

By KlingAIResearch·Created 2 years ago·Updated 10 months ago· 174
Video Extender
  • client
  • url
  • video_id
video_id
prompt

Every video model in this pack tops out at a duration of 5 or 10 seconds per call - the community has spent a lot of effort on the open-source side building tricks to get past exactly this kind of hard cap (error-recycling LoRAs, loop joiners, and the like, for models like Wan). KLing solves it server-side instead: Video Extender takes a clip you've already generated and continues it, picking up from where the original left off with a new prompt guiding what happens next.

How it works

The catch that matters most: this only works on a video_id KLing already knows about - a clip that came out of one of this pack's own generation nodes (Text2Video, Image2Video, Effects, Lip-Sync). There's no video_url option here the way there is on Lip-Sync or Video2Audio, so you can't feed it an arbitrary uploaded video and ask it to extend that - KLing needs its own record of the clip to continue generating from the same underlying state, not just the visible pixels.

The inputs and outputs that matter

All three fields are required, and it's a short list:

  • video_id - the clip to extend, chained straight from a prior node's video_id output in the same graph.
  • prompt - what should happen in the extended portion. Since the original clip already established subject, setting, and style, this prompt only needs to describe the continuation - new action, camera movement, or a shift in the scene - not re-describe everything from scratch.

Outputs are url (the extended clip) and video_id - and that new id is itself chainable back into another Video Extender call if you want to keep stretching the same generation further, or into Video2Audio/Lip-Sync to finish it off.

Installing it

ComfyUI Manager: search ComfyUI-KLingAI-API, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/KwaiVGI/ComfyUI-KLingAI-API
cd ComfyUI-KLingAI-API && pip install -r requirements.txt

No local model weights - a Client node with a valid KLing AI API key wired in, region-matched via area, is what actually runs this.

Common issues

The most common mistake is trying to extend a video that didn't come from this pack - since there's no video_url input, an externally sourced clip simply isn't extendable here at all, only clips with a KLing-issued video_id are. Beyond that, keep the continuation prompt focused on what's new rather than restating the whole scene; over-describing tends to fight with the established look of the first segment instead of building on it smoothly. And since each extension is its own billed call on top of whatever the original generation already cost, chaining several extensions in a row to build a longer clip adds up fast - worth deciding up front roughly how long you actually need the final video before looping this repeatedly. As everywhere else in the pack, an authentication failure or an empty balance on the upstream Client node will stop this cold, independent of anything about the video itself.

CategoryKLingAI

Inputs (3)

NameTypeDefaultDescription
clientKLING_AI_API_CLIENT
video_idSTRING
promptSTRING

Outputs (2)

NameTypeDescription
urlSTRING
video_idSTRING