Nodes/ComfyUI-KLingAI-API/KLingAI Preview Video
ComfyUI Node

KLingAI Preview Video

Turn a KLing result URL into an actual file on disk

By KlingAIResearch·Created 2 years ago·Updated 10 months ago· 174
KLingAI Preview Video
    • file_path
    video_url
    filename_prefixKLingAI
    save_outputtrue

    Every video-generating node in this pack - Text2Video, Image2Video, Effects, Lip-Sync, Video-Extender - hands you back a url output, a plain string pointing at a video sitting on KLing's CDN. That's it. There's no built-in video player node in core ComfyUI wired to catch it, and a string floating in your graph isn't a video you can actually watch or use downstream. KLingAI Preview Video is the small utility that closes that gap: point it at the URL and it downloads the file and drops it into your ComfyUI output folder like a normal Save/Preview node would.

    How it works

    It's a straightforward download-and-save node, not a generative one - no client, no API key logic of its own beyond fetching the file. Wire a url output from any of the pack's video nodes into this node's video_url input, and on run it pulls the file down over HTTP and writes it to disk under the filename prefix you set.

    The inputs and outputs that matter

    All three fields are required, and there's no optional section:

    • video_url - the string URL from a KLing generation node. This is the one input you'll actually wire up.
    • filename_prefix (default "KLingAI") - what the saved file is named, same convention as core ComfyUI's Save Image node.
    • save_output (default true) - toggle off if you want to preview without permanently writing the file (useful while iterating on a prompt and you don't want your output folder filling up with throwaway clips).

    The output is file_path - the local path to the saved file, which you can feed into anything downstream that expects a path string, or just note down to grab the file manually.

    Installing it

    It ships as part of the same pack as everything else here. ComfyUI Manager: search ComfyUI-KLingAI-API. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/KwaiVGI/ComfyUI-KLingAI-API
    cd ComfyUI-KLingAI-API && pip install -r requirements.txt
    

    No API key needed for this specific node - it's not talking to KLing's authenticated API, just downloading a public result URL - but obviously you need the rest of the pack (and a valid key on a Client node) to actually produce a video for it to fetch in the first place.

    Common issues

    The main practical habit worth building: treat KLing result URLs as something to consume right away, in the same session you generate them, rather than saving the url string in a workflow JSON and coming back to it later - cloud-hosted result links like this one are the kind of thing that commonly get cleaned up or expire on the provider's side, so run this node while the clip is fresh instead of assuming the link is permanent. Beyond that, since it's a plain HTTP fetch, a failed download usually just means no outbound network access from wherever ComfyUI is running to KLing's CDN - worth checking before assuming the node itself is broken.

    CategoryKLingAI

    Inputs (3)

    NameTypeDefaultDescription
    video_urlSTRING
    filename_prefixSTRINGKLingAI
    save_outputBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    file_pathSTRING