https://github.com/LetheSec/HuggingFace-Download-Accelerator

We need to download this script file to our local machine. As shown in the figure below:

python hf_download.py
, as shown in the figure below:
After execution, it will automatically download and install the dependencies required by this tool. I have already installed them, so it finished quickly.
Using the download tool
For example, I need to download the model required by the BiRefNet plugin, as shown in the figure below:

Then we can execute the command: python hf_download.py --model=ViperYX/BiRefNet
The default download path is: C:\Users\Administrator\.cache\huggingface\hub\models--ViperYX--BiRefNet
For friends using ComfyUI, we need to download the model files into the comfyui/models folder, so we need to specify the download path.

We place the hf_download.py
script file in the models folder, then open cmd in the current directory:

Then execute: python hf_download.py --model=ViperYX/BiRefNet --save_dir ./
Where ./
means the current directory, which is to download the files to the current directory, and the current directory is comfyui/models.

You can see that the file has started downloading!

You can see that the file has been downloaded to the models folder.
Solving download access restriction issues
Let’s take the download of black-forest-labs/FLUX.1-dev as an example:
python hf_download.py --model=black-forest-labs/FLUX.1-dev --save_dir ./
After execution, you will find an error: Access to model black-forest-labs/FLUX.1-dev is restricted. You must have access to it and be authenticated to access it. Please log in.
This means that authorization is required to download. By adding the –token parameter after the command, this can be resolved. Where does the token come from?



Enter the name and check the permissions, then click the bottom Create token, and a pop-up box will appear as shown:

We copy this token, and then paste it after –token to download:
python hf_download.py --model=black-forest-labs/FLUX.1-dev --save_dir ./ --token=
hf_tSLgRjelwSoQPJJIJtmJKFWDQLdYqZKbe0