iamgroot1212 commited on
Commit
fd45539
·
verified ·
1 Parent(s): 3459db0

Upload download_models.sh

Browse files
Files changed (1) hide show
  1. scripts/download_models.sh +83 -0
scripts/download_models.sh ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # ================= CONFIGURATION =================
4
+ # Replace with your actual Hugging Face Token
5
+ HF_TOKEN="hf_YOUR_ACTUAL_TOKEN_HERE"
6
+
7
+ BASE_DIR="/workspace/runpod-slim/ComfyUI"
8
+ REPO_ID="iamgroot1212/comfyui-setup"
9
+ MINIMAX_ID="Comfy-Org/MiniMax-H3"
10
+ MINIMAX_LORA_ID="larryvrh/MiniMax-H3-Turbo-Lora"
11
+
12
+ # ComfyUI Target Folders
13
+ DIFFUSION_DIR="$BASE_DIR/models/diffusion_models"
14
+ CHECKPOINT_DIR="$BASE_DIR/models/checkpoints"
15
+ TEXT_ENCODER_DIR="$BASE_DIR/models/text_encoders"
16
+ VAE_DIR="$BASE_DIR/models/vae"
17
+ LORA_DIR="$BASE_DIR/models/loras"
18
+
19
+ apt update && apt install rar unrar -y
20
+ apt update && apt install zip -y
21
+
22
+ # ================= SETUP =================
23
+ echo "🚀 Starting direct download from $REPO_ID..."
24
+
25
+ # Create input/output directories
26
+ mkdir -p "$BASE_DIR/input/images" "$BASE_DIR/output/images" "$BASE_DIR/output/videos"
27
+
28
+ # ================= DOWNLOADS =================
29
+
30
+ # 1. Download ZIT models (diffusion-model)
31
+ echo "⬇️ Downloading ZIT models..."
32
+ hf download "$REPO_ID" --include "diffusion-model/*ZIT*.safetensors" --local-dir "$DIFFUSION_DIR" --token "$HF_TOKEN"
33
+
34
+ # 2. Download Qwen models (text-encoder)
35
+ echo "⬇️ Downloading Qwen text encoders..."
36
+ hf download "$REPO_ID" --include "text-encoder/*qwen*.safetensors" --local-dir "$TEXT_ENCODER_DIR" --token "$HF_TOKEN"
37
+
38
+ # 3. Download specific VAEs
39
+ echo "⬇️ Downloading specific VAEs..."
40
+ hf download "$REPO_ID" --include "vae/ae.safetensors" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
41
+ hf download "$REPO_ID" --include "vae/ultra_flux.safetensor" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
42
+
43
+
44
+
45
+ # 4. Download Qwen-Rapid-AIO-NSFW-v23 to Checkpoints
46
+ echo "⬇️ Downloading Qwen-Rapid-AIO-NSFW-v23..."
47
+ hf download "$REPO_ID" "diffusion-model/Qwen-Rapid-AIO-NSFW-v23.safetensors" --local-dir "$CHECKPOINT_DIR" --token "$HF_TOKEN"
48
+
49
+ # 5. Download MiniMax H3 to Models
50
+ echo "⬇️ Downloading MiniMax-H3 R2V & FL2V Models..."
51
+ hf download "$MINIMAX_ID" --include "diffusion_models/minimax_h3_fl2va_pruned_bf16.safetensors" --local-dir "$DIFFUSION_DIR" --token "$HF_TOKEN"
52
+ hf download "$MINIMAX_ID" --include "diffusion_models/minimax_h3_ref2va_pruned_bf16.safetensors" --local-dir "$DIFFUSION_DIR" --token "$HF_TOKEN"
53
+ hf download "$MINIMAX_ID" --include "text_encoders/qwen3vl_32b_minimax_h3_bf16.safetensors" --local-dir "$TEXT_ENCODER_DIR" --token "$HF_TOKEN"
54
+ hf download "$MINIMAX_ID" --include "vae/minimax_h3_video_vae_fp16.safetensors" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
55
+ hf download "$MINIMAX_ID" --include "vae/minimax_h3_audio_vae_fp32.safetensors" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
56
+ hf download "$MINIMAX_LORA_ID" --include "minimax_h3_turbo_4step.safetensors" --local-dir "$LORA_DIR" --token "$HF_TOKEN"
57
+
58
+
59
+ # ================= ORGANIZE & CLEANUP =================
60
+ echo "📂 Flattening directory structure..."
61
+
62
+ # Function to flatten a directory: moves files from subdirs to root and removes subdirs
63
+ flatten_dir() {
64
+ local target="$1"
65
+
66
+ # Move all files from subdirectories (mindepth 2) to target root
67
+ # Handles nested directories and spaces in filenames correctly
68
+ find "$target" -mindepth 2 -type f -exec mv -t "$target" {} + 2>/dev/null
69
+
70
+ # Remove all empty directories under target (deepest first)
71
+ find "$target" -mindepth 1 -depth -type d -empty -delete 2>/dev/null
72
+ }
73
+
74
+ # Apply flattening to all target folders
75
+ flatten_dir "$DIFFUSION_DIR"
76
+ flatten_dir "$TEXT_ENCODER_DIR"
77
+ flatten_dir "$VAE_DIR"
78
+ flatten_dir "$CHECKPOINT_DIR"
79
+
80
+ # Remove residual .cache/huggingface metadata folders created by the tool
81
+ find "$BASE_DIR/models" -type d -name ".cache" -exec rm -rf {} + 2>/dev/null || true
82
+
83
+ echo "✅ Done! All files downloaded and organized in $BASE_DIR"