Skip to content

Commit

Permalink
base update
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Oct 14, 2023
1 parent 1a6d575 commit ede3e37
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions build/COPY_ROOT/opt/ai-dock/bin/supervisor-comfyui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

trap cleanup EXIT

LISTEN_PORT=1818
METRICS_PORT=1918
LISTEN_PORT=18188
METRICS_PORT=28188
PROXY_SECURE=true

function cleanup() {
Expand All @@ -18,17 +18,17 @@ fi
PROXY_PORT=$COMFYUI_PORT
SERVICE_NAME="ComfyUI"

file_content=$(
file_content="$(
jq --null-input \
--arg listen_port "${LISTEN_PORT}" \
--arg metrics_port "${METRICS_PORT}" \
--arg proxy_port "${PROXY_PORT}" \
--arg proxy_secure "${PROXY_SECURE,,}" \
--arg service_name "${SERVICE_NAME}" \
'$ARGS.named'
)
)"

printf "%s" $file_content > /run/http_ports/$PROXY_PORT
printf "%s" "$file_content" > /run/http_ports/$PROXY_PORT

PLATFORM_FLAGS=""
if [[ $XPU_TARGET = "CPU" ]]; then
Expand All @@ -39,6 +39,8 @@ BASE_FLAGS="--listen 127.0.0.1 --port ${LISTEN_PORT} --disable-auto-launch"

# Delay launch until micromamba is ready
if [[ -f /run/workspace_moving || -f /run/provisioning_script ]]; then
kill -9 $(lsof -t -i:$LISTEN_PORT) > /dev/null 2>&1 &
wait -n
/usr/bin/python3 /opt/ai-dock/fastapi/logviewer/main.py \
-p $LISTEN_PORT \
-r 5 \
Expand All @@ -58,10 +60,9 @@ else
printf "Starting %s...\n" ${SERVICE_NAME}
fi

cd /opt/ComfyUI
kill -9 $(lsof -t -i:$LISTEN_PORT) > /dev/null 2>&1 &
wait -n

cd /opt/ComfyUI
micromamba run -n comfyui python main.py \
${PLATFORM_FLAGS} \
${BASE_FLAGS} \
Expand Down

0 comments on commit ede3e37

Please sign in to comment.