mirror of
https://github.com/storytold/cloud-worker.git
synced 2026-10-09 00:09:43 +00:00
start-comfyui: nohup fallback when tmux unavailable; parameterize port-forward
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
#!/bin/bash
|
||||
# Start ComfyUI headless on the pod inside tmux, listening on 127.0.0.1:8188.
|
||||
# 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
|
||||
set -euo pipefail
|
||||
|
||||
SESSION=comfyui
|
||||
LOG=/workspace/minimax-h3/comfyui.log
|
||||
|
||||
if tmux has-session -t "$SESSION" 2>/dev/null; then
|
||||
echo "ComfyUI tmux session already running"
|
||||
if pgrep -f "python3? main.py" >/dev/null; then
|
||||
echo "ComfyUI already running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tmux new -s "$SESSION" -d \
|
||||
"cd /ComfyUI && python main.py --listen 127.0.0.1 --port 8188 2>&1 | tee -a $LOG"
|
||||
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"
|
||||
else
|
||||
cd /ComfyUI
|
||||
nohup python3 main.py --listen 127.0.0.1 --port 8188 >>"$LOG" 2>&1 &
|
||||
fi
|
||||
echo "started; tail $LOG"
|
||||
|
||||
Reference in New Issue
Block a user