-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
43 lines (38 loc) · 1.53 KB
/
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
#!/usr/bin/env bash
echo "Worker Initiated"
echo "Symlinking files from Network Volume"
rm -rf /workspace && \
ln -s /runpod-volume /workspace
echo "Docker image version: ${IMAGE_VERSION}"
if [ -f "/workspace/venv/bin/activate" ]; then
echo "Starting Stable Diffusion WebUI Forge API"
source /workspace/venv/bin/activate
TCMALLOC="$(ldconfig -p | grep -Po "libtcmalloc.so.\d" | head -n 1)"
export LD_PRELOAD="${TCMALLOC}"
export PYTHONUNBUFFERED=true
export HF_HOME="/workspace"
python3 /workspace/stable-diffusion-webui-forge/webui.py \
--xformers \
--no-half-vae \
--skip-python-version-check \
--skip-torch-cuda-test \
--skip-install \
--lowram \
--opt-sdp-attention \
--disable-safe-unpickle \
--port 3000 \
--api \
--nowebui \
--skip-version-check \
--no-hashing \
--no-download-sd-model > /workspace/logs/forge.log 2>&1 &
deactivate
else
echo "ERROR: The Python Virtual Environment (/workspace/venv/bin/activate) could not be activated"
echo "1. Ensure that you have followed the instructions at: https://github.com/ashleykleynhans/runpod-worker-forge/blob/main/docs/installing.md"
echo "2. Ensure that you have used the Pytorch image for the installation and NOT a Stable Diffusion image."
echo "3. Ensure that you have attached your Network Volume to your endpoint."
echo "4. Ensure that you didn't assign any other invalid regions to your endpoint."
fi
echo "Starting RunPod Handler"
python3 -u /rp_handler.py