Delete scripts/download_models.sh
Browse files- scripts/download_models.sh +0 -69
scripts/download_models.sh
DELETED
|
@@ -1,69 +0,0 @@
|
|
| 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 |
-
|
| 10 |
-
# ComfyUI Target Folders
|
| 11 |
-
DIFFUSION_DIR="$BASE_DIR/models/diffusion_models"
|
| 12 |
-
CHECKPOINT_DIR="$BASE_DIR/models/checkpoints"
|
| 13 |
-
TEXT_ENCODER_DIR="$BASE_DIR/models/text_encoders"
|
| 14 |
-
VAE_DIR="$BASE_DIR/models/vae"
|
| 15 |
-
|
| 16 |
-
apt update && apt install rar unrar -y
|
| 17 |
-
apt update && apt install zip -y
|
| 18 |
-
|
| 19 |
-
# ================= SETUP =================
|
| 20 |
-
echo "🚀 Starting direct download from $REPO_ID..."
|
| 21 |
-
|
| 22 |
-
# Create input/output directories
|
| 23 |
-
mkdir -p "$BASE_DIR/input/images" "$BASE_DIR/output/images" "$BASE_DIR/output/videos"
|
| 24 |
-
|
| 25 |
-
# ================= DOWNLOADS =================
|
| 26 |
-
|
| 27 |
-
# 1. Download ZIT models (diffusion-model)
|
| 28 |
-
# Pattern: *ZIT*.safetensors
|
| 29 |
-
echo "⬇️ Downloading ZIT models..."
|
| 30 |
-
hf download "$REPO_ID" --include "diffusion-model/*ZIT*.safetensors" --local-dir "$DIFFUSION_DIR" --token "$HF_TOKEN"
|
| 31 |
-
|
| 32 |
-
# 2. Download Qwen models (text-encoder)
|
| 33 |
-
# Pattern: *qwen*.safetensors
|
| 34 |
-
echo "⬇️ Downloading Qwen text encoders..."
|
| 35 |
-
hf download "$REPO_ID" --include "text-encoder/*qwen*.safetensors" --local-dir "$TEXT_ENCODER_DIR" --token "$HF_TOKEN"
|
| 36 |
-
|
| 37 |
-
# 3. Download specific VAEs
|
| 38 |
-
echo "⬇️ Downloading specific VAEs..."
|
| 39 |
-
hf download "$REPO_ID" "vae/ultra_flux.safetensor" "vae/qwen_image_vae.safetensors" --local-dir "$VAE_DIR" --token "$HF_TOKEN"
|
| 40 |
-
|
| 41 |
-
# 4. Download Qwen-Rapid-AIO-NSFW-v23 to Checkpoints
|
| 42 |
-
echo "⬇️ Downloading Qwen-Rapid-AIO-NSFW-v23..."
|
| 43 |
-
hf download "$REPO_ID" "diffusion-model/Qwen-Rapid-AIO-NSFW-v23.safetensors" --local-dir "$CHECKPOINT_DIR" --token "$HF_TOKEN"
|
| 44 |
-
|
| 45 |
-
# ================= ORGANIZE & CLEANUP =================
|
| 46 |
-
echo "📂 Flattening directory structure..."
|
| 47 |
-
|
| 48 |
-
# Function to flatten a directory: moves files from subdirs to root and removes subdirs
|
| 49 |
-
flatten_dir() {
|
| 50 |
-
local target="$1"
|
| 51 |
-
|
| 52 |
-
# Move all files from subdirectories (mindepth 2) to target root
|
| 53 |
-
# Handles nested directories and spaces in filenames correctly
|
| 54 |
-
find "$target" -mindepth 2 -type f -exec mv -t "$target" {} + 2>/dev/null
|
| 55 |
-
|
| 56 |
-
# Remove all empty directories under target (deepest first)
|
| 57 |
-
find "$target" -mindepth 1 -depth -type d -empty -delete 2>/dev/null
|
| 58 |
-
}
|
| 59 |
-
|
| 60 |
-
# Apply flattening to all target folders
|
| 61 |
-
flatten_dir "$DIFFUSION_DIR"
|
| 62 |
-
flatten_dir "$TEXT_ENCODER_DIR"
|
| 63 |
-
flatten_dir "$VAE_DIR"
|
| 64 |
-
flatten_dir "$CHECKPOINT_DIR"
|
| 65 |
-
|
| 66 |
-
# Remove residual .cache/huggingface metadata folders created by the tool
|
| 67 |
-
find "$BASE_DIR/models" -type d -name ".cache" -exec rm -rf {} + 2>/dev/null || true
|
| 68 |
-
|
| 69 |
-
echo "✅ Done! All files downloaded and organized in $BASE_DIR"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|