Kling 下载视频
Turn that video_url string into a real VIDEO in your graph
- 视频
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_urloutput 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'sVIDEOtype.
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 orcurl. - The output is a fresh file every run -
kling_<timestamp>.mp4- so you'll accumulate files inoutput/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_urlis (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.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| 视频URL | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 视频 | VIDEO | — |