This project satisfies the requirements:
- Upload a headshot
- Identify closest dog breed
- Generate 2 transition images + final dog image (3 generated images total)
- Show images in the UI, generated concurrently using multithreading
- User registration/login with encrypted credentials (bcrypt hashes)
- Store user credentials + generated images in a database
- Each user can only see their own images
- Create a virtualenv and install deps:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Create
.env:
cp .env.example .env
# then edit:
# OPENAI_API_KEY=...
# SECRET_KEY=...- Run:
uvicorn app.main:app --reloadpython -m app.smoketestCreate:
- A Web Service for this repo
- A PostgreSQL instance
Set env vars on the web service:
OPENAI_API_KEYSECRET_KEY(any long random string)DATABASE_URL(Render provides this for Postgres)VISION_MODEL(optional, default:gpt-4.1-mini)IMAGE_MODEL(optional, default:gpt-image-1.5; fallback todall-e-2on errors)
Build command:
pip install -r requirements.txtStart command:
uvicorn app.main:app --host 0.0.0.0 --port $PORTIn Render service settings: add shaggydog.<yourdomain> as a custom domain.
Then add a CNAME DNS record for shaggydog pointing to your service’s *.onrender.com hostname.
Render automatically provisions TLS (HTTPS) after verification.
The app prefers GPT Image (gpt-image-1.5) for higher quality. Some orgs may need verification to use GPT Image models.
If the call fails, the app automatically falls back to dall-e-2 edits (works but lower quality and requires square PNG input).