#!/bin/bash # Launch the FastAPI edit service (talks to the local ComfyUI on :8188). set -e # env.sh resolves API_DIR/VENV (and keeps the venv off NTFS). source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/env.sh" source "$VENV/bin/activate" cd "$API_DIR" export COMFY_URL="http://127.0.0.1:8188" export HOST="0.0.0.0" export PORT="8500" # Output pixel budget. MI50 is compute-bound on this 20B model: # ~0.59MP -> ~110s ~0.79MP -> ~140s ~1.0MP -> ~180s (4 steps) # 0.79MP is a sane speed/quality default; raise for bigger output. # Lowered to 0.65MP to help prevent GPU OOM on MI50. export MAX_AREA="${MAX_AREA:-655360}" exec python edit_api.py