Skip to content

Rizzo-AI-Academy/StyleTwin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StyleTwin

Your AI personal stylist. Upload a portrait and receive a luxury personal styling report (color season, hairstyle, outfit, accessory recommendations) generated by gpt-image-2.

Photo → gpt-image-2 (identity-preserving image edit) → Final styling report image

The portrait is sent directly to gpt-image-2 as the identity reference. The model derives the color analysis and produces the styling report in a single pass — no intermediate JSON.

Stack

  • Backend: Python + FastAPI, OpenAI SDK
  • Frontend: Vite + React + TypeScript
  • Model: gpt-image-2-2026-04-21

Project layout

backend/        FastAPI app, prompts, OpenAI service
frontend/       Vite React UI

Setup

1. Backend

cd backend
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate

pip install -r requirements.txt
cp .env.example .env
# edit .env and set OPENAI_API_KEY
python run.py

The API listens on http://localhost:8000.

2. Frontend

cd frontend
npm install
npm run dev

The UI runs on http://localhost:5173 and proxies /api/* to the backend.

API

Method Path Purpose
GET /api/health Health + configured model + report types
POST /api/report Multipart portrait + report_type{ image_b64 }

Report types

full_report, color_analysis, hairstyle_woman, hairstyle_man, outfit_woman, outfit_man, accessories, before_after.

Prompts live in backend/app/prompts.py.

Configuration

Backend .env variables (see backend/.env.example):

Var Default Notes
OPENAI_API_KEY Required
OPENAI_IMAGE_MODEL gpt-image-2-2026-04-21 Image generation model
CORS_ORIGINS http://localhost:5173,http://127.0.0.1:5173 Comma-separated
MAX_UPLOAD_MB 10 Upload size cap

Notes

  • Identity preservation is enforced inside every prompt template; the model receives the uploaded image via images.edit so the face is kept as-is.
  • Generation cost and latency scale with quality and size. high + 1024x1536 is the best-looking default; switch to medium while iterating.

About

Webapp

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors