| cd /workspace/madapps |
| cat > install_comfyui.sh << 'EOF' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| set -euo pipefail |
| COMFY_DIR="${COMFY_DIR:-/workspace/madapps/ComfyUI}" |
| VENV="${VENV:-$COMFY_DIR/.venv}" |
| info() { echo -e "\033[1;32m[INFO]\033[0m $*"; } |
| warn() { echo -e "\033[1;33m[WARN]\033[0m $*"; } |
| |
| |
| |
| if [[ ! -d "$COMFY_DIR" ]]; then |
| warn "ComfyUI directory '$COMFY_DIR' does not exist. Set COMFY_DIR or clone ComfyUI first."; exit 1; fi |
| if [[ ! -d "$VENV" ]]; then |
| warn "Python venv '$VENV' not found. Create it with 'python -m venv $VENV' first."; exit 1; fi |
| |
| |
| |
| info "Activating virtualenv…"; source "$VENV/bin/activate" |
| info "Upgrading pip & wheel…"; pip install --upgrade pip wheel |
| |
| |
| |
| APT_CMD="apt-get"; [[ $(id -u) -ne 0 && $(command -v sudo) ]] && APT_CMD="sudo $APT_CMD" |
| if [[ -n "$APT_CMD" ]]; then |
| info "Installing system CMake & tool‑chain…" |
| $APT_CMD update -y && $APT_CMD install -y cmake build-essential python3-dev git wget |
| fi |
| |
| |
| |
| if pip show cmake >/dev/null 2>&1; then |
| warn "Removing pip‑installed cmake to avoid conflicts…"; pip uninstall -y cmake; fi |
| |
| |
| |
| info "Installing Python deps (dlib, insightface)…" |
| pip install --no-cache-dir dlib insightface |
| info "Pinning transformers==4.52…" |
| if pip show transformers >/dev/null 2>&1; then pip uninstall -y transformers; fi |
| pip install --no-cache-dir transformers==4.52 |
| |
| |
| |
| |
| |
| CRYSTOOLS_DIR="$COMFY_DIR/custom_nodes/comfyui-crystools" |
| info "Installing/Updating Crystools custom node…" |
|
|
| if [[ -d "$CRYSTOOLS_DIR/.git" ]]; then |
| info "Updating existing Crystools repo…" |
| git -C "$CRYSTOOLS_DIR" pull --rebase --autostash |
| else |
| info "Cloning Crystools into custom_nodes…" |
| git clone --depth 1 https://github.com/crystian/ComfyUI-Crystools.git "$CRYSTOOLS_DIR" |
| fi |
|
|
| if [[ -f "$CRYSTOOLS_DIR/requirements.txt" ]]; then |
| info "Installing Crystools Python requirements…" |
| pip install --no-cache-dir -r "$CRYSTOOLS_DIR/requirements.txt" |
| fi |
| |
| |
| download() { |
| local url="$1" dst="$2"; |
| if [[ -f "$dst" ]]; then info "✓ $(basename "$dst") already exists"; else |
| info "↓ $(basename "$dst")"; wget -q --show-progress -O "$dst" "$url"; fi } |
| |
| mkdir -p "$COMFY_DIR/models/"{checkpoints,unet,clip,vae,loras,controlnet} |
| |
| |
| |
| info "Downloading model weights (skip if already present)…" |
| |
| download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/lustifySDXLNSFW_oltFIXEDTEXTURES.safetensors?download=true" \ |
| "$COMFY_DIR/models/checkpoints/lustifySDXLNSFW_oltFIXEDTEXTURES.safetensors" |
| |
| download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/flux1-dev-fp8.safetensors?download=true" \ |
| "$COMFY_DIR/models/unet/flux1-dev-fp8.safetensors" |
| download "https://huggingface.co/6chan/flux1-kontext-dev-fp8/resolve/main/flux1-kontext-dev-fp8-e4m3fn.safetensors?download=true" \ |
| "$COMFY_DIR/models/unet/flux1-kontext-dev-fp8-e4m3fn.safetensors" |
| download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/realDream_flux1V1.safetensors?download=true" \ |
| "$COMFY_DIR/models/unet/realDream_flux1V1.safetensors" |
| |
| download "https://huggingface.co/GraydientPlatformAPI/flux-clip/resolve/main/clip_l.safetensors?download=true" \ |
| "$COMFY_DIR/models/clip/clip_l.safetensors" |
| download "https://huggingface.co/GraydientPlatformAPI/flux-clip/resolve/main/t5xxl_fp8_e4m3fn.safetensors?download=true" \ |
| "$COMFY_DIR/models/clip/t5xxl_fp8_e4m3fn.safetensors" |
| |
| download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/ae.safetensors?download=true" \ |
| "$COMFY_DIR/models/vae/ae.safetensors" |
| |
| download "https://huggingface.co/XLabs-AI/flux-RealismLora/resolve/main/lora.safetensors?download=true" \ |
| "$COMFY_DIR/models/loras/flux-RealismLora.safetensors" |
| download "https://huggingface.co/stabletable25/lustifyxl/resolve/main/MysticXXX-v7.safetensors?download=true" \ |
| "$COMFY_DIR/models/loras/MysticXXX-v7.safetensors" |
| |
| download "https://huggingface.co/jasperai/Flux.1-dev-Controlnet-Depth/resolve/main/diffusion_pytorch_model.safetensors?download=true" \ |
| "$COMFY_DIR/models/controlnet/jasparaidepth.safetensors" |
| download "https://huggingface.co/Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro-2.0/resolve/main/diffusion_pytorch_model.safetensors?download=true" \ |
| "$COMFY_DIR/models/controlnet/controlnetunionpro2.safetensors" |
| |
| info "✔ Setup finished. Launch ComfyUI with:\n cd $COMFY_DIR && bash run.sh" |
| EOF |
| chmod +x install_comfyui.sh |
|
|