Nodes/ComfyUI-Kling-Direct/Kling Raw File Saver
ComfyUI Node

Kling Raw File Saver

Save a file from a URL or path without loading it into a tensor

By IxMxAMAR·Created 5 months ago·Updated 2 months ago· 4
Kling Raw File Saver
    • saved_path
    url_or_path
    filename_prefixkling_save
    formatauto

    The Kling pack hands you files three ways: as tensors, as hosted URLs, and as paths on disk. KlingDirect_RawFileSaver is the node that turns "a URL or path somewhere" into "a file sitting in my output folder" - without decoding it, without loading it into a tensor, without any API call. It's the counterpart to Raw File Loader, and it's the right tool whenever you want to keep the raw result of a generation around as a real file.

    It's an output node (OUTPUT_NODE = True), so it shows up in your workflow as a proper save point. Feed it url_or_path - a hosted result URL, or a local path that exists on disk - and it fetches or copies it into ComfyUI's output directory. filename_prefix sets the start of the filename (default kling_save), and format controls the extension: auto (default) guesses from the URL, or force .mp4, .mp3, .png, or .jpg. It returns saved_path so a downstream node can use the new location.

    Why you'd reach for it

    Every generation node in this pack already downloads its result as a side effect - the video_file / media_file outputs are downloaded paths. So when does Raw File Saver actually earn its keep?

    • You got a URL from somewhere that isn't a pack node - a url output you want preserved as a local file, a clip someone shared, a download you want versioned under a prefix.
    • You want to rename or re-organize - same file, new filename_prefix, parked in the output folder alongside everything else ComfyUI saves.
    • You need a plain file, not a tensor. Loading a 600-frame 1080p video into an IMAGE tensor is exactly the kind of thing that eats RAM; this node streams the bytes straight to disk and skips the tensor entirely.

    Install and what it needs

    It's part of ComfyUI-Kling-Direct: ComfyUI Manager → search "Kling Direct" → install, or git clone https://github.com/IxMxAMAR/ComfyUI-Kling-Direct into ComfyUI/custom_nodes, then restart. No API key, no credits - pure local I/O. The pack's dependency list (requests, Pillow, numpy, torch, opencv-python) is already satisfied by ComfyUI.

    Where people get burned

    • The auto format guess can miss. If the URL has no useful extension and the string doesn't contain "video" or "png," auto falls back to .mp4 for anything with "video" in it, else .png. For an audio URL with a weird path, set format explicitly or you'll get a mislabeled file.
    • It won't save nothing. Give it an empty url_or_path and it just returns an empty string - no file, no error. Not a bug, but it means a blank input silently produces no output.
    • The security guardrail is real. Downloads are guarded against SSRF and scheme abuse in v2.1, and fetching from loopback/RFC1918 hosts is blocked unless you set KLING_ALLOW_INTERNAL_HTTP=1. A URL pointing at your own localhost service will be refused by default.

    If you need the media as an actual tensor for post-processing, use the pack's Video Loader instead. If you need it as a file, this is the cleanest path - zero decode, zero memory spike, done.

    CategoryKling AI/Config

    Inputs (3)

    NameTypeDefaultDescription
    url_or_pathSTRINGURL or local file path to save.
    filename_prefixSTRINGkling_savePrefix for the saved filename.
    formatCOMBOautoOutput format. 'auto' detects from URL.

    Outputs (1)

    NameTypeDescription
    saved_pathSTRING