ComfyUI Node

DownloadLinkChecker

Pull Your Whole Colab Training Run Off Hugging Face

By adbrasi·Created 3 years ago·Updated 2 years ago· 7
DownloadLinkChecker
    • LIST
    LINK
    OUTPUT
    START_NUMBER0
    END_NUMBER130
    SYMLINK_DIRECTORY
    huggingface_token_for_private_repo

    The one-job node that does what it says

    You trained a LoRA in Google Colab, your checkpoints auto-uploaded to Hugging Face as my-lora-000000.safetensors, my-lora-000001.safetensors, and so on, and now they're sitting on a server instead of in your ComfyUI models folder. DownloadLinkChecker exists for exactly this gap: you give it one HF download link, tell it the step range, and it batches the whole run down with wget.

    It comes from a hobbyist pack whose README is refreshingly honest about the author's skill level ("I'm not a programmer," says adbrasi, who plans a Kohya node next). Set expectations accordingly: it's not polished, but for its one job - downloading a numbered run of Hugging Face files - it works, and there's basically nothing else in the graph that does it.

    How it works

    The node takes a Hugging Face file URL of the kind you get from the Files tab - the one ending in ?download=true. That direct-download link is a real community staple (hundreds of threads use the trick to pull files past HF's web UI), and the node is built around it. It strips the query string, finds the number at the end of the filename (the chunk after the last dash, before the extension), zero-pads it to six digits, and generates a URL for every step in your START-to-END range. Those links get written to links.txt in your OUTPUT folder, then it shells out to:

    wget -P /path/to/output -i /path/to/output/links.txt
    

    Give it huggingface_token_for_private_repo and it appends Authorization: Bearer <token> to that wget call, which is how you pull a private repo. Give it SYMLINK_DIRECTORY and, once the download finishes, it creates symlinks from each downloaded file into that folder - the classic way to make a fresh LoRA show up inside ComfyUI's models/loras without copying a gigabyte of safetensors. Then it hands back a LIST of everything in the output folder.

    The inputs that matter

    Only a handful are worth touching on a first run:

    • LINK - the HF download URL. The filename needs a number as its last dash-separated chunk (like flast-lora-000005.safetensors), because that's what gets replaced.
    • OUTPUT - a folder that must already exist. The node checks with os.path.isdir; if it doesn't exist you get an empty list back, silently.
    • START_NUMBER / END_NUMBER - the step range. This is the trap: END_NUMBER defaults to 130, so if you trained 5 steps and forget to change it, wget will try to download 131 files. Change it.
    • SYMLINK_DIRECTORY - optional; symlink the results into e.g. your LoRA folder.
    • huggingface_token_for_private_repo - optional; only needed for private repos.

    The single output, LIST, holds the filenames in the output folder. In the pack's example workflow it plugs straight into ShowFileNames so you can read what actually landed.

    Install

    Either via ComfyUI Manager (search "ComfyUI-TrashNodes-DownloadHuggingface") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/adbrasi/ComfyUI-TrashNodes-DownloadHuggingface
    

    then restart ComfyUI. No requirements.txt, no Python deps - the whole pack is stdlib. The real dependency is the wget binary, which the node calls from your system. Linux has it; macOS stopped shipping it by default (brew install wget fixes that); Windows almost certainly doesn't have it unless Git for Windows or chocolatey put it there. Check with wget --version before you blame the node.

    Where people get burned

    • Missing wget - the most common failure, especially on Windows; you'll see the command-not-found error.
    • The default 130 - see above. Set END_NUMBER to your actual last step.
    • OUTPUT that doesn't exist - no error, just []. Create the folder first.
    • Filename shape - if your checkpoint is named v7.safetensors with no number, the link generator has nothing to replace and the range math collapses.
    • Symlinks on Windows - creating symlinks needs developer mode or an admin shell; without it the symlink pass throws.
    • The node blocks the UI - it's a synchronous subprocess.run, so ComfyUI waits until every file is down. Big runs mean staring at a frozen canvas; that's normal, not a crash.

    It's a blunt instrument from a tiny pack, and the same "custom nodes run arbitrary code" caution that applies to every single-node repo applies here - glance at the __init__.py before you run it. But if you live the Colab→HF→ComfyUI pipeline, this is the fastest way off the "click download fifty times" treadmill.

    Categoryexamples

    Inputs (6)

    NameTypeDefaultDescription
    LINKSTRING
    OUTPUTSTRING
    START_NUMBERINT0
    END_NUMBERINT130
    SYMLINK_DIRECTORYoptSTRING
    huggingface_token_for_private_repooptSTRING

    Outputs (1)

    NameTypeDescription
    LISTLIST