Nodes/ComfyUI-Backup/HF Backup Models
ComfyUI Node

HF Backup Models

One click and your entire ComfyUI models folder lives on Hugging Face

By romandev-codex·Created 7 months ago·Updated 7 months ago· 0
HF Backup Models
    • status
    repo_idusername/comfyui-models-backup
    private_repotrue
    skip_existingtrue
    remove_differencefalse
    num_workers4
    token

    The name isn't a lie. HuggingFaceBackup (it shows up as HF Backup Models in the node picker) does exactly what it says: run it and your entire ComfyUI models folder - checkpoints, LoRAs, VAEs, ControlNet weights, upscalers, embeddings, all of it - gets pushed to a Hugging Face repo as a backup. No inference, no re-download at generation time, just files leaving your machine so they survive the day your SSD doesn't.

    Why you'd reach for this: models are the one part of ComfyUI that genuinely hurts to rebuild. Your workflows are a few KB of JSON you can drag into a Discord message. Your custom nodes are a git clone and a requirements.txt away - and when people ask how to back up a ComfyUI install, the standing community answer is exactly that, plus "just rsync it." What nobody has a good answer for is the 150 GB of checkpoints and LoRAs sitting in models/, because re-downloading all of it takes forever and some of it you can't even find again. This node is the off-site backup you didn't know you wanted: a private repo on Hugging Face is the cheapest cloud storage available, and there's no key to manage beyond a HF token.

    How it works

    It's a thin wrapper around huggingface_hub, the official Python library - no custom file-transfer code, which is a good thing. Run it and it: checks you have a token, creates the repo if it doesn't exist, walks models/ to count files and total size, then calls upload_large_folder with parallel workers (default 4, up to 16). Everything starting with a . is ignored in both directions, so hidden files never make the trip. It's an OUTPUT_NODE, so the result text (SUCCESS: Uploaded N files (X GB) to <repo>) shows up right on the node and in the console.

    The one trap baked into the design: this uploads everything. There's no folder filter, no "only checkpoints" toggle. Your full model library ships to HF, including any models you only have permission to use locally. Keep the repo private (that's the default) and check your licenses before you go public.

    The inputs that matter

    • repo_id - where the backup goes, like yourname/comfyui-models-backup. Change the username/ placeholder or it errors.
    • private_repo - defaults to True. Leave it that way.
    • num_workers - parallel upload threads. Bump to 8–16 on a fast connection; drop to 1 if your provider throttles.
    • remove_difference - defaults to False, and keep it off the first time. When on, it deletes remote files that don't exist locally, making HF mirror your local folder exactly. That means it can wipe things from the repo you uploaded from another machine.

    The token is optional as an input because it falls back to the HF_TOKEN or HUGGING_FACE_HUB_TOKEN environment variables. One honest gotcha: skip_existing is declared on the node but never actually wired into the upload call in this version. It's a no-op. Don't rely on it to skip what you already pushed - treat a rerun as an upload-everything.

    Installing it

    ComfyUI Manager → search ComfyUI-Backup, install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/romandev-codex/ComfyUI-Backup
    

    The only dependency is huggingface_hub>=0.20.0, which ComfyUI's own venv almost certainly already has - so don't be surprised when there's nothing to install. Make a token at hf.co/settings/tokens (write access), then either paste it into the node or set HF_TOKEN in your environment.

    Common issues

    The ERROR: Please provide token or set HF_TOKEN message is the one you'll actually see - the node won't do anything without a token. Everything else is physics: a multi-hundred-GB upload takes hours, so expect the queue to sit there, and free Hugging Face accounts have storage caps, so check your plan against your models folder before committing to "backup everything." If the first run fails mid-way, rerunning resumes in the sense that upload_large_folder re-checks the repo - but again, don't count on skip_existing to do it for you.

    It's a young pack - one commit, no real README, not a big community behind it. Treat it as a utility you verify once with a small run before you trust your whole library to it.

    Categorybackup

    Inputs (6)

    NameTypeDefaultDescription
    repo_idSTRINGusername/comfyui-models-backup
    private_repoBOOLEANtrue
    skip_existingBOOLEANtrue
    remove_differenceBOOLEANfalse
    num_workersINT41–16
    tokenoptSTRING

    Outputs (1)

    NameTypeDescription
    statusSTRING