Nodes/ComfyUI-Vivax-Nodes/Model From URL
ComfyUI Node

Model From URL

Point a Node at a URL and It Downloads the Model File for You

By vivax3794·Created 2 years ago·Updated 2 years ago· 3
Model From URL
    • ckpt_name
    url
    folderloras
    force_updatefalse
    filename

    Most ComfyUI workflows end with "oh, you also need to download this LoRA manually and drop it in the folder." Model From URL kills that step: you give it a direct file URL, it downloads the model into the right ComfyUI folder, and it outputs the filename - which you then wire straight into a LoRA loader or checkpoint loader. Share a workflow with a friend, and they never have to hunt down the file.

    It's a small node with one real job, and it's genuinely useful for reproducible workflows. Give it a URL, a target folder, and it produces something a loader can consume.

    How it works

    Under the hood it's a requests streaming download with a couple of conveniences. It fetches the URL in streamed chunks (with a ComfyUI progress bar so you can watch it), writes the file to the folder you named, and returns the filename. Two details make it feel thoughtful:

    • Filename resolution. If you don't pass a filename, it tries to pull one from the content-disposition response header - that's the header download links carry when the actual name lives in the URL query. If that fails, it falls back to the last segment of the URL.
    • Skip-if-exists. It checks the target folder first. If the file is already there and force_update is off, it skips the download entirely and just hands you the filename. Run a workflow twice and the second run is instant.

    The inputs and outputs

    • url (STRING) - direct link to the model file. Has to be a real, direct-download URL (.safetensors on a file host, not a model page).
    • folder (STRING, default loras) - which ComfyUI model folder to save into. This is a folder name from ComfyUI's folder system - checkpoints, loras, vae, clip, unet and friends all work.
    • force_update (BOOLEAN, default false) - set true to re-download even when the file already exists.
    • filename (STRING, optional) - set it when the URL's filename is ugly or the header guess is wrong.

    Output:

    • ckpt_name (* wildcard) - the saved filename, ready to wire into a loader's name input.

    Common issues

    • "Failed to get file" and nothing else. A bad URL, a 404, or a host that blocks the request raises an exception and stops the workflow. Check the URL works in a browser first, and prefer hosts that serve direct files with stable links.
    • Folder names are not free text. The folder input must match a real ComfyUI model folder name. Type models/loras or something invented and the node fails because it looks up the path by that exact key.
    • Sketchy files from sketchy hosts. This node writes whatever bytes the URL returns into your model directory, and ComfyUI will happily load them. That's the supply-chain attack surface in miniature - the same reason the ecosystem's security docs tell you to be picky about where models come from. Downloading from random pastebins is how you end up running someone else's payload. Stick to trusted hosts.
    • Loader name mismatch. The output filename has to be the exact name the loader expects. If a workflow passes a hardcoded filename that doesn't match what the URL produced, use the filename input to force it.

    Install

    Install with ComfyUI Manager (search ComfyUI-Vivax-Nodes) or clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vivax3794/ComfyUI-Vivax-Nodes
    

    then restart ComfyUI. The pack's only dependency is rich (Manager installs it; pip install rich if you cloned by hand). Downloads need no API key - just network access from the machine running ComfyUI. Single-author pack, small codebase; give the repo a skim before trusting it with write access to your model folders.

    Categoryvivax

    Inputs (4)

    NameTypeDefaultDescription
    urlSTRING
    folderSTRINGloras
    force_updateBOOLEANfalse
    filenameoptSTRING

    Outputs (1)

    NameTypeDescription
    ckpt_name*