worker source bootstrap-h3.sh
Browse files- bootstrap-h3.sh +34 -0
bootstrap-h3.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Remote worker bootstrap for hypium-h3-prod-v1.
|
| 3 |
+
# Official RunPod PyTorch image + HF-hosted worker source. Weights come from
|
| 4 |
+
# RunPod --model-reference, never from this Mac.
|
| 5 |
+
set -euo pipefail
|
| 6 |
+
export DEBIAN_FRONTEND=noninteractive
|
| 7 |
+
SRC_URL="${H3_WORKER_SRC_URL:-https://huggingface.co/datasets/exefg/hypium-worker-src/resolve/main/h3-src.tgz}"
|
| 8 |
+
COMFY_PIN="${H3_COMFY_PIN:-12d5279438bfefc058a269eae805ceab6047777f}"
|
| 9 |
+
|
| 10 |
+
if [[ ! -f /opt/hypium/worker/handler.py ]]; then
|
| 11 |
+
apt-get update
|
| 12 |
+
apt-get install -y --no-install-recommends git ffmpeg ca-certificates curl
|
| 13 |
+
mkdir -p /opt/hypium
|
| 14 |
+
curl -fsSL "$SRC_URL" -o /tmp/h3-src.tgz
|
| 15 |
+
tar -xzf /tmp/h3-src.tgz -C /opt/hypium
|
| 16 |
+
pip install --no-cache-dir --break-system-packages -r /opt/hypium/worker/requirements.txt
|
| 17 |
+
pip install --no-cache-dir --break-system-packages --ignore-installed cryptography runpod==1.10.1
|
| 18 |
+
fi
|
| 19 |
+
|
| 20 |
+
if [[ ! -d /opt/ComfyUI ]]; then
|
| 21 |
+
git clone --depth 1 --branch v0.34.0 https://github.com/comfyanonymous/ComfyUI.git /opt/ComfyUI
|
| 22 |
+
cd /opt/ComfyUI
|
| 23 |
+
git fetch --depth 1 origin "$COMFY_PIN" || true
|
| 24 |
+
git checkout "$COMFY_PIN"
|
| 25 |
+
pip install --no-cache-dir --break-system-packages -r requirements.txt
|
| 26 |
+
fi
|
| 27 |
+
|
| 28 |
+
export WORKSPACE_DIR="${WORKSPACE_DIR:-/opt/hypium/worker}"
|
| 29 |
+
export COMFYUI_PATH="${COMFYUI_PATH:-/opt/ComfyUI}"
|
| 30 |
+
export COMFYUI_MODELS="${COMFYUI_MODELS:-/opt/ComfyUI/models}"
|
| 31 |
+
export PYTHONPATH=/opt/hypium/worker
|
| 32 |
+
export MODE_TO_RUN=serverless
|
| 33 |
+
chmod +x /opt/hypium/worker/start.sh
|
| 34 |
+
exec /opt/hypium/worker/start.sh
|