File size: 1,304 Bytes
e174bd3
6e59ca4
 
 
 
 
 
 
e174bd3
c332cc2
6e59ca4
c332cc2
6e59ca4
e174bd3
 
 
 
 
 
 
 
 
 
139a78d
c332cc2
6e59ca4
e174bd3
 
 
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
#!/bin/bash
# Image CMD: make sure /workspace is fully populated, refresh workflows/,
# download_missing_models.sh, and README.md from the HF repo, then hand off
# to the stock RunPod /start.sh (SSH, Jupyter, nginx).
# v4: ComfyUI does NOT auto-start (start it manually with 'comfy' or
# python main.py). Set COMFY_AUTOSTART=true to re-enable the old behavior.
# v5: the boot refresh moved to refresh-workspace.sh and now also mirrors
# workflows/ from hf.co/aleph65/ComfyUI (WORKSPACE_REFRESH=false to skip).

/usr/local/bin/seed-workspace.sh || true
/usr/local/bin/refresh-workspace.sh || true

if [[ "${COMFY_AUTOSTART:-false}" == "true" ]]; then
    LOG=/workspace/comfyui.log
    [[ -d /workspace && -w /workspace ]] || LOG=/var/log/comfyui.log
    (
        while true; do
            /usr/local/bin/comfy >> "$LOG" 2>&1
            echo "[start-comfy] ComfyUI exited ($?), restarting in 5s..." >> "$LOG"
            sleep 5
        done
    ) &
    echo "ComfyUI starting in background (log: $LOG, port ${COMFY_PORT:-7865})"
    echo "Run 'download_missing_models.sh' to fetch models for your workflows."
else
    echo "ComfyUI not auto-started. Run 'comfy' (or cd /workspace/ComfyUI && python main.py --listen 0.0.0.0 --port ${COMFY_PORT:-7865} --enable-manager) to start it."
fi

exec /start.sh