Upload download_models.sh
Browse files- scripts/download_models.sh +81 -0
scripts/download_models.sh
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.safetensors" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
|
| 42 |
+
|
| 43 |
+
# 4. Download Qwen-Rapid-AIO-NSFW-v23 to Checkpoints
|
| 44 |
+
echo "⬇️ Downloading Qwen-Rapid-AIO-NSFW-v23..."
|
| 45 |
+
hf download "$REPO_ID" "diffusion-model/Qwen-Rapid-AIO-NSFW-v23.safetensors" --local-dir "$CHECKPOINT_DIR" --token "$HF_TOKEN"
|
| 46 |
+
|
| 47 |
+
# 5. Download MiniMax H3 to Models
|
| 48 |
+
echo "⬇️ Downloading MiniMax-H3 R2V & FL2V Models..."
|
| 49 |
+
hf download "$MINIMAX_ID" --include "diffusion_models/minimax_h3_fl2va_pruned_bf16.safetensors" --local-dir "$DIFFUSION_DIR" --token "$HF_TOKEN"
|
| 50 |
+
hf download "$MINIMAX_ID" --include "diffusion_models/minimax_h3_ref2va_pruned_bf16.safetensors" --local-dir "$DIFFUSION_DIR" --token "$HF_TOKEN"
|
| 51 |
+
hf download "$REPO_ID" --include "diffusion-model/MMH3-PinkyCherry-beta0.6-diffusion-model.safetensors" --local-dir "$DIFFUSION_DIR" --token "$HF_TOKEN"
|
| 52 |
+
hf download "$MINIMAX_ID" --include "text_encoders/qwen3vl_32b_minimax_h3_bf16.safetensors" --local-dir "$TEXT_ENCODER_DIR" --token "$HF_TOKEN"
|
| 53 |
+
hf download "$MINIMAX_ID" --include "vae/minimax_h3_video_vae_fp16.safetensors" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
|
| 54 |
+
hf download "$MINIMAX_ID" --include "vae/minimax_h3_audio_vae_fp32.safetensors" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
|
| 55 |
+
hf download "$MINIMAX_LORA_ID" --include "minimax_h3_turbo_4step.safetensors" --local-dir "$LORA_DIR" --token "$HF_TOKEN"
|
| 56 |
+
|
| 57 |
+
# ================= ORGANIZE & CLEANUP =================
|
| 58 |
+
echo "📂 Flattening directory structure..."
|
| 59 |
+
|
| 60 |
+
# Function to flatten a directory: moves files from subdirs to root and removes subdirs
|
| 61 |
+
flatten_dir() {
|
| 62 |
+
local target="$1"
|
| 63 |
+
|
| 64 |
+
# Move all files from subdirectories (mindepth 2) to target root
|
| 65 |
+
# Handles nested directories and spaces in filenames correctly
|
| 66 |
+
find "$target" -mindepth 2 -type f -exec mv -t "$target" {} + 2>/dev/null
|
| 67 |
+
|
| 68 |
+
# Remove all empty directories under target (deepest first)
|
| 69 |
+
find "$target" -mindepth 1 -depth -type d -empty -delete 2>/dev/null
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
# Apply flattening to all target folders
|
| 73 |
+
flatten_dir "$DIFFUSION_DIR"
|
| 74 |
+
flatten_dir "$TEXT_ENCODER_DIR"
|
| 75 |
+
flatten_dir "$VAE_DIR"
|
| 76 |
+
flatten_dir "$CHECKPOINT_DIR"
|
| 77 |
+
|
| 78 |
+
# Remove residual .cache/huggingface metadata folders created by the tool
|
| 79 |
+
find "$BASE_DIR/models" -type d -name ".cache" -exec rm -rf {} + 2>/dev/null || true
|
| 80 |
+
|
| 81 |
+
echo "✅ Done! All files downloaded and organized in $BASE_DIR"
|