Ana Brainiall

Restore old family photos with AI

intermediario · 10 min · Por Ana Brainiall

The specific problem of faces in old photos

Old photos have damage of various kinds: scratches, yellowing, low resolution, blurring, aggressive compression. Generic upscale algorithms can clean up a lot of things — but they fail on faces. Why? Because faces are the region where our brain is most sensitive to imperfections. A blurry spot on a wall you barely notice. A blurry spot on a cheek ruins the entire photo.

GFPGAN (Generative Facial Prior GAN) was created specifically for this. It combines two networks: an encoder that extracts the facial structure from the damaged image (even if heavily degraded) and a StyleGAN generator trained on millions of real faces, which reconstructs the details.

uma foto de família antiga em sépia com rasgos e manchas, com destaque nos rosto

How the facial prior works

Facial prior" is the statistical information the model has about how human faces "should" look. StyleGAN was trained on the FFHQ dataset (70,000 high-resolution faces), learning the relationship between:

When you pass a degraded photo, GFPGAN first makes a rough estimate ("this is an elderly woman's face, probably white, brown eyes, gray hair"), then uses StyleGAN to fill in the details consistent with that estimate.

diagrama mostrando o pipeline — input danificado → encoder extrai features → Sty

The ethical problem: fidelity vs credibility

Here lies the most sensitive point of AI restoration: the restored photo is not exactly the person who was there. The model hallucinates details that seem plausible for a generic face compatible with the observed damage — but it may get wrong the precise shape of the nose, the exact color of the eyes, the teeth.

For family use this is generally OK — the overall appearance is correct, and no one will forensically compare it with an original that was already destroyed. But in contexts where fidelity is critical (legal identification, historical journalism), you should show the restored photo alongside the original, not replace the original.

Best practices for better results

diagrama visual das 4 boas práticas em forma de ícone + título — scan alto, crop

Limits where GFPGAN fails

Test it right now

Send an old scanned photo in the Brainiall chat and ask "restore the faces in this photo while keeping the color and context". The pipeline combines facial detection + GFPGAN + reintegration automatically. The Pro Plan $5.99 processes up to 100 restorations/month.

API Integration

Beyond the chat, use the REST API to integrate into your app. Bearer token auth (get yours at app.brainiall.com).

curl -X POST https://chat.brainiall.com/api/images/restore-face \
  -H "Authorization: Bearer $BRAINIALL_KEY" \
  -F "image=@old_photo.jpg" \
  -o restored.png
import requests, os
r = requests.post("https://chat.brainiall.com/api/images/restore-face",
    files={"image": open("old_photo.jpg", "rb")},
    headers={"Authorization": f"Bearer {os.environ["BRAINIALL_KEY"]}"} )
open("restored.png", "wb").write(r.content)

Enjoyed this course?

Unlock 17 Pro courses + 40+ AIs in chat + video, music and full Studio generation.

Go Pro · $5.99/mo

Cancel anytime · No commitment