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|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cd /workspace/madapps
|
| 2 |
+
cat > install_comfyui.sh << 'EOF'
|
| 3 |
+
#!/usr/bin/env bash
|
| 4 |
+
#!/usr/bin/env bash
|
| 5 |
+
# ---------------------------------------------------------------------------
|
| 6 |
+
# ComfyUI one‑shot installer for RunPod (rev‑2)
|
| 7 |
+
# ---------------------------------------------------------------------------
|
| 8 |
+
# • Activates your virtualenv
|
| 9 |
+
# • Installs official **system** CMake & tool‑chain first (avoids dlib build bug)
|
| 10 |
+
# • Removes any pip‑provided cmake that might shadow /usr/bin/cmake
|
| 11 |
+
# • Installs Python deps and downloads model weights (idempotent)
|
| 12 |
+
# ---------------------------------------------------------------------------
|
| 13 |
+
set -euo pipefail
|
| 14 |
+
COMFY_DIR="${COMFY_DIR:-/workspace/madapps/ComfyUI}"
|
| 15 |
+
VENV="${VENV:-$COMFY_DIR/.venv}"
|
| 16 |
+
info() { echo -e "\033[1;32m[INFO]\033[0m $*"; }
|
| 17 |
+
warn() { echo -e "\033[1;33m[WARN]\033[0m $*"; }
|
| 18 |
+
# ---------------------------------------------------------------------------
|
| 19 |
+
# Sanity checks
|
| 20 |
+
# ---------------------------------------------------------------------------
|
| 21 |
+
if [[ ! -d "$COMFY_DIR" ]]; then
|
| 22 |
+
warn "ComfyUI directory '$COMFY_DIR' does not exist. Set COMFY_DIR or clone ComfyUI first."; exit 1; fi
|
| 23 |
+
if [[ ! -d "$VENV" ]]; then
|
| 24 |
+
warn "Python venv '$VENV' not found. Create it with 'python -m venv $VENV' first."; exit 1; fi
|
| 25 |
+
# ---------------------------------------------------------------------------
|
| 26 |
+
# Activate env & upgrade pip
|
| 27 |
+
# ---------------------------------------------------------------------------
|
| 28 |
+
info "Activating virtualenv…"; source "$VENV/bin/activate"
|
| 29 |
+
info "Upgrading pip & wheel…"; pip install --upgrade pip wheel
|
| 30 |
+
# ---------------------------------------------------------------------------
|
| 31 |
+
# System build deps **first** so dlib finds a real /usr/bin/cmake
|
| 32 |
+
# ---------------------------------------------------------------------------
|
| 33 |
+
APT_CMD="apt-get"; [[ $(id -u) -ne 0 && $(command -v sudo) ]] && APT_CMD="sudo $APT_CMD"
|
| 34 |
+
if [[ -n "$APT_CMD" ]]; then
|
| 35 |
+
info "Installing system CMake & tool‑chain…"
|
| 36 |
+
$APT_CMD update -y && $APT_CMD install -y cmake build-essential python3-dev git wget
|
| 37 |
+
fi
|
| 38 |
+
# ---------------------------------------------------------------------------
|
| 39 |
+
# Ensure pip’s cmake, if present, doesn’t shadow the system one
|
| 40 |
+
# ---------------------------------------------------------------------------
|
| 41 |
+
if pip show cmake >/dev/null 2>&1; then
|
| 42 |
+
warn "Removing pip‑installed cmake to avoid conflicts…"; pip uninstall -y cmake; fi
|
| 43 |
+
# ---------------------------------------------------------------------------
|
| 44 |
+
# Python packages that need the compiler tool‑chain
|
| 45 |
+
# ---------------------------------------------------------------------------
|
| 46 |
+
info "Installing Python deps (dlib, insightface)…"
|
| 47 |
+
pip install --no-cache-dir dlib insightface
|
| 48 |
+
info "Pinning transformers==4.52…"
|
| 49 |
+
if pip show transformers >/dev/null 2>&1; then pip uninstall -y transformers; fi
|
| 50 |
+
pip install --no-cache-dir transformers==4.52
|
| 51 |
+
# ---------------------------------------------------------------------------
|
| 52 |
+
# Helper for installing/updating ComfyUI custom nodes
|
| 53 |
+
# ---------------------------------------------------------------------------
|
| 54 |
+
install_or_update_custom_node() {
|
| 55 |
+
local name="$1"
|
| 56 |
+
local repo_url="$2"
|
| 57 |
+
|
| 58 |
+
# Derive a sane target directory from repo name (lowercased, minus .git)
|
| 59 |
+
local repo_base="${repo_url##*/}"
|
| 60 |
+
repo_base="${repo_base%.git}"
|
| 61 |
+
local target_dir="$COMFY_DIR/custom_nodes/${repo_base,,}"
|
| 62 |
+
|
| 63 |
+
info "Installing/Updating ${name} custom node…"
|
| 64 |
+
|
| 65 |
+
if [[ -d "$target_dir/.git" ]]; then
|
| 66 |
+
info "Updating existing ${name} repo…"
|
| 67 |
+
git -C "$target_dir" pull --rebase --autostash
|
| 68 |
+
else
|
| 69 |
+
info "Cloning ${name} into custom_nodes…"
|
| 70 |
+
git clone --depth 1 "$repo_url" "$target_dir"
|
| 71 |
+
fi
|
| 72 |
+
|
| 73 |
+
# If the repo uses submodules, fetch them
|
| 74 |
+
if [[ -f "$target_dir/.gitmodules" ]]; then
|
| 75 |
+
info "Updating git submodules for ${name}…"
|
| 76 |
+
git -C "$target_dir" submodule update --init --recursive --depth 1
|
| 77 |
+
fi
|
| 78 |
+
|
| 79 |
+
# Install Python requirements if present
|
| 80 |
+
if [[ -f "$target_dir/requirements.txt" ]]; then
|
| 81 |
+
info "Installing ${name} Python requirements…"
|
| 82 |
+
pip install --no-cache-dir -r "$target_dir/requirements.txt"
|
| 83 |
+
elif compgen -G "$target_dir/requirements*.txt" > /dev/null; then
|
| 84 |
+
for req in "$target_dir"/requirements*.txt; do
|
| 85 |
+
info "Installing ${name} Python requirements from $(basename "$req")…"
|
| 86 |
+
pip install --no-cache-dir -r "$req"
|
| 87 |
+
done
|
| 88 |
+
fi
|
| 89 |
+
|
| 90 |
+
# If it’s a Python package, install it (editable) as well
|
| 91 |
+
if [[ -f "$target_dir/setup.py" || -f "$target_dir/pyproject.toml" ]]; then
|
| 92 |
+
info "Installing ${name} as a Python package (editable)…"
|
| 93 |
+
pip install --no-cache-dir -e "$target_dir"
|
| 94 |
+
fi
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
# ---------------------------------------------------------------------------
|
| 98 |
+
# Custom nodes: install/update
|
| 99 |
+
# ---------------------------------------------------------------------------
|
| 100 |
+
|
| 101 |
+
# (Optional) You can swap your existing Crystools block for this one-liner:
|
| 102 |
+
install_or_update_custom_node "Crystools" "https://github.com/crystian/ComfyUI-Crystools.git"
|
| 103 |
+
|
| 104 |
+
install_or_update_custom_node "Custom Scripts" "https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git"
|
| 105 |
+
install_or_update_custom_node "KJ Nodes" "https://github.com/kijai/ComfyUI-KJNodes.git"
|
| 106 |
+
install_or_update_custom_node "LayerStyle Advance" "https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git"
|
| 107 |
+
install_or_update_custom_node "Easy Use" "https://github.com/yolain/ComfyUI-Easy-Use.git"
|
| 108 |
+
install_or_update_custom_node "ControlNet Aux" "https://github.com/Fannovel16/comfyui_controlnet_aux.git"
|
| 109 |
+
install_or_update_custom_node "Essentials" "https://github.com/cubiq/ComfyUI_essentials.git"
|
| 110 |
+
install_or_update_custom_node "Face Parsing" "https://github.com/Ryuukeisyou/comfyui_face_parsing.git"
|
| 111 |
+
install_or_update_custom_node "Face Analysis" "https://github.com/cubiq/ComfyUI_FaceAnalysis.git"
|
| 112 |
+
install_or_update_custom_node "ControlAltAI Nodes" "https://github.com/gseth/ControlAltAI-Nodes.git"
|
| 113 |
+
install_or_update_custom_node "Masquerade Nodes" "https://github.com/BadCafeCode/masquerade-nodes-comfyui.git"
|
| 114 |
+
install_or_update_custom_node "rgthree" "https://github.com/rgthree/rgthree-comfy.git"
|
| 115 |
+
install_or_update_custom_node "WAS Node Suite" "https://github.com/WASasquatch/was-node-suite-comfyui.git"
|
| 116 |
+
# ---------------------------------------------------------------------------
|
| 117 |
+
# Helper for idempotent downloads
|
| 118 |
+
# ---------------------------------------------------------------------------
|
| 119 |
+
download() {
|
| 120 |
+
local url="$1" dst="$2";
|
| 121 |
+
if [[ -f "$dst" ]]; then info "✓ $(basename "$dst") already exists"; else
|
| 122 |
+
info "↓ $(basename "$dst")"; wget -q --show-progress -O "$dst" "$url"; fi }
|
| 123 |
+
# Create dirs
|
| 124 |
+
mkdir -p "$COMFY_DIR/models/"{checkpoints,unet,clip,vae,loras,controlnet}
|
| 125 |
+
# ---------------------------------------------------------------------------
|
| 126 |
+
# Model weights
|
| 127 |
+
# ---------------------------------------------------------------------------
|
| 128 |
+
info "Downloading model weights (skip if already present)…"
|
| 129 |
+
# Checkpoint
|
| 130 |
+
download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/lustifySDXLNSFW_oltFIXEDTEXTURES.safetensors?download=true" \
|
| 131 |
+
"$COMFY_DIR/models/checkpoints/lustifySDXLNSFW_oltFIXEDTEXTURES.safetensors"
|
| 132 |
+
# UNet
|
| 133 |
+
download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/flux1-dev-fp8.safetensors?download=true" \
|
| 134 |
+
"$COMFY_DIR/models/unet/flux1-dev-fp8.safetensors"
|
| 135 |
+
download "https://huggingface.co/6chan/flux1-kontext-dev-fp8/resolve/main/flux1-kontext-dev-fp8-e4m3fn.safetensors?download=true" \
|
| 136 |
+
"$COMFY_DIR/models/unet/flux1-kontext-dev-fp8-e4m3fn.safetensors"
|
| 137 |
+
download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/realDream_flux1V1.safetensors?download=true" \
|
| 138 |
+
"$COMFY_DIR/models/unet/realDream_flux1V1.safetensors"
|
| 139 |
+
# CLIP
|
| 140 |
+
download "https://huggingface.co/GraydientPlatformAPI/flux-clip/resolve/main/clip_l.safetensors?download=true" \
|
| 141 |
+
"$COMFY_DIR/models/clip/clip_l.safetensors"
|
| 142 |
+
download "https://huggingface.co/GraydientPlatformAPI/flux-clip/resolve/main/t5xxl_fp8_e4m3fn.safetensors?download=true" \
|
| 143 |
+
"$COMFY_DIR/models/clip/t5xxl_fp8_e4m3fn.safetensors"
|
| 144 |
+
# VAE
|
| 145 |
+
download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/ae.safetensors?download=true" \
|
| 146 |
+
"$COMFY_DIR/models/vae/ae.safetensors"
|
| 147 |
+
# Lora
|
| 148 |
+
download "https://huggingface.co/XLabs-AI/flux-RealismLora/resolve/main/lora.safetensors?download=true" \
|
| 149 |
+
"$COMFY_DIR/models/loras/flux-RealismLora.safetensors"
|
| 150 |
+
download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/MysticXXX-v7.safetensors?download=true" \
|
| 151 |
+
"$COMFY_DIR/models/loras/MysticXXX-v7.safetensors"
|
| 152 |
+
# ControlNet
|
| 153 |
+
download "https://huggingface.co/jasperai/Flux.1-dev-Controlnet-Depth/resolve/main/diffusion_pytorch_model.safetensors?download=true" \
|
| 154 |
+
"$COMFY_DIR/models/controlnet/jasparaidepth.safetensors"
|
| 155 |
+
download "https://huggingface.co/Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro-2.0/resolve/main/diffusion_pytorch_model.safetensors?download=true" \
|
| 156 |
+
"$COMFY_DIR/models/controlnet/controlnetunionpro2.safetensors"
|
| 157 |
+
# ---------------------------------------------------------------------------
|
| 158 |
+
info "✔ Setup finished. Launch ComfyUI with:\n cd $COMFY_DIR && bash run.sh"
|
| 159 |
+
EOF
|
| 160 |
+
chmod +x install_comfyui.sh
|
| 161 |
+
|