HuggingFace Directory Downloader
The HuggingFace Directory Downloader
- status
- download_path
Say you want a model that isn't a single file - a Qwen LLM, or a full SDXL repo with its unet, text_encoder, and scheduler subfolders. The usual route is opening the HuggingFace page, hunting the resolve URL, and reconstructing the folder layout by hand so your loader can find things. HuggingFace Directory Downloader is the shortcut: give it the model ID and one folder name, and it pulls the entire repository into your models directory with the structure intact. It's from the same pack as Model Downloader from INI and the URL-based Model Downloader, and it's the most "just type the thing you know" of the three.
How it works
You feed it user/repo style IDs - Qwen/Qwen2-VL-7B-Instruct, stabilityai/stable-diffusion-xl-base-1.0 - and it queries the HuggingFace API's tree endpoint to list every file in the repo, recursing into subdirectories. Then it streams each file down to models/<save_folder>/<repo_name>/, preserving the full path (so tokenizer/tokenizer.json lands where tokenizer/tokenizer.json belongs). If a file already exists, it's skipped rather than re-fetched. If you've set a token in the pack's config.ini, it's attached as a Bearer header automatically, which is what lets you into gated and private repos.
The inputs that matter
- model_id - the only truly required field, and it's just the ID:
username/repository. Case-sensitive, so copy it exactly from the HuggingFace page. - save_folder - where under
modelsit goes. Default isLLM, and the repo name is always appended, sosave_folder: checkpointswithstabilityai/stable-diffusion-xl-base-1.0lands inmodels/checkpoints/stable-diffusion-xl-base-1.0/. - exclude_files - comma-separated filenames to skip; defaults to
README.md, .gitattributes, which is the right call. - revision - branch or tag, default
main. Set this to grab a specific release instead of the bleeding edge. - max_retries - default 3, up to 10, for flaky connections.
Outputs are two strings: status with the summary and download_path with the full path it wrote to - wire that into whatever node needs to load the result, or just read it in the node.
Install
ComfyUI Manager (search "ComfyUI Model_Downloader") or:
cd ComfyUI/custom_nodes
git clone https://github.com/tori29umai0123/ComfyUI-Model_Downloader
then restart. There's no requirements.txt - the only dependency is requests, which ComfyUI already ships. For gated models, copy config.ini.example to config.ini and paste a HuggingFace token from huggingface.co/settings/tokens (read access to gated repos you can access).
Where people get burned
Biggest trap: this node downloads repositories, not whatever your loader actually wants. For an LLM in ComfyUI, most people end up using GGUF files in a specific folder, not the raw safetensors repo - so think about what your next node expects before you point this at a 30 GB download. Second: there's no progress bar in the UI. The per-file progress prints to the console, and a big repo can take a long while, so don't assume it froze. Third, gated models fail with a 403 until you both accept the terms on the model page and have a token in config.ini - the token alone isn't enough. And because existing files are skipped, "re-download" requires deleting the file first.
It's the node to reach for when you know the model ID, want everything, and would rather not spelunk the web UI. For single files or CivitAI links, the sibling Model Downloader node is the better tool.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model_id | STRING | — | |
| save_folder | STRING | LLM | — |
| exclude_filesopt | STRING | README.md, .gitattributes | — |
| revisionopt | STRING | main | — |
| max_retriesopt | INT | 31–10 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |
| download_path | STRING | — |