AI Photo Restoration 2026: GFPGAN (38k Stars) vs CodeFormer - Bring Old Photos Back to Life, Free
Grandma's 1980s photo is blurry, scratched and faded. Paid restoration services charge per photo. Two open-source models restore faces and details locally and free - here is how they compare in 2026.
💡 What You Will Learn
Grandma's 1980s photo is blurry, scratched and faded. Paid restoration services charge per photo. Two open-source models restore faces and details locally and free - here is how they compare in 2026.
📜 Table of Contents
The short answer
The two open-source AI photo restoration models that matter in 2026 are GFPGAN (37,645 stars) - the practical face restoration workhorse - and CodeFormer (18,089 stars), which handles a wider range of degradations with a controllable fidelity knob. Both run locally, free, and restore old or damaged photos in seconds.
GFPGAN - the face specialist
- Purpose-built for restoring faces in old photos (blur, low-res, scratches).
- Practical API and pre-trained models for 1.x and 2.x.
- Simple usage:
pip install gfpgan
# or use the inference script
python inference_gfpgan.py -i inputs/ -o results/ -v 1.3
- Strong on faces; background and text get less attention.
CodeFormer - the all-rounder
- Handles faces, backgrounds, text, and complex degradation together.
- Key feature: a fidelity weight (w=0 to 1) - low w gives more dramatic restoration, high w stays closer to the original.
- From the NeurIPS 2022 paper "Towards Robust Blind Face Restoration with Codebook Lookup Transformer".
- Recommended CLI usage:
python inference_codeformer.py -w 0.5 --input_path inputs --output_path results
Practical comparison
| Aspect | GFPGAN | CodeFormer |
|---|---|---|
| Faces | Excellent | Excellent |
| Text/backgrounds | OK | Better |
| Control knob | Little | Fidelity weight |
| Speed | Fast | Fast |
Tips for best results
- Run face restoration first, then upscale with Real-ESRGAN (see our guide) for a full pipeline.
- For heavily damaged photos, try CodeFormer with w=0.3-0.5, then compare with w=0.7.
- Batch process old family albums - both tools handle folders.
FAQ
Are these really free? Yes - open source (CodeFormer has a non-commercial license; GFPGAN is for non-commercial use - check licenses for commercial work).
Do they work on non-face photos? GFPGAN focuses on faces; CodeFormer handles general restoration better.
Can they fix color? They improve clarity and details; color grading is often still needed manually.
Related
❓ FAQ
Are these really free?
Yes - open source (CodeFormer has a non-commercial license; GFPGAN is for non-commercial use - check licenses for commercial work).
Do they work on non-face photos?
GFPGAN focuses on faces; CodeFormer handles general restoration better.
Can they fix color?
They improve clarity and details; color grading is often still needed manually.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only โ no paid placements.
