File size: 1,715 Bytes
aaa35d3 246a5bc aaa35d3 246a5bc aaa35d3 246a5bc aaa35d3 481cc13 aaa35d3 481cc13 aaa35d3 481cc13 aaa35d3 c00b1e6 246a5bc aaa35d3 481cc13 aaa35d3 12d573d aaa35d3 481cc13 aaa35d3 246a5bc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #!/bin/bash
set -e
echo "π Setting up file structure and repositories..."
# Create directory structure
mkdir -p comfyui/ComfyUI
mkdir -p workflows models/checkpoints models/loras models/vae outputs temp
# Define ComfyUI paths for clarity
COMFYUI_DIR="comfyui/ComfyUI"
CUSTOM_NODES_DIR="$COMFYUI_DIR/custom_nodes"
# Clone ComfyUI if not exists
if [ ! -d "$COMFYUI_DIR/.git" ]; then
echo "π¦ Cloning ComfyUI..."
git clone --depth 1 https://github.com/comfyanonymous/ComfyUI.git "$COMFYUI_DIR"
fi
# Install ComfyUI's own Python dependencies, including the frontend
echo "π¦ Installing ComfyUI's Python requirements..."
pip install -r "$COMFYUI_DIR/requirements.txt"
# Install custom nodes
echo "π¦ Installing custom nodes..."
cd "$CUSTOM_NODES_DIR"
if [ ! -d "ComfyUI-Impact-Pack" ]; then
git clone --depth 1 https://github.com/ltdrdata/ComfyUI-Impact-Pack.git
fi
if [ ! -d "facerestore_cf" ]; then
git clone --depth 1 https://github.com/mav-rik/facerestore_cf.git
fi
cd ../../.. # Return to the root directory of the app
# Download models required by custom nodes
echo "π¦ Downloading models for custom nodes..."
FACERESTORE_MODEL_DIR="$COMFYUI_DIR/models/facerestore"
GFPGAN_MODEL_PATH="$FACERESTORE_MODEL_DIR/GFPGANv1.4.pth"
# Create the directory if it doesn't exist
mkdir -p "$FACERESTORE_MODEL_DIR"
# Download GFPGAN model if it's missing
if [ ! -f "$GFPGAN_MODEL_PATH" ]; then
echo "π₯ Downloading GFPGANv1.4 model..."
wget -q -O "$GFPGAN_MODEL_PATH" https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth
echo "β
GFPGANv1.4 model downloaded."
else
echo "β
Found existing GFPGANv1.4 model."
fi
echo "β
Setup script finished." |