ComfyUI Node

Url Download

Pull a file from the internet straight into ComfyUI's output folder

By ty0x2333·Created 2 years ago·Updated 10 months ago· 196
Url Download
    • file_path
    url
    filename_prefixTyDev
    save_filetrue

    Sometimes your workflow needs a file that isn't on disk yet - a LoRA from a mirror, a video from a URL, a control image your script generated elsewhere. ComfyUI's usual flow is "download it yourself, drop it in input/." Url Download (TY_UrlDownload) cuts that step out: give it a URL, it streams the file down, saves it into ComfyUI's output folder (or temp), and hands you back the absolute file path as a STRING. Wire that into any node that accepts a path and you've got a self-fetching workflow.

    It's one of two file-I/O utils in ty0x2333's ComfyUI-Dev-Utils pack (the other is Upload Anything). Small, MIT-licensed, no model files. The actual download runs on requests, which ComfyUI core already ships, so there's nothing extra to install beyond the pack itself.

    What you set

    Three inputs, and you'll mostly touch the first two:

    • url - the remote file, required. The on-disk name is derived from the URL path, so https://…/models/vae-fp16.safetensors becomes something like TyDev-vae-fp16.safetensors.
    • filename_prefix - defaults to TyDev. This is the folder/name base, using the same scheme core's save nodes use: set it to a descriptive name and you can actually find what you downloaded afterward.
    • save_file - defaults to true, which lands the file in ComfyUI/output/. Flip it to false and it goes to the temp directory instead, handy for throwaway intermediates you don't want cluttering output.

    The single output, file_path (STRING), is the full filesystem path to the downloaded file. That's the entire point - a plain string you can route into any node that takes an absolute path: a "load from path" style loader, a video or audio node, a script or process node. If what you actually wanted was for the file to show up in core's input-folder dropdowns, that's not this node; it writes to output/temp and hands you the path.

    How it works

    Straightforward under the hood. It parses the URL for the file extension, resolves a collision-free filename (appending -1, -2 if the name already exists so it never silently overwrites), then streams the download with a ComfyUI progress bar on the run. It streams rather than loading into memory, so a multi-GB file is fine.

    Install

    Via ComfyUI Manager, search "ComfyUI-Dev-Utils". Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ty0x2333/ComfyUI-Dev-Utils.git
    cd ComfyUI-Dev-Utils
    pip install -r requirements.txt
    

    Then restart. The requirements.txt only pins aiohttp-sse (for the pack's log console); Url Download's own dependencies are already ComfyUI core.

    Gotchas

    The node trusts the URL and the server, with no retry logic - a flaky mirror means a failed run, so just re-run. Filenames are derived, not chosen, and the uniquify step kicks in on collision, so don't hardcode exact output names across runs. And because it returns an absolute path rather than a ComfyUI input-directory entry, everything downstream has to be able to consume raw paths. That's the "dev util" flavor of this pack: it's built for people scripting their own workflows, not for typical point-and-click chains. For that use, it's exactly the missing primitive.

    CategoryTyDev-Utils/Utils

    Inputs (3)

    NameTypeDefaultDescription
    urlSTRING
    filename_prefixSTRINGTyDev
    save_fileoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    file_pathSTRING