Nodes/ComfyUI-KlingAI/Kling 编辑视频
ComfyUI Node

Kling 编辑视频

Tell Kling to change the scene, not re-render it

By awsl1110·Created 5 months ago·Updated 5 months ago· 0
Kling 编辑视频
    • video_url
    提示词
    视频URL
    模式
    API令牌
    模型名称
    保留原声yes
    参考图1
    参考图2
    参考图3
    参考图4
    元素ID列表
    添加水印false
    回调地址
    自定义任务ID
    等待超时秒600

    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 hit api_token is required.
    • 保留原声 (Keep original sound) - yes / no, default yes. 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.
    CategoryKlingAI

    Inputs (15)

    NameTypeDefaultDescription
    提示词STRING
    视频URLSTRING
    模式COMBO3 options: pro, std, 4k
    API令牌optSTRING
    模型名称optCOMBO2 options: kling-video-o1, kling-v3-omni
    保留原声optCOMBOyes2 options: yes, no
    参考图1optSTRING
    参考图2optSTRING
    参考图3optSTRING
    参考图4optSTRING
    元素ID列表optSTRING
    添加水印optBOOLEANfalse
    回调地址optSTRING
    自定义任务IDoptSTRING
    等待超时秒optINT60060–1800

    Outputs (1)

    NameTypeDescription
    video_urlSTRING