Minimal app to upload room photos and batch-generate floor replacements across pre-saved floor references using Google Gemini.
- Create a Python venv.
- Install deps:
pip install -r requirements.txt- Export your API key:
export GEMINI_API_KEY=YOUR_KEYuvicorn server:app --reload --host 0.0.0.0 --port 8000Health check: GET http://localhost:8000/api/health
Generate endpoint (multipart):
curl -X POST \
-F "room_image=@/absolute/path/to/room.jpg" \
-F "reference_path=/Users/tedwalsh/Desktop/research_2025_summer/tedtodd-nana-bananna/tedtodd-photo-bank/Apian.jpg" \
http://localhost:8000/api/generate-floorResponse:
{ "output_paths": ["/outputs/room__Apian_0.png"] }Open in browser: http://localhost:8000/outputs/room__Apian_0.png
streamlit run app_frontend.pyPlace floor references in data/tedtodd_static_shots/ (png/jpg/webp). Upload room photo(s) and optionally a binary mask image of the floor.
- Streamlit frontend posts to FastAPI and renders results.
- Uses
floor_replace/generator.pywrapper around the Gemini client. - Default model:
gemini-2.5-flash-image-preview. - Streams image results and shows downloads per floor.
- Large assets are not committed. Place your local images under
tedtodd-photo-bank/anddata/.