A Cloudflare Python Worker that turns photos into delightfully terrible MS Paint-style drawings using OpenAI's GPT-Image-2 via AI Gateway.
Built for events! Multiple events can be configured via Workers KV without code changes.
- Upload — Take a photo on your phone via the capture page
- Process — A durable Python Workflow sends your photo to GPT-Image-2 with a delightfully unhinged prompt
- Display — The presenter screen shows a live slideshow of before/after pairs
- Python Worker (
src/worker.py) — FastAPI app on Pyodide/WASM handling uploads and serving static assets - Workflow (
src/workflow.py) — Durable DAG-based execution for image generation - Frontend (
assets/) — Presenter screen, mobile capture, admin gallery - Storage — R2 for images, KV for per-event config, AI Gateway for image generation
Set up a new event without deploying:
npx wrangler kv key put <event-slug> '{"title":"My Event","additionalInstructions":"Add a logo in the corner"}' --binding=CONFIG --remoteThen visit:
- Presenter:
https://mspaintify.<user>.workers.dev/?event=<event-slug> - Capture:
https://mspaintify.<user>.workers.dev/capture.html?event=<event-slug>
- Python Workers Documentation
- Cloudflare Python Workers Examples
- Pyodide — Python in the browser (and in Workers!)
- Workflows Python
- AI Gateway — GPT-Image-2
- Workers KV
- Cloudflare R2