#!/bin/bash
# Launch the ComfyUI backend (headless) for the Qwen-Image-Edit API on the A6000.
# CUDA / Ampere: none of the MI50 OOM workarounds are needed. The 46GB card holds
# the 20B Q8 model + encoder + reference latents resident, so we skip --lowvram and
# --use-split-cross-attention (both only existed to fit 32GB) -> faster.
set -e
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/env.sh"
cd "$COMFY"
source "$VENV/bin/activate"

# --highvram keeps weights pinned on-GPU between requests (we have the headroom).
exec python main.py \
    --listen 127.0.0.1 \
    --port 8188 \
    --highvram \
    "$@"
