Nodes/ComfyUI-KlingAI/Kling 首尾帧到视频
ComfyUI Node

Kling 首尾帧到视频

Two stills, a prompt, and a bridge between them

By awsl1110·Created 5 months ago·Updated 5 months ago· 0
Kling 首尾帧到视频
    • video_url
    提示词
    首帧URL
    模式
    时长5
    API令牌
    模型名称
    尾帧URL
    元素ID列表
    添加水印false
    回调地址
    自定义任务ID
    等待超时秒600

    You have a start frame and you have an end frame, and you want the model to invent everything in between. That's Kling 首尾帧到视频 (first-and-last-frame to video), and it's the most reliable-feeling node in this pack for a simple reason: the model can't drift off into whatever it wants, because the opening and closing shots are locked in. Great for scene transitions, Ken Burns-style camera moves, morphing one subject into another, or looping a clip back to its own first frame.

    Like every generation node here, it doesn't render locally. It's an API wrapper over Kuaishou's Kling OmniVideo endpoint - your two images and a prompt go to Kuaishou's servers, and you get back a URL. Closed model, pay per call, no VRAM, no open-weight fallback. The one thing this node does that its siblings don't: you never pick an aspect ratio. Kling reads it from the first frame, so whatever canvas you give it is the canvas you get.

    How it works

    Under the hood it builds an image_list of two entries: your 首帧URL tagged first_frame, your 尾帧URL tagged end_frame. That list goes to POST /v1/videos/omni-video on api-beijing.klingai.com, the node polls the task every five seconds until it's succeed, and it returns the first video_url from the result. The whole "generation" is a request-then-poll loop - which is why the 等待超时秒 (wait timeout) input exists. Task runs in the cloud either way; if the node times out, your video still finishes on Kling's side and you can pull it from the console with the task ID.

    The inputs that actually matter

    • 首帧URL (First frame URL) - required. A public image URL.
    • 尾帧URL (End frame URL) - optional. Leave it empty and you've essentially got an image-to-video that just happens to be governed by the first frame. The magic happens when you set both.
    • 提示词 (Prompt) - describe the transition: the motion, the camera, what changes between the frames. This is the text that steers the tween.
    • 模式 (Mode) - pro / std / 4k. Pro is slow and credits-expensive; std is the sane default for iterating; 4k only makes sense on a finished idea.
    • 时长 (Duration) - 3–15 seconds, default 5.
    • API令牌 (API token) - wire this to the api_token output of a KlingAuth node, or you get api_token is required.

    Everything else is optional and mostly ignorable on day one: 模型名称 (defaults to kling-video-o1, or kling-v3-omni), 元素ID列表 (element IDs from the platform), 添加水印 (watermark, off by default), 回调地址 (webhook URL), 自定义任务ID (your own tracking ID), and 等待超时秒 (up to 1800).

    Output: video_url (STRING), which you'll usually feed straight into Kling 下载视频 to get a real VIDEO object 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 use ComfyUI Manager, search "ComfyUI-KlingAI"). The only dependency is requests + PyJWT - no model files, no GPU.

    Gotchas

    • Both frames need to be public URLs. A local path or a file:// link won't work - the server has to fetch them, so upload somewhere reachable first.
    • First frame dictates the aspect ratio, and you can't override it. If you want 16:9, make sure your first frame is 16:9; the end frame gets letterboxed/cropped to match.
    • Frame URLs and prompt go to Kuaishou's servers, under their content policy. Nothing you feed this node stays private.
    • Don't be surprised if a tween "fails" a couple of times with a weird subject morph - that's the model doing what prompt tweaks are for. Iterate on the prompt, not the frames.
    CategoryKlingAI

    Inputs (12)

    NameTypeDefaultDescription
    提示词STRING
    首帧URLSTRING
    模式COMBO3 options: pro, std, 4k
    时长INT53–15
    API令牌optSTRING
    模型名称optCOMBO2 options: kling-video-o1, kling-v3-omni
    尾帧URLoptSTRING
    元素ID列表optSTRING
    添加水印optBOOLEANfalse
    回调地址optSTRING
    自定义任务IDoptSTRING
    等待超时秒optINT60060–1800

    Outputs (1)

    NameTypeDescription
    video_urlSTRING