From 427f2878c4776761b1abb6ea732bea513a41f267 Mon Sep 17 00:00:00 2001 From: Hanashi Date: Thu, 6 Aug 2026 03:31:45 -0400 Subject: [PATCH] start-comfyui: per-host logs (shared volumes!), COMFY_ARGS passthrough Co-Authored-By: Claude Fable 5 --- scripts/pod/start-comfyui.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/pod/start-comfyui.sh b/scripts/pod/start-comfyui.sh index 2d9aa25..0e4918b 100755 --- a/scripts/pod/start-comfyui.sh +++ b/scripts/pod/start-comfyui.sh @@ -1,26 +1,29 @@ #!/bin/bash # Start ComfyUI headless on the pod, listening on 127.0.0.1:8188. # Uses tmux when available (attachable session), else nohup. -# Access from your laptop via scripts/local/port-forward.sh +# Log is per-host: pods sharing a network volume must not share log files. +# Extra launch flags via COMFY_ARGS, e.g.: +# COMFY_ARGS="--reserve-vram 2.5" bash start-comfyui.sh # 24GB cards set -euo pipefail -LOG=/workspace/minimax-h3/comfyui.log +LOG=/workspace/minimax-h3/comfyui-$(hostname).log +ARGS=${COMFY_ARGS:-} # wait out any process that is mid-shutdown before deciding it's "running" for i in 1 2 3 4 5; do - pgrep -f "python3? main.py" >/dev/null || break + pgrep -f "python3? main[.]py" >/dev/null || break sleep 2 done -if pgrep -f "python3? main.py" >/dev/null; then +if pgrep -f "python3? main[.]py" >/dev/null; then echo "ComfyUI already running" exit 0 fi if command -v tmux >/dev/null; then tmux new -s comfyui -d \ - "cd /ComfyUI && python3 main.py --listen 127.0.0.1 --port 8188 2>&1 | tee -a $LOG" + "cd /ComfyUI && python3 main.py --listen 127.0.0.1 --port 8188 $ARGS 2>&1 | tee -a $LOG" else cd /ComfyUI - nohup python3 main.py --listen 127.0.0.1 --port 8188 >>"$LOG" 2>&1 & + nohup python3 main.py --listen 127.0.0.1 --port 8188 $ARGS >>"$LOG" 2>&1 & fi echo "started; tail $LOG"