Kling 编辑视频
Tell Kling to change the scene, not re-render it
- video_url
A quick note up front: on comfy.icu this node is filed under the showy name "🎬 Kling Omni: Video Edit," but that branding belongs to a different Kling pack (ComfyUI-KLingAI-OmniVideo); the class names collide. What this repo ships is the plainer Kling 编辑视频 (edit video) - and it's a great node, just under a confusing flag. You'll know you have the right one because its inputs are Chinese and it wants a 视频URL string, not a frame batch.
The pitch: instead of re-generating a clip from scratch and hoping it resembles the source, you give Kling the actual video and an instruction. "Change the clothes to red." "Make it snow." "Turn the character around." Kling re-renders the footage to match. This is instruction-based video editing, which is a genuinely different tool from image-to-video - you keep the motion, the lighting, the performance, and mutate the content. For fixing one element in an otherwise-good clip, it beats every re-generation workflow you'll write by hand.
How it works
Like the rest of the pack, it's a wrapper over Kuaishou's OmniVideo API. The node builds a video_list with your URL tagged refer_type: "base" (meaning "this is the thing to edit, not a style reference"), appends your prompt, and ships it off to api-beijing.klingai.com. Two things get forced regardless of what you set: sound is hard-coded off at the API level (the API demands it when a source video is present), and duration/aspect ratio are not sent - they're taken from the source video, so there are no sliders for them. Up to four 参考图 (reference images) can ride along to show Kling the target look or subject.
The inputs that matter
- 提示词 (Prompt) - required, and it's an instruction, not a description: "change the background to a beach," "make the character wave." The English default in the codebase is literally "Change the clothes to red."
- 视频URL (Video URL) - required. A public URL to the clip you want edited.
- 模式 (Mode) -
pro/std/4k. - API令牌 (API token) - wire in a Kling Auth node's
api_token, or you'll hitapi_token is required. - 保留原声 (Keep original sound) -
yes/no, defaultyes. Whether the original audio track survives the edit. - 参考图1–4 (Reference images 1–4) - optional; total reference images can't exceed four.
Output: video_url (STRING) - feed it into Kling 下载视频 to get a VIDEO in your graph.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/awsl1110/ComfyUI-KlingAI
pip install -r ComfyUI-KlingAI/requirements.txt
Restart ComfyUI (or ComfyUI Manager → search "ComfyUI-KlingAI"). Just requests + PyJWT, no models, no GPU.
Gotchas
- The source video must be a reachable public URL. The Kling servers fetch it themselves; a local file path won't resolve.
- You can't set the output length or aspect ratio here - they inherit from the input clip. If you need a different canvas, re-frame the source first.
- Sound is off in the API regardless of the 保留原声 label - that field controls whether the original audio is carried, not whether audio is generated. Don't expect this node to add a soundtrack.
- Your clip and prompt go to Kuaishou's servers. Same data-leaves-the-machine caveat as every node in this pack; don't edit anything you'd mind being hosted.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| 提示词 | STRING | — | |
| 视频URL | STRING | — | |
| 模式 | COMBO | 3 options: pro, std, 4k | |
| API令牌opt | STRING | — | |
| 模型名称opt | COMBO | 2 options: kling-video-o1, kling-v3-omni | |
| 保留原声opt | COMBO | yes | 2 options: yes, no |
| 参考图1opt | STRING | — | |
| 参考图2opt | STRING | — | |
| 参考图3opt | STRING | — | |
| 参考图4opt | STRING | — | |
| 元素ID列表opt | STRING | — | |
| 添加水印opt | BOOLEAN | false | — |
| 回调地址opt | STRING | — | |
| 自定义任务IDopt | STRING | — | |
| 等待超时秒opt | INT | 60060–1800 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_url | STRING | — |