download/load the HF dataset
Pull any Hugging Face dataset into your workflow without leaving the graph
- local_dir
download_dataset is the first step in the LLM School pack's training pipeline: it grabs a dataset from Hugging Face and saves it to disk, so the next node (split_dataset) can work with local files instead of re-fetching over the network. It's a thin wrapper around huggingface_hub.snapshot_download() with repo_type="dataset", marked as an output node so it sits at the end of a data-preprocessing chain and visibly reports its result.
You feed it a repo_id - the owner/name handle of any public dataset on the Hub - and it downloads the whole thing into a cache folder inside the pack (<pack>/datasets, or wherever you point cache_dir). The output is a single string: the absolute local path to the downloaded files. That's the local_dir you'll paste into split_dataset.
The inputs that matter
repo_id- defaultrajpurkar/squad_v2. This is the dataset the pack's trainer was written against (SQuAD-style question/context/answers), so it's the safe starting point. Swap in anything you found withget_dataset_name.cache_dir- defaultdatasets, resolved relative to the pack folder. Relative paths can surprise you; if you want the data somewhere predictable, give an absolute path.token- the trap. The default is the literal stringhf_XXX. Leave it there and the code passeshf_XXXas your auth token, which fails with a 401 on anything that actually requires auth. Set it to a real token from https://huggingface.co/settings/tokens, or set it to an empty string so it falls back to theHF_tokenvalue in the pack'sconfig.ini. Public datasets likesquad_v2don't need a token at all.force_download- defaults to True, which means it re-downloads everything on every run. Turn it off once you've got a copy locally; it's the default that'll waste your bandwidth for no reason.
How to install
ComfyUI Manager, search "comfyui_LLM_schools" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/heshengtao/comfyui_LLM_schools
then restart ComfyUI. requirements.txt is light - huggingface_hub, datasets, transformers, peft - and Manager installs it for you.
Common issues
- The node doesn't appear at all. The pack reads
config.iniat import time, and if that file doesn't exist the wholedataset.pymodule fails to load (the pack's__init__.pyswallows the error). The repo shipsconfig.ini.example; copy it toconfig.iniinside the pack folder before you restart, then put a real token (or#zh_CN/en_USfor the language) in it. - "The default token isn't accepted." See above -
hf_XXXis a placeholder, not a valid token. Empty the field for public datasets. - Deprecation warnings or an error about
local_dir_use_symlinks. The code passes that argument tosnapshot_download, and newerhuggingface_hubversions deprecated/removed it. Usually just a warning; if it hard-fails, updatehuggingface_hubto a current version where the parameter is tolerated or ignored.
It's a simple, opinionated node - the opinion being "download SQuAD-style QA datasets and fine-tune causal LMs on them." If that's your plan, this is the cleanest way to get data onto disk from inside ComfyUI.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| repo_id | STRING | rajpurkar/squad_v2 | — |
| cache_dir | STRING | datasets | — |
| token | STRING | hf_XXX | — |
| force_download | BOOLEAN | true | — |
| is_enable | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| local_dir | STRING | — |