AI-driven 2D to 3D jewelry generation with real-time customization.
- Frontend: React + Three.js + Tailwind CSS
- Backend: Python + FastAPI
- AI Vision: Gemini Vision API (OpenAI-compatible endpoint)
- 3D Generation: InstantMesh (via command adapter)
- Version Control: GitHub
app/FastAPI backendfrontend/React app with Three.js vieweroutputs/generated previews and exported models
- Create virtual env and install deps:
pip install -r requirements.txt
- Copy env:
copy .env.example .env
- Set environment variables in
.env:GEMINI_API_KEYOPENAI_BASE_URL(defaulthttps://generativelanguage.googleapis.com/v1beta/openai/)VISION_MODEL(defaultgemini-2.0-flash)INSTANTMESH_CMD(optional, command with{input}and{output}placeholders)
- Run backend:
uvicorn app.main:app --reload
Backend runs at http://127.0.0.1:8000.
- Go to frontend:
cd frontend
- Install deps:
npm install
- Run:
npm run dev
Frontend runs at http://127.0.0.1:5173.
POST /api/generate(multipart image)POST /api/customize/{design_id}POST /api/export/{design_id}GET /health
POST /api/generate now follows this sequence:
- Save uploaded image in SQLite (
outputs/designs.db). - Fetch the saved image bytes from the database.
- Send fetched image to Gemini Vision (
VISION_MODEL) for structured analysis + detailed description. - Store Gemini outputs (
jewelry_type,components,notes,description) in SQLite. - Build 3D geometry using both image parsing and description-guided heuristics.
- Save generated preview/GLB paths back into SQLite.
The generate response includes a description field with Gemini's detailed jewelry description.
Set INSTANTMESH_CMD to your local command. Example:
python C:/path/to/instantmesh/infer.py --input {input} --output {output}
If InstantMesh command is not set or fails, backend uses local procedural fallback mesh generation so the demo remains runnable.
- First generation returns a pre-populated model (metal body + stones + settings + prongs).
- Customization updates materials/colors/gem type without full regeneration.
- Budget-aware suggestions are returned when estimate exceeds budget.
- Export supports both GLB and STL.
PPT LINK : https://drive.google.com/file/d/1P0Au7ySBqHy2ItmgNbARoMQaC5Av16ph/view?usp=drivesdk
video link : https://drive.google.com/file/d/1w2Nep3LGJwSBW0xxqyk-CWdfsgbRkLNI/view?usp=drivesdk