Back to articles
How I Built an AI Birthday Photo Generator with Cloudflare Workers, Gemini 2.5 Flash, and FLUX.2 Pro

How I Built an AI Birthday Photo Generator with Cloudflare Workers, Gemini 2.5 Flash, and FLUX.2 Pro

via Dev.to田WB

TL;DR : Upload a selfie → Gemini analyzes the photo and writes 3 birthday scene prompts → FLUX.2 Pro generates the images → Cloudflare R2 stores them. The whole backend runs on Cloudflare Workers with zero servers. I recently launched bdayphoto.com , an AI-powered birthday photo generator. Upload your photo and get 3 unique AI birthday celebration scenes in about 60 seconds. Here's how I built the whole thing on Cloudflare's serverless stack. The Stack Frontend : Next.js 15 (App Router) → static export → Cloudflare Pages Backend : Cloudflare Workers (TypeScript) Database : Cloudflare D1 (SQLite) Storage : Cloudflare R2 Cache : Cloudflare KV (sessions) Queue : Cloudflare Queues AI : Gemini 2.5 Flash (via Replicate) + BFL FLUX.2 Pro Payment : PayPal Auth : Google OAuth The entire backend runs on a single Cloudflare Worker. No EC2, no containers, no ops headaches. The Core Pipeline The generation flow looks like this: User uploads photo ↓ Worker validates + deducts credits + enqueues job

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles