@@ -82,10 +82,10 @@ select_gpu() {
8282 done
8383}
8484
85- # Checks HF_TOKEN and huggingface-cli login status and throw warning if not authenticated.
85+ # Check HF_TOKEN and Hugging Face CLI login status, throw warning if not authenticated.
8686check_hf_auth () {
87- if [ -z " $HF_TOKEN " ] && [ " $( huggingface-cli whoami) " = " Not logged in" ]; then
88- printf " WARN: Not logged in and HF_TOKEN not set. Log in with 'huggingface-cli login' or set HF_TOKEN to download token-gated models.\n"
87+ if [ -z " $HF_TOKEN " ] && [ " $( hf auth whoami) " = " Not logged in" ]; then
88+ printf " WARN: Not logged in and HF_TOKEN not set. Log in with 'hf auth login' or set HF_TOKEN to download token-gated models.\n"
8989 exit 1
9090 fi
9191}
@@ -118,27 +118,27 @@ function download_beta_models() {
118118 printf " \nDownloading unrestricted models...\n"
119119
120120 # Download text-to-image and image-to-image models.
121- huggingface-cli download SG161222/RealVisXL_V4.0_Lightning --include " *.fp16.safetensors" " *.json" " *.txt" --exclude " .onnx" " .onnx_data" --cache-dir models
122- huggingface-cli download ByteDance/SDXL-Lightning --include " *unet.safetensors" --cache-dir models
123- huggingface-cli download timbrooks/instruct-pix2pix --include " *.fp16.safetensors" " *.json" " *.txt" --cache-dir models
121+ hf download SG161222/RealVisXL_V4.0_Lightning --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
122+ hf download ByteDance/SDXL-Lightning --include " *unet.safetensors" --cache-dir models
123+ hf download timbrooks/instruct-pix2pix --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --cache-dir models
124124
125125 # Download upscale models
126- huggingface-cli download stabilityai/stable-diffusion-x4-upscaler --include " *.fp16.safetensors" --cache-dir models
126+ hf download stabilityai/stable-diffusion-x4-upscaler --include " *.fp16.safetensors" --cache-dir models
127127
128128 # Download audio-to-text models.
129- huggingface-cli download openai/whisper-large-v3 --include " *.safetensors" " *.json" --cache-dir models
130- huggingface-cli download distil-whisper/distil-large-v3 --include " *.safetensors" " *.json" --cache-dir models
131- huggingface-cli download openai/whisper-medium --include " *.safetensors" " *.json" --cache-dir models
129+ hf download openai/whisper-large-v3 --include " *.safetensors" --include " *.json" --cache-dir models
130+ hf download distil-whisper/distil-large-v3 --include " *.safetensors" --include " *.json" --cache-dir models
131+ hf download openai/whisper-medium --include " *.safetensors" --include " *.json" --cache-dir models
132132
133133 # Download custom pipeline models.
134- huggingface-cli download facebook/sam2-hiera-large --include " *.pt" " *.yaml" --cache-dir models
135- huggingface-cli download parler-tts/parler-tts-large-v1 --include " *.safetensors" " *.json" " *.model" --cache-dir models
134+ hf download facebook/sam2-hiera-large --include " *.pt" --include " *.yaml" --cache-dir models
135+ hf download parler-tts/parler-tts-large-v1 --include " *.safetensors" --include " *.json" --include " *.model" --cache-dir models
136136
137137 printf " \nDownloading token-gated models...\n"
138138
139139 # Download image-to-video models (token-gated).
140140 check_hf_auth
141- huggingface-cli download stabilityai/stable-video-diffusion-img2vid-xt-1-1 --include " *.fp16.safetensors" " *.json" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
141+ hf download stabilityai/stable-video-diffusion-img2vid-xt-1-1 --include " *.fp16.safetensors" --include " *.json" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
142142}
143143
144144# Download all models.
@@ -149,26 +149,26 @@ function download_all_models() {
149149
150150 # Download text-to-image and image-to-image models.
151151 printf " \nDownloading unrestricted models...\n"
152- huggingface-cli download stabilityai/sd-turbo --include " *.fp16.safetensors" " *.json" " *.txt" --exclude " .onnx" " .onnx_data" --cache-dir models
153- huggingface-cli download stabilityai/sdxl-turbo --include " *.fp16.safetensors" " *.json" " *.txt" --exclude " .onnx" " .onnx_data" --cache-dir models
154- huggingface-cli download runwayml/stable-diffusion-v1-5 --include " *.fp16.safetensors" " *.json" " *.txt" --exclude " .onnx" " .onnx_data" --cache-dir models
155- huggingface-cli download stabilityai/stable-diffusion-xl-base-1.0 --include " *.fp16.safetensors" " *.json" " *.txt" --exclude " .onnx" " .onnx_data" --cache-dir models
156- huggingface-cli download prompthero/openjourney-v4 --include " *.safetensors" " *.json" " *.txt" --exclude " .onnx" " .onnx_data" --cache-dir models
157- huggingface-cli download SG161222/RealVisXL_V4.0 --include " *.fp16.safetensors" " *.json" " *.txt" --exclude " .onnx" " .onnx_data" --cache-dir models
158- huggingface-cli download stabilityai/stable-diffusion-3-medium-diffusers --include " *.fp16*.safetensors" " *.model" " *.json" " *.txt" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
159- huggingface-cli download stabilityai/stable-diffusion-3.5-medium --include " transformer/*.safetensors" " *model.fp16*" " *.model" " *.json" " *.txt" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
160- huggingface-cli download stabilityai/stable-diffusion-3.5-large --include " transformer/*.safetensors" " *model.fp16*" " *.model" " *.json" " *.txt" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
161- huggingface-cli download SG161222/Realistic_Vision_V6.0_B1_noVAE --include " *.fp16.safetensors" " *.json" " *.txt" " *.bin" --exclude " .onnx" " .onnx_data" --cache-dir models
162- huggingface-cli download black-forest-labs/FLUX.1-schnell --include " *.safetensors" " *.json" " *.txt" " *.model" --exclude " .onnx" " .onnx_data" --cache-dir models
152+ hf download stabilityai/sd-turbo --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
153+ hf download stabilityai/sdxl-turbo --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
154+ hf download runwayml/stable-diffusion-v1-5 --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
155+ hf download stabilityai/stable-diffusion-xl-base-1.0 --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
156+ hf download prompthero/openjourney-v4 --include " *.safetensors" --include " *.json" --include " *.txt" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
157+ hf download SG161222/RealVisXL_V4.0 --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
158+ hf download stabilityai/stable-diffusion-3-medium-diffusers --include " *.fp16*.safetensors" --include " *.model" --include " *.json" --include " *.txt" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
159+ hf download stabilityai/stable-diffusion-3.5-medium --include " transformer/*.safetensors" --include " *model.fp16*" --include " *.model" --include " *.json" --include " *.txt" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
160+ hf download stabilityai/stable-diffusion-3.5-large --include " transformer/*.safetensors" --include " *model.fp16*" --include " *.model" --include " *.json" --include " *.txt" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
161+ hf download SG161222/Realistic_Vision_V6.0_B1_noVAE --include " *.fp16.safetensors" --include " *.json" --include " *.txt" --include " *.bin" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
162+ hf download black-forest-labs/FLUX.1-schnell --include " *.safetensors" --include " *.json" --include " *.txt" --include " *.model" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models
163163
164164 # Download image-to-video models.
165- huggingface-cli download stabilityai/stable-video-diffusion-img2vid-xt --include " *.fp16.safetensors" " *.json" --cache-dir models
165+ hf download stabilityai/stable-video-diffusion-img2vid-xt --include " *.fp16.safetensors" --include " *.json" --cache-dir models
166166
167167 # Download image-to-text models.
168- huggingface-cli download Salesforce/blip-image-captioning-large --include " *.safetensors" " *.json" --cache-dir models
168+ hf download Salesforce/blip-image-captioning-large --include " *.safetensors" --include " *.json" --cache-dir models
169169
170170 # Custom pipeline models.
171- huggingface-cli download facebook/sam2-hiera-large --include " *.pt" " *.yaml" --cache-dir models
171+ hf download facebook/sam2-hiera-large --include " *.pt" --include " *.yaml" --cache-dir models
172172
173173 download_live_models
174174}
@@ -386,23 +386,23 @@ function download_restricted_models() {
386386 printf " \nDownloading restricted models...\n"
387387
388388 # Download text-to-image and image-to-image models.
389- huggingface-cli download black-forest-labs/FLUX.1-dev --include " *.safetensors" " *.json" " *.txt" " *.model" --exclude " .onnx" " .onnx_data" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
389+ hf download black-forest-labs/FLUX.1-dev --include " *.safetensors" --include " *.json" --include " *.txt" --include " *.model" --exclude " .onnx" --exclude " .onnx_data" --cache-dir models ${TOKEN_FLAG: +" $TOKEN_FLAG " }
390390 # Download LLM models (Warning: large model size)
391- huggingface-cli download meta-llama/Meta-Llama-3.1-8B-Instruct --include " *.json" " *.bin" " *.safetensors" " *.txt" --cache-dir models
391+ hf download meta-llama/Meta-Llama-3.1-8B-Instruct --include " *.json" --include " *.bin" --include " *.safetensors" --include " *.txt" --cache-dir models
392392
393393}
394394
395395function download_batch_models() {
396396 printf " \nDownloading Batch models...\n"
397397
398- huggingface-cli download facebook/sam2-hiera-large --include " *.pt" " *.yaml" --cache-dir models
398+ hf download facebook/sam2-hiera-large --include " *.pt" --include " *.yaml" --cache-dir models
399399}
400400
401- # Enable HF transfer acceleration .
402- # See: https://huggingface.co/docs/huggingface_hub/v0.22.1/ package_reference/environment_variables#hfhubenablehftransfer.
403- export HF_HUB_ENABLE_HF_TRANSFER =1
401+ # Enable XET High Performance .
402+ # See: https://huggingface.co/docs/huggingface_hub/main/en/ package_reference/environment_variables#hfxethighperformance
403+ export HF_XET_HIGH_PERFORMANCE =1
404404
405- # Use HF_TOKEN if set, otherwise use huggingface-cli 's login.
405+ # Use HF_TOKEN if set, otherwise use Hugging Face CLI 's login.
406406[ -n " $HF_TOKEN " ] && TOKEN_FLAG=" --token=${HF_TOKEN} " || TOKEN_FLAG=" "
407407
408408# Parse command-line arguments.
@@ -447,10 +447,9 @@ echo "Starting livepeer AI subnet model downloader..."
447447echo " Creating 'models' directory in the current working directory..."
448448mkdir -p models/checkpoints models/StreamDiffusion--engines models/insightface models/StreamDiffusion--models models/ComfyUI--{models,output}
449449
450- # Ensure 'huggingface-cli' is installed.
451- echo " Checking if 'huggingface-cli' is installed..."
452- if ! command -v huggingface-cli > /dev/null 2>&1 ; then
453- echo " WARN: The huggingface-cli is required to download models. Please install it using 'pip install huggingface_hub[cli,hf_transfer]'."
450+ echo " Checking if 'hf' Hugging Face CLI is installed..."
451+ if ! command -v hf > /dev/null 2>&1 ; then
452+ echo " ERROR: The Hugging Face CLI is required to download models. Please install it using 'pip install huggingface_hub'."
454453 exit 1
455454fi
456455
0 commit comments