All Projects
Lifebuoy FANFEST — Player Pack AI Photobooth
07fd3303d-f29d-44cf-9251-916d6c7e4d32AI/ML · Generative AI

Lifebuoy FANFEST — Player Pack AI Photobooth

Python · Flask · waitress · Google Gemini API · rembg (isnet/birefnet) · OpenCV · Postman

PythonPythonFlaskFlaskGoogle GeminiGoogle GeminiOpenCVOpenCVPostmanPostman

Problem

A high-volume brand activation (10k+ people across a few booths over a day) needed an AI photobooth that dresses a fan in a chosen jersey and drops them into a branded Player Pack frame — without overloading Gemini's rate limits or hanging the booths.

Solution

Built a Flask service with an async pipeline: upload + jersey index → Gemini dresses the person → rembg cutout composited on a themed background → fit into the transparent window of the matching Player Pack frame → return the finished image. Generation is asynchronous — /generate returns a job_id instantly and booths poll /status/<id> (queued → generating → removing_background → framing → done), with queue_ahead so a fan sees "you're #3 in line". The background-removal model loads once at startup, frames are cached/downscaled per size, and uploads are capped to 1280px. The prompt keeps a hijab/headscarf and modest outfit when the person wears one. Includes an admin dashboard to review and delete generated packs.

Impact

Built for event scale with a bounded worker pool, multi-key Gemini rotation across separate projects, per-call failover on 429/504, model fallback (gemini-3.1-flash-image → gemini-2.5-flash-image), and persisted job state so a mid-event restart never loses completed work. Load is shed gracefully with a friendly 503 instead of a crash.

AI photoboothGoogle Geminibrand activation AIasync job queuerembg background removalFlask waitressevent scale AImulti-key rotationgenerative AI engineerjersey try-onPlayer Pack frame
Chat on WhatsApp