Nodes/ComfyUI-Backup/HF Restore Models
ComfyUI Node

HF Restore Models

The day your disk dies, this node is your parachute

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

    HF Restore Models (class HuggingFaceRestore) is the "after" half of the ComfyUI-Backup pair. Where HuggingFaceBackup pushes your whole models folder to Hugging Face, this node pulls it back down: point it at the repo, run it, and every checkpoint, LoRA, VAE and embedding you backed up gets written straight back into your models directory. It's the node you reach for on a fresh install, after a drive wipe, or when you moved machines and don't want to spend a day hunting down re-download links.

    This is worth more than it sounds. The community's usual advice for moving ComfyUI is to copy your custom_nodes folder and freeze your requirements - good for the install, useless for the 150 GB of models, which are the expensive part to reproduce. Off-site backup to a private Hugging Face repo is the one answer that survives a dead SSD, and restore is where that pays off.

    How it works

    Under the hood it's snapshot_download from huggingface_hub, pointed at your models directory with parallel downloads (max_workers, default 4, up to 16). Same rules as the backup in reverse: hidden files (anything starting with .) are ignored, and the whole repo lands in models/ preserving the folder structure, so checkpoints/, loras/ and friends reappear where ComfyUI expects them. It counts what it downloaded and reports SUCCESS: Downloaded N files (X GB) from <repo> on the output node and in the console.

    Two things to know before you run it on a machine that already has models:

    • It merges into whatever's already in models/ - files that exist locally get overwritten, files you never had get added. If your local folder is a mess, restore won't clean it.
    • remove_difference flips that into a sync. When enabled, restore walks your entire models directory and deletes every local file that isn't in the remote repo. Read that again, because it's the dangerous one: any model you downloaded after your last backup will be deleted, not kept. It's genuinely useful for making a restore machine identical to the backup, and genuinely destructive if you run it by accident. Keep it off until you're sure.

    The inputs that matter

    • repo_id - the yourname/comfyui-models-backup you backed up to.
    • num_workers - download parallelism; 4 is fine, 8 helps on a fast connection.
    • remove_difference - see above. Off by default. Be very deliberate about turning it on.
    • skip_existing - declared on the node, but look at the source and you'll find it's only printed to the log, never passed to the download call. A no-op in this version. Don't trust it to protect your local files; snapshot's overwrite behavior is what actually governs.
    • token - optional, like everywhere in this pack: falls back to HF_TOKEN / HUGGING_FACE_HUB_TOKEN, and errors out hard if neither exists. For a private repo (which your backup should be) the token is mandatory anyway.

    Installing it

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

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

    Dependency is just huggingface_hub>=0.20.0, already in ComfyUI's venv. No model files, no heavy deps - this pack has nothing to download, which is the point.

    Common issues

    Missing token is the standard error - set HF_TOKEN and move on. Beyond that, the failure modes are about what you restore: this node assumes the repo is a faithful model backup, so a repo that also holds loose junk will dump that junk into models/, and a remove_difference run on the wrong repo will happily delete local files to match it. Verify the repo with HuggingFaceListModels first. And expect long waits - restoring hundreds of GB over a home connection is a "start it and go to bed" job, not a "run and watch" one. The pack is young and unmaintained-looking (single commit, no README to speak of), so test the whole backup→list→restore loop once on a small repo before you trust your full library to it.

    Categorybackup

    Inputs (5)

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

    Outputs (1)

    NameTypeDescription
    statusSTRING