DEV Community

tony huang
tony huang

Posted on

What it costs to run an AI baby-photo generator: ~4¢ an image, and an honest promise

I build small browser-first tools. One of them, OurBaby, answers the oldest question couples ask — what will our baby look like? — by blending one photo of each parent into an imagined baby portrait.

Two questions come up from other developers every time I describe it, so here are both answers with real numbers.

The unit economics (real numbers, October 2026)

Generation runs on a multi-image model of the "nano-banana" class via fal.ai. The actual billed cost per image, from my fal usage export:

  • $0.0398 per generated image (identity-blending edit, two reference photos)
  • Same engine for every scene — studio, Christmas, beach, family-of-three

So the math is simple: a $2.99 pack of 5 photos is ~80%+ gross margin, and the free tier is a bounded acquisition cost rather than a leak. The free tier is deliberately small and capped three ways:

  1. 1 free preview per visitor IP per day
  2. a per-site daily spend circuit breaker (cost-estimate accumulation in KV)
  3. no API key in the deployment → the endpoint returns a waitlist 503 instead of ever going bare

That last one matters. An earlier project of mine shipped an AI endpoint without a daily cap and someone found it within hours — the cap is the difference between a marketing cost and an incident.

The pipeline, in one paragraph

Photos never touch my servers as files: the browser downscales each to a 768px JPEG, sends them as data URIs, and a Cloudflare Pages Function makes a single queued call to the model with both references. The interesting part is not the plumbing, it's the prompt: the model is told to inherit specific features (eye color and shape, nose, smile, hair color and texture, skin tone) from both references, rather than averaging two faces — averaging is why first-generation "baby generators" produced children that looked like nobody.

The part every "baby predictor" gets wrong

Here's where I have to argue against my own product category. A baby's face cannot be predicted — by my tool or any other. Appearance is polygenic: eye color alone involves several genes (the OCA2/HERC2 region does most of the work, not all of it), and each parent passes on one of two copies of every gene. The recombination is random. Even two full genomes don't compute a face.

What a good generator can honestly claim is fidelity to the parents — the imagined child should visibly inherit from both of you — not prediction of the child. So the copy on the site says exactly that: the result is a fictional, imagined person, and the page even explains why prediction is impossible. It turns out that honesty is also good SEO: it's the question people actually type.

Privacy structure, since your users' faces are your users

  • Photos go encrypted to the model provider only to generate the image
  • No gallery, no public results wall — if you show other people's uploads, assume yours joins them
  • The generated images live on the provider's temporary storage, not in my database

If you're building anything that eats faces (headshots, restorations, family photos), I'd treat this as the baseline, not a feature.

What I'd tell you before you build in this space

  • Bound your free tier with per-IP and global daily caps on day one
  • Label outputs as fictional — it's the difference between a keepsake and a scam
  • Put the honest limit in the title of your main content page; being straight about what AI can't do outperforms promising predictions

If you want to see the result, the generator is at ourbaby.shop — first preview free, no signup, and the free tier is documented in plain numbers.

Top comments (1)

Collapse
 
aifliproom profile image
AI Flip Room •

Love that you published the real per-image number. We run the same nano-banana class for room restyling, and the line that surprised us wasn't the render, it was checking it: a vision pass on every output to catch melted windows or a door that moved, plus the retries it triggers, adds roughly a quarter on top of the render cost. Do you QA outputs automatically, or does the free preview act as the check?