newturok commited on
Commit
a30330c
·
verified ·
1 Parent(s): ec497e7

Update download_models.sh

Browse files
Files changed (1) hide show
  1. download_models.sh +17 -32
download_models.sh CHANGED
@@ -1,39 +1,24 @@
1
  #!/bin/bash
2
 
3
- # Function to download a file if it doesn't exist
4
- download_file() {
5
- local url=$1
6
- local target_dir=$2
7
- local target_file=$3
8
 
9
- if [ ! -f "${target_file}" ]; then
10
- echo "Downloading ${target_file}..."
11
- mkdir -p "${target_dir}"
12
- wget -O "${target_file}" "${url}" --progress=bar:force:noscroll
13
- else
14
- echo "${target_file} already exists, skipping download."
15
- fi
16
- }
17
 
 
 
 
 
18
 
19
- # VAE model
20
- download_file "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.sft?download=true" \
21
- "/ComfyUI/models/vae" \
22
- "/ComfyUI/models/vae/ae.sft"
23
 
24
- # Diffusion model
25
- download_file "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.sft?download=true" \
26
- "/ComfyUI/models/diffusion_models" \
27
- "/ComfyUI/models/diffusion_models/flux1-dev.sft"
28
 
29
- # CLIP models
30
- download_file "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors?download=true" \
31
- "/ComfyUI/models/clip" \
32
- "/ComfyUI/models/clip/clip_l.safetensors"
33
-
34
- download_file "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors?download=true" \
35
- "/ComfyUI/models/clip" \
36
- "/ComfyUI/models/clip/t5xxl_fp8_e4m3fn.safetensors"
37
-
38
-
39
- echo "All required files have been checked/Downloaded!"
 
1
  #!/bin/bash
2
 
3
+ # Configure these variables
4
+ COMFYUI_DIR="/workspace/ComfyUI"
 
 
 
5
 
6
+ # Create required directories
7
+ mkdir -p ${COMFYUI_DIR}/models/{diffusion_models,vae,clip}
 
 
 
 
 
 
8
 
9
+ # Download models only if they don't exist
10
+ wget -nc -P ${COMFYUI_DIR}/models/diffusion_models \
11
+ --header="Authorization: Bearer ${HF_TOKEN}" \
12
+ "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors"
13
 
14
+ wget -nc -P ${COMFYUI_DIR}/models/vae \
15
+ --header="Authorization: Bearer ${HF_TOKEN}" \
16
+ "https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors"
 
17
 
18
+ wget -nc -P ${COMFYUI_DIR}/models/clip \
19
+ --header="Authorization: Bearer ${HF_TOKEN}" \
20
+ "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors"
 
21
 
22
+ wget -nc -P ${COMFYUI_DIR}/models/clip \
23
+ --header="Authorization: Bearer ${HF_TOKEN}" \
24
+ "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors"