#!/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