nathanglm commited on
Commit
70b889c
·
verified ·
1 Parent(s): 8029538

Update vast.ai.sh

Browse files
Files changed (1) hide show
  1. vast.ai.sh +73 -35
vast.ai.sh CHANGED
@@ -64,33 +64,34 @@ UNET_MODELS=(
64
  "https://huggingface.co/jayn7/Z-Image-Turbo-GGUF/resolve/main/z_image_turbo-Q8_0.gguf"
65
  )
66
 
 
67
  LORA_MODELS=(
68
- "https://huggingface.co/nathanglm/sofia/resolve/main/Sofia.safetensors" # ZIT-Sofia
69
- "https://huggingface.co/Finesse365/Anya-Lora/resolve/main/ZIT-Anya.safetensors" # ZIT-Anya
70
- "https://civitai.com/api/download/models/2483794?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Asian-To-Caucasian
71
- "https://civitai.com/api/download/models/2534692?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Hands-XL-v2.1
72
- "https://civitai.com/api/download/models/2536073?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Feet-XL-v2.1
73
- "https://civitai.com/api/download/models/2581135?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Mystic
74
- "https://civitai.com/api/download/models/2452071?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Lenovo
75
- "https://civitai.com/api/download/models/2617751?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Realistic-Snapshot-v5
76
- "https://civitai.com/api/download/models/2513043?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Hip-Slider
77
- "https://civitai.com/api/download/models/2510875?type=Model&format=SafeTensor&size=full&fp=fp16" # ZIT-Breast-Slider
78
- "https://civitai.com/api/download/models/550216?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Lady-Hands
79
- "https://civitai.com/api/download/models/139194?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Real-Feet
80
- "https://civitai.com/api/download/models/368603?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Detailed-Nipples
81
- "https://civitai.com/api/download/models/1604857?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Real-Pussy-Peach
82
- "https://civitai.com/api/download/models/1511445?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Real-Pussy-Spreading
83
- "https://civitai.com/api/download/models/1284103?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Real-Pussy-Butterfly
84
- "https://civitai.com/api/download/models/802232?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Real-Pussy-Cameltoe
85
- "https://civitai.com/api/download/models/712004?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Real-Pussy-Lotte
86
- "https://civitai.com/api/download/models/262705?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Real-Humans
87
- "https://civitai.com/api/download/models/216946?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Penis-XL-v1
88
- "https://civitai.com/api/download/models/707763?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Realistic-Skin-Texutre-v4
89
- "https://civitai.com/api/download/models/341068?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-NSFW-XL-v2.1
90
- "https://civitai.com/api/download/models/1506027?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Add-Detail-Slider-v1.2
91
- "https://civitai.com/api/download/models/1934796?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-touch-of-Realism-v2
92
- "https://civitai.com/api/download/models/535064?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Breast-Size-Slider-v1
93
- "https://civitai.com/api/download/models/1242203?type=Model&format=SafeTensor&size=full&fp=fp16" # SDXL-Dramatic-Lighting-Slider-v1
94
  )
95
 
