#!/usr/bin/env bash # Lanza el backend FastAPI reutilizando el venv del analysis (mismas deps: # torch + diffusers + transformers + trimesh + Pillow). No crea venv propio. set -euo pipefail ROOT="$(cd "$(dirname "$0")"/../../../../.. && pwd)" VENV="$ROOT/projects/imagegen/analysis/spike_image_to_3d/.venv" HERE="$(cd "$(dirname "$0")" && pwd)" if [ ! -x "$VENV/bin/python" ]; then echo "venv del analysis no existe: $VENV" >&2 echo "Crea el analysis primero: ./fn run init_jupyter_analysis --project imagegen spike_image_to_3d" >&2 exit 1 fi export FN_REGISTRY_ROOT="$ROOT" exec "$VENV/bin/python" -m uvicorn server:app \ --host 127.0.0.1 --port "${PORT:-8600}" \ --app-dir "$HERE" \ "$@"