Use code RESTORE40 for 40% off all pricing.Limited time launch offer.

What Is GFPGAN?

GFPGAN (Generative Facial Prior GAN) is an open-source AI model developed by Tencent ARC that restores faces in old, blurry, and damaged photographs. Published at CVPR 2021, it has become one of the most widely used face restoration models, powering tools like Magic Memory.

How GFPGAN Works

GFPGAN combines a degradation removal module with a pre-trained face generation model (StyleGAN2). The key innovation is using the rich facial details stored in the pre-trained generator as "facial priors" — reference knowledge of what high-quality faces look like.

The architecture works in three stages:

  • 1. Face detection and alignment — The model locates faces in the input image and aligns them to a standard position for processing
  • 2. Feature extraction and restoration — A U-Net encoder extracts features from the degraded face, then channel-split spatial feature transforms (CS-SFT) modulate the pre-trained generator to produce a restored face that preserves the original identity
  • 3. Blending — The restored face is pasted back into the original image, blending seamlessly with the surrounding context

What GFPGAN Can Fix

Works well on

  • - Blurry or out-of-focus faces
  • - Low-resolution scanned photos
  • - Faded or discolored portraits
  • - Noisy or grainy face photos
  • - JPEG compression artifacts on faces

Limited effectiveness on

  • - Faces completely hidden by tears or damage
  • - Extreme profile angles (side views)
  • - Very small faces in group photos
  • - Non-face elements (backgrounds, objects)
  • - Cartoon or illustrated faces

GFPGAN vs CodeFormer

CodeFormer, published at NeurIPS 2022, is the other major face restoration model. Both produce high-quality results, but they differ in approach:

GFPGANCodeFormer
ApproachGAN with facial priorsTransformer codebook lookup
SharpnessTends to be sharperSlightly softer by default
Fidelity controlFixed outputAdjustable fidelity slider
PublishedCVPR 2021NeurIPS 2022

Technical Requirements

Running GFPGAN locally requires Python 3.7+, PyTorch 1.7+, and a CUDA-compatible GPU with at least 4GB VRAM. The model weights are approximately 330MB. For users without the technical setup, hosted services provide the same restoration through a web interface.

Magic Memory hosts GFPGAN as a cloud service, so you can restore photos from any device with a browser — no installation, GPU, or Python knowledge required. Processing takes 5-15 seconds per photo.

Try GFPGAN Without Setup

Magic Memory runs GFPGAN in the cloud so you can restore photos from any device. Upload a photo, get a restored version in under 15 seconds. 1 free restoration per day, no credit card required.

Restore a photo now

Frequently Asked Questions

What does GFPGAN stand for?

GFPGAN stands for Generative Facial Prior Generative Adversarial Network. It is an AI model that uses pre-trained face generation models (facial priors) as a reference to restore degraded faces in photographs. It was developed by Tencent ARC and published at CVPR 2021.

Is GFPGAN free to use?

GFPGAN is open-source software released under a BSD-style license. You can run it yourself if you have the technical setup (Python, PyTorch, a compatible GPU). Alternatively, services like Magic Memory provide a hosted version where you can use GFPGAN through a web interface with 1 free restoration per day.

How is GFPGAN different from CodeFormer?

Both GFPGAN and CodeFormer restore faces, but they use different approaches. GFPGAN uses channel-split spatial feature transforms with generative facial priors. CodeFormer uses a transformer-based codebook lookup approach. GFPGAN tends to produce sharper results, while CodeFormer offers a fidelity-quality slider for more control. Both are effective for portrait restoration.

Can GFPGAN restore non-face parts of a photo?

GFPGAN is specifically designed for face restoration. It detects faces in a photo, restores them, and blends them back into the original image. The background and non-face elements remain as they were in the original. For full-image enhancement, you would need additional models for super-resolution or denoising.

Ready to restore your memories?

Start with your free daily restoration. No credit card required.