Nodes/ComfyUI-KlingAI/Kling 下载视频
ComfyUI Node

Kling 下载视频

Turn that video_url string into a real VIDEO in your graph

By awsl1110·Created 5 months ago·Updated 5 months ago· 0
Kling 下载视频
    • 视频
    视频URL

    Every generation node in ComfyUI-KlingAI ends the same way: a plain string called video_url dangling off the output. A URL is a great thing to be handed - it means the cloud did the heavy lifting and you paid nothing for local compute - but a string can't be previewed, saved, or piped into a video-processing node. Kling 下载视频 (download video) is the bridge: it fetches that URL, saves the file to your ComfyUI output directory, and hands the graph a native VIDEO object instead of text.

    It's the final node in every workflow this pack ships, and it's almost aggressively simple: one input, one output, no settings. If you've used the pack more than once, this is the node you'll stop thinking about - it just works, until it tells you your ComfyUI is too old for it (more on that below).

    How it works

    Nothing exotic. The node takes the URL string, downloads it with Python's urllib.request.urlretrieve, and writes it to output/kling_<unix-timestamp>.mp4 in your ComfyUI folder. Then it wraps the file in ComfyUI's native video type via comfy_api.input_impl.VideoFromFile and returns it as 视频 (VIDEO), with a videos entry in the UI payload so it shows up in your output history like any other render.

    The one real technical wrinkle: native VIDEO support is a newer-ComfyUI feature. If your install predates it, the node errors with something like "ComfyUI VIDEO 类型不可用" - the type doesn't exist yet, so the node can't fabricate it. That's the error that sends people to the GitHub issues, and the fix is either upgrading ComfyUI or skipping the node entirely.

    Inputs and outputs

    • 视频URL (Video URL) - required, a string. Normally the video_url output of any Kling generation node in this pack, but here's a free bonus: it's just a downloader. You can feed it any public video URL and it'll happily save it as an mp4. Don't abuse that, but know it.
    • Output: 视频 (VIDEO) - wire it into video preview/save nodes, video editors, frame extractors, or anything downstream that accepts ComfyUI's VIDEO type.

    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 → "ComfyUI-KlingAI"). Only requests + PyJWT; no models, no GPU.

    Gotchas

    • "VIDEO type unavailable" means upgrade ComfyUI, not reinstall this pack. The node needs comfy_api.input_impl.VideoFromFile, which shipped in newer builds. If you can't or won't upgrade, the README's workaround is fine: skip this node and download the URL yourself with a browser or curl.
    • The output is a fresh file every run - kling_<timestamp>.mp4 - so you'll accumulate files in output/ if you don't clean up. Old render caches are a classic ComfyUI mess, and this node contributes to it.
    • The URL has to be reachable from your machine. A Kling video_url is (they're signed, expiring CDN links), but if you're piping in some random URL, remember the file gets pulled to your machine - a URL that works in a browser but blocks non-browser user agents will fail here.
    • One more thing to like: this node means you don't have to leave ComfyUI to claim your result. The whole loop - auth, generate, download - stays in the graph, which is the point of an API-wrapper pack.
    CategoryKlingAI

    Inputs (1)

    NameTypeDefaultDescription
    视频URLSTRING

    Outputs (1)

    NameTypeDescription
    视频VIDEO