96
  VAE_MODELS=(
@@ -194,9 +195,17 @@ function provisioning_get_files() {
194
  shift
195
  arr=("$@")
196
  printf "Downloading %s model(s) to %s...\n" "${#arr[@]}" "$dir"
197
- for url in "${arr[@]}"; do
 
 
 
 
 
 
 
 
198
  printf "Downloading: %s\n" "${url}"
199
- provisioning_download "${url}" "${dir}"
200
  printf "\n"
201
  done
202
  }
@@ -245,6 +254,7 @@ function provisioning_has_valid_civitai_token() {
245
  function download_civitai_bash() {
246
  local url="$1"
247
  local output_dir="$2"
 
248
  local model_id=""
249
 
250
  # Extract model ID from URL
@@ -256,6 +266,28 @@ function download_civitai_bash() {
256
  fi
257
 
258
  printf "Downloading CivitAI model %s...\n" "$model_id"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
 
260
  # Get redirect location with curl
261
  local redirect_url=""
@@ -325,16 +357,22 @@ function download_civitai_bash() {
325
  fi
326
  }
327
 
328
- # Download from $1 URL to $2 file path
329
  function provisioning_download() {
 
 
 
 
330
  # Check if it's a CivitAI URL
331
- if [[ $1 =~ ^https://civitai\.com/api/download/models/([0-9]+) ]]; then
332
- download_civitai_bash "$1" "$2"
333
- # HuggingFace URLs
334
- elif [[ $1 =~ ^https://([a-zA-Z0-9_-]+\.)?huggingface\.co(/|$|\?) ]]; then
335
- wget -qnc --content-disposition --show-progress -e dotbytes="${3:-4M}" -P "$2" "$1"
336
  else
337
- wget -qnc --content-disposition --show-progress -e dotbytes="${3:-4M}" -P "$2" "$1"
 
 
 
 
338
  fi
339
  }
340
 
 
64
  "https://huggingface.co/jayn7/Z-Image-Turbo-GGUF/resolve/main/z_image_turbo-Q8_0.gguf"
65
  )
66
 
67
+ # Format: "URL|filename.safetensors"
68
  LORA_MODELS=(
69
+ "https://huggingface.co/nathanglm/sofia/resolve/main/Sofia.safetensors|ZIT-Sofia.safetensors"
70
+ "https://huggingface.co/Finesse365/Anya-Lora/resolve/main/ZIT-Anya.safetensors|ZIT-Anya.safetensors"
71
+ "https://civitai.com/api/download/models/2483794?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Asian-To-Caucasian.safetensors"
72
+ "https://civitai.com/api/download/models/2534692?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Hands-XL-v2.1.safetensors"
73
+ "https://civitai.com/api/download/models/2536073?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Feet-XL-v2.1.safetensors"
74
+ "https://civitai.com/api/download/models/2581135?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Mystic-v5.safetensors"
75
+ "https://civitai.com/api/download/models/2452071?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Lenovo-v1.safetensors"
76
+ "https://civitai.com/api/download/models/2617751?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Realistic-Snapshot-v5.safetensors"
77
+ "https://civitai.com/api/download/models/2513043?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Hip-Slider-v1.safetensors"
78
+ "https://civitai.com/api/download/models/2510875?type=Model&format=SafeTensor&size=full&fp=fp16|ZIT-Breast-Slider-v1.safetensors"
79
+ "https://civitai.com/api/download/models/550216?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Lady-Hands-v1.safetensors"
80
+ "https://civitai.com/api/download/models/139194?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Real-Feet-v1.safetensors"
81
+ "https://civitai.com/api/download/models/368603?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Detailed-Nipples-v1.safetensors"
82
+ "https://civitai.com/api/download/models/1604857?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Real-Pussy-Peach.safetensors"
83
+ "https://civitai.com/api/download/models/1511445?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Real-Pussy-Spreading.safetensors"
84
+ "https://civitai.com/api/download/models/1284103?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Real-Pussy-Butterfly.safetensors"
85
+ "https://civitai.com/api/download/models/802232?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Real-Pussy-Cameltoe.safetensors"
86
+ "https://civitai.com/api/download/models/712004?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Real-Pussy-Lotte.safetensors"
87
+ "https://civitai.com/api/download/models/262705?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Real-Humans-v1.safetensors"
88
+ "https://civitai.com/api/download/models/216946?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Penis-XL-v1.safetensors"
89
+ "https://civitai.com/api/download/models/707763?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Realistic-Skin-Texture-v4.safetensors"
90
+ "https://civitai.com/api/download/models/341068?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-NSFW-XL-v2.1.safetensors"
91
+ "https://civitai.com/api/download/models/1506027?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Add-Detail-Slider-v1.2.safetensors"
92
+ "https://civitai.com/api/download/models/1934796?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-touch-of-Realism-v2.safetensors"
93
+ "https://civitai.com/api/download/models/535064?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Breast-Size-Slider-v1.safetensors"
94
+ "https://civitai.com/api/download/models/1242203?type=Model&format=SafeTensor&size=full&fp=fp16|SDXL-Dramatic-Lighting-Slider-v1.safetensors"
95
  )
96
 
97
  VAE_MODELS=(
 
195
  shift
196
  arr=("$@")
197
  printf "Downloading %s model(s) to %s...\n" "${#arr[@]}" "$dir"
198
+ for entry in "${arr[@]}"; do
199
+ # Support "URL|filename" format for custom filenames
200
+ if [[ "$entry" == *"|"* ]]; then
201
+ url="${entry%%|*}"
202
+ filename="${entry##*|}"
203
+ else
204
+ url="$entry"
205
+ filename=""
206
+ fi
207
  printf "Downloading: %s\n" "${url}"
208
+ provisioning_download "${url}" "${dir}" "${filename}"
209
  printf "\n"
210
  done
211
  }
 
254
  function download_civitai_bash() {
255
  local url="$1"
256
  local output_dir="$2"
257
+ local forced_filename="$3"
258
  local model_id=""
259
 
260
  # Extract model ID from URL
 
266
  fi
267
 
268
  printf "Downloading CivitAI model %s...\n" "$model_id"
269
+
270
+ # If a forced filename was provided, use it directly
271
+ if [[ -n "$forced_filename" ]]; then
272
+ local output_file="${output_dir}/${forced_filename}"
273
+ if [[ -f "$output_file" ]]; then
274
+ printf "File already exists: %s\n" "$forced_filename"
275
+ return 0
276
+ fi
277
+ printf "Downloading to: %s\n" "$forced_filename"
278
+ if [[ -n "$CIVITAI_TOKEN" ]]; then
279
+ curl -L -o "$output_file" --progress-bar -H "Authorization: Bearer $CIVITAI_TOKEN" "$url"
280
+ else
281
+ curl -L -o "$output_file" --progress-bar "$url"
282
+ fi
283
+ if [[ $? -eq 0 ]]; then
284
+ printf "Download completed: %s\n" "$forced_filename"
285
+ return 0
286
+ else
287
+ printf "ERROR: Download failed for model %s\n" "$model_id"
288
+ return 1
289
+ fi
290
+ fi
291
 
292
  # Get redirect location with curl
293
  local redirect_url=""
 
357
  fi
358
  }
359
 
360
+ # Download from $1 URL to $2 file path, with optional $3 forced filename
361
  function provisioning_download() {
362
+ local url="$1"
363
+ local dir="$2"
364
+ local forced_filename="$3"
365
+
366
  # Check if it's a CivitAI URL
367
+ if [[ $url =~ ^https://civitai\.com/api/download/models/([0-9]+) ]]; then
368
+ download_civitai_bash "$url" "$dir" "$forced_filename"
369
+ # HuggingFace or other URLs
 
 
370
  else
371
+ if [[ -n "$forced_filename" ]]; then
372
+ wget -qnc --show-progress -e dotbytes="${4:-4M}" -O "${dir}/${forced_filename}" "$url"
373
+ else
374
+ wget -qnc --content-disposition --show-progress -e dotbytes="${4:-4M}" -P "$dir" "$url"
375
+ fi
376
  fi
377
  }
378