Dev.to AI 🤖 Ai 👁 0 📖 5 min read

I built an AI "future baby" portrait generator as a side project — here's the whole pipeline

I run a small site called FutureBabyFace. You upload one photo of each parent, pick a gender (or surprise) and an age stage, and about three minutes later you get a lifelike portrait of what your kid might look like — pl

I run a small site called FutureBabyFace. You upload one photo of each parent, pick a gender (or surprise) and an age stage, and about three minutes later you get a lifelike portrait of what your kid might look like — plus, if you want it, a set of die-cut chat stickers of the same child.

It started as one of those "how hard can it be?" weekend questions and turned into a proper product. This post is the build log I wish I had found before starting: what the pipeline actually does, the privacy defaults I picked and why, and the things it will never be able to do — because a lot of AI baby tools are vague about exactly that part.

Disclosure so we're clear from the start: I'm the developer, and links below go to my own product. Judge the post accordingly.

The input is the product

The single biggest quality lever turned out to be the photos people upload, not the model settings. Two daylight, front-facing photos beat ten mediocre ones every single time. So the UX spends a lot of its energy on input coaching: light direction, glasses, filters, hair covering the jaw.

That was a cheap lesson, but I had to learn it the slow way — the first iteration generated technically-fine portraits from technically-fine photos that no model can use well: hard overhead light, sunglasses on the head, a face at 30 degrees from the camera.

If you're curious about what a face model can and cannot infer from two photos, I wrote a longer plain-English piece about exactly that on the site's blog: How AI "predicts" a baby face. Short version: it measures the features that carry visual identity (jawline, eye spacing, nose bridge, lip fullness, skin tone, hair), blends them with a weighted average that shifts between the parents, then re-projects the blend back into a realistic photograph with lighting and texture. The result is different every time you change an input — because the blend genuinely changes.

What it can never do

A child's actual appearance is decided by which of each parent's two gene copies get passed on — thousands of coin flips, plus mutation. No photograph contains that information, so no model can recover it. Every tool in this category that markets itself as a "prediction" is lying to you, and honestly, most users know it. What they want is the emotional version: a keepsake that says "this is us, continued."

So the site says it everywhere: the output is a creative visualization, not a genetic prediction. Saying it clearly costs nothing and buys the user's trust — the fastest way to lose a family audience is to imply you know something you can't know.

The stack (boring on purpose)

  • TanStack Start (React 19, Vite, nitro) — file-based routing, server functions for anything sensitive, no client-side business logic.
  • TanStack Query + a typed API client on the front end; TanStack Form + zod for the upload and checkout flows.
  • Drizzle ORM on SQLite in production (single node, one file to back up; the multi-dialect setup is there if I ever need Postgres).
  • better-auth for accounts, Creem for payments (merchant of record — handles VAT and the card flow so I don't have to), Cloudflare R2 for image storage behind short-lived signed URLs.
  • Paraglide JS for i18n, and a hosted image model (Seedream via Volces Ark) behind a small provider abstraction so the prompts stay portable.

One pattern worth stealing if you build anything with money or credits on a SQLite-family database (local file, Turso, or Cloudflare D1): none of them give you interactive transactions, and on D1 db.transaction() is literally just sequential statements — a crash halfway leaves you with a paid order and no credits. I ended up with a small atomic() helper that assembles every multi-step write as a batch() with precondition guards, and falls back to a real transaction on Postgres. Concurrency bugs in payment flows are not fun to debug from logs; the guard-as-code approach removed most of them.

Privacy defaults I refuse to soften

This product asks people for the two things they care most about: their faces and their future child's face. That deserves more than a privacy-policy shrug, so the defaults are:

  • Uploads are deleted within 24 hours after the portrait is ready.
  • Generated results are kept 30 days, then go.
  • Nothing is sold, shared, or used to train anything — the images go to the image model as a one-off job and that's it.

I have no idea whether this costs me engagement metrics. Users ask about it constantly, though — usually as the very first question — and "your photos are gone in a day" is an answer I'm happy to give.

Stickers: the accidental best feature

The stickers started as a gimmick and became a third of the product's personality. The portrait gets re-imagined as 4–6 die-cut stickers — 512×512 px transparent WebP, one of 12 art styles auto-assigned per set — sized for WhatsApp, Telegram, and iMessage sticker packs.

Two things I got wrong first: transparent edges need an actual alpha-aware cutout pass (resizing a rectangular render onto white looks terrible the moment it's on a chat bubble), and 512×512 with a ≤100 KB budget is a real constraint, not a formality — the WhatsApp sticker spec is strict, and you design the export pipeline around it.

What I'd tell someone starting the same project

  1. Nail the input before touching the model. Half the "the AI looks wrong" feedback is actually "the photo was unusable."
  2. Say what it isn't, out loud. "Not a prediction, a keepsake" is the whole trust strategy.
  3. Make privacy a default, not a setting. Nobody ever asked me to keep their face longer; lots of people asked if it leaves.
  4. Keep the boring stack boring. Everything novel I tried made the system slower to change.

Try it or tear it apart: the generator is at futurebabyface.com, the photo checklist is here, and the deep-dive on what these models actually do with two faces is this one. Questions about the pipeline welcome in the comments — happy to go deeper on the storage or the D1 batching bits if there's interest.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.