diff --git a/demo/realtime-img2img/requirements.txt b/demo/realtime-img2img/requirements.txt index 7f77e46..6ef2ac7 100644 --- a/demo/realtime-img2img/requirements.txt +++ b/demo/realtime-img2img/requirements.txt @@ -1,5 +1,8 @@ diffusers==0.33.1 -transformers==4.35.2 +# transformers 4.35.2 is incompatible with diffusers 0.33.1: diffusers' IP-Adapter +# loader imports SiglipImageProcessor, which only exists in transformers >= 4.45. +# 4.49.0 is verified working with this stack on macOS (Apple Silicon / MPS). +transformers==4.49.0 --pre torch torchvision diff --git a/demo/realtime-img2img/start_mac.sh b/demo/realtime-img2img/start_mac.sh new file mode 100755 index 0000000..3a60333 --- /dev/null +++ b/demo/realtime-img2img/start_mac.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Launch StreamDiffusion realtime img2img on macOS (Apple Silicon / MPS). +# +# Differs from run_mac.sh: it does NOT edit main.py in place, and it lets you +# opt into fully-offline model loading (use only locally-cached weights) by +# exporting HF_HUB_OFFLINE=1 before running. +# +# Open http://localhost:7860 once it prints "Uvicorn running". +set -e +cd "$(dirname "$0")" + +# Free port 7860 if a previous run is still listening. +lsof -ti:7860 | xargs kill -9 2>/dev/null || true + +# Make the repo's `streamdiffusion` importable without installing. +export PYTHONPATH="$(cd ../.. && pwd):${PYTHONPATH:-}" + +exec python main.py --taesd --acceleration none --debug