ComfyUI / docker /start-comfy.sh
aleph65's picture
docker v5: boot refresh mirrors workflows/ from the repo (refresh-workspace.sh), claude alias (IS_SANDBOX=1 --dangerously-skip-permissions); document interim v4 (no auto-start, script refresh)
6e59ca4 verified
Raw
History Blame Contribute Delete
1.3 kB
#!/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