-
Notifications
You must be signed in to change notification settings - Fork 1
/
pre_start.sh
109 lines (91 loc) · 3.34 KB
/
pre_start.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
if [ -d "/workspace/ComfyUI" ]; then
echo "Starting ComfyUI..."
cd /workspace/ComfyUI
source /workspace/sd-venv/bin/activate
nohup python main.py --listen 0.0.0.0 --port 3020 &> ../output.log &
exit 0
fi
cd /workspace
git clone https://github.com/comfyanonymous/ComfyUI.git
#cd ./ComfyUI
#git reset --hard bc1f6e21856f7be25db5c5c2956b89c27db93b3d
#cd /workspace
wget -O ./ComfyUI/web/scripts/defaultGraph.js https://raw.githubusercontent.com/mav-rik/runpod-comfyui-scripts/master/$DOWNLOADS/workflow.js
# --------------------------------
mkdir -p /workspace/downloads/models
mkdir -p /workspace/downloads/controlnet
mkdir -p /workspace/downloads/upscale
mkdir -p /workspace/downloads/face
mkdir -p /workspace/downloads/vae
# -------------------------
rm -rf /workspace/ComfyUI/models/checkpoints
rm -rf /workspace/ComfyUI/models/vae
rm -rf /workspace/ComfyUI/models/facerestore_models
rm -rf /workspace/ComfyUI/models/controlnet
rm -rf /workspace/ComfyUI/models/upscale_models
ln -s /workspace/downloads/models /workspace/ComfyUI/models/checkpoints
ln -s /workspace/downloads/vae /workspace/ComfyUI/models/vae
ln -s /workspace/downloads/face /workspace/ComfyUI/models/facerestore_models
ln -s /workspace/downloads/controlnet /workspace/ComfyUI/models/controlnet
ln -s /workspace/downloads/upscale /workspace/ComfyUI/models/upscale_models
# --------------------------------
cd /workspace
wget https://raw.githubusercontent.com/mav-rik/runpod-comfyui-scripts/master/$DOWNLOADS/downloads.sh
chmod +x ./downloads.sh
echo Downloading models in background...
./downloads.sh &> ./downloads.log &
# --------------------------------
cd /workspace
python -m venv sd-venv
source /workspace/sd-venv/bin/activate
cd ComfyUI
pip install -r requirements.txt
## comfyui custom nodes
cd /workspace/ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
git clone https://github.com/EllangoK/ComfyUI-post-processing-nodes.git
git clone https://github.com/Stability-AI/stability-ComfyUI-nodes.git
wget https://raw.githubusercontent.com/biegert/ComfyUI-CLIPSeg/main/custom_nodes/clipseg.py
git clone https://github.com/twri/sdxl_prompt_styler.git
if [ "$ROOP" == "1" ]; then
### roop
git clone https://github.com/ssitu/ComfyUI_roop
cd ComfyUI_roop
### needed for Roop (works on runpod well)
# apt-get install build-essential -y
# apt-get install python3-dev -y
###
python install.py
pip install insightface
cd ..
fi
### ComfyUI-WD14-Tagger
git clone https://github.com/pythongosssss/ComfyUI-WD14-Tagger
cd ComfyUI-WD14-Tagger
pip install -r requirements.txt
cd ..
### controlnet
git clone https://github.com/Fannovel16/comfyui_controlnet_aux/
cd comfyui_controlnet_aux
git reset --hard 360fcefcff250e9245db9eede6515139ac5bb4e5
pip install -r requirements.txt
cd ..
### ultimate upscale
git clone https://github.com/ssitu/ComfyUI_UltimateSDUpscale --recursive
### facerestore_cf
git clone https://github.com/mav-rik/facerestore_cf.git
cd facerestore_cf
pip install -r requirements.txt
cd ..
### face restore
#wget -O facerestore.zip https://civitai.com/api/download/models/122586
#unzip facerestore.zip
#rm -rf facerestore.zip
#mkdir -p /workspace/ComfyUI/models/facerestore_models
cd /workspace
# run ComfyUI
cd /workspace/ComfyUI
echo "Starting ComfyUI..."
source /workspace/sd-venv/bin/activate
nohup python main.py --listen 0.0.0.0 --port 3020 &> ../output.log &