|
|
#!/bin/bash |
|
|
set -e |
|
|
|
|
|
echo "π Setting up file structure and repositories..." |
|
|
|
|
|
|
|
|
mkdir -p comfyui/ComfyUI |
|
|
mkdir -p workflows models/checkpoints models/loras models/vae outputs temp |
|
|
|
|
|
|
|
|
COMFYUI_DIR="comfyui/ComfyUI" |
|
|
CUSTOM_NODES_DIR="$COMFYUI_DIR/custom_nodes" |
|
|
|
|
|
|
|
|
if [ ! -d "$COMFYUI_DIR/.git" ]; then |
|
|
echo "π¦ Cloning ComfyUI..." |
|
|
git clone --depth 1 https://github.com/comfyanonymous/ComfyUI.git "$COMFYUI_DIR" |
|
|
fi |
|
|
|
|
|
|
|
|
echo "π¦ Installing ComfyUI's Python requirements..." |
|
|
pip install -r "$COMFYUI_DIR/requirements.txt" |
|
|
|
|
|
|
|
|
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 ../../.. |
|
|
|
|
|
|
|
|
echo "π¦ Downloading models for custom nodes..." |
|
|
|
|
|
FACERESTORE_MODEL_DIR="$COMFYUI_DIR/models/facerestore" |
|
|
GFPGAN_MODEL_PATH="$FACERESTORE_MODEL_DIR/GFPGANv1.4.pth" |
|
|
|
|
|
|
|
|
mkdir -p "$FACERESTORE_MODEL_DIR" |
|
|
|
|
|
|
|
|
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." |