Backend service for the NUS MSBA Capstone project: Personalized Wedding
Photo Generation Using Generative AI.
Built with Flask (Python), integrating Stable Diffusion,
IP-Adapter FaceID, InsightFace, and BLIP.
# Create virtual environment (optional)
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Run development server
python server.pyServer runs at http://localhost:5000.
app/ # Application layer
│ ├── photo_generator.py # Photo generation workflow
│ └── server.py # Flask service entry
ip_adapter/ # IP-Adapter core modules
models/ # Model weights & configs
public/ # Generated outputs
uploaded/ # User-uploaded files
-
POST /upload
Upload face and background images. -
POST /prepare
Extract identity embeddings, analyse background. -
POST /generate
Generate personalized wedding photo.
- Face Embedding Extraction: Powered by InsightFace\
- Background Harmonisation: BLIP caption + INR-Harmonization\
- Identity Preservation: IP-Adapter FaceID\
- Generation Pipeline: Stable Diffusion (Realistic Vision) + VAE\
- Modular Design: Preprocessing, prompt construction, and generation are independent
