Favicon of GFPGAN

GFPGAN

An open-source AI face restoration tool that runs locally with Python and PyTorch, supports NVIDIA GPUs, and pairs with Real-ESRGAN for backgrounds.

GFPGAN is an open-source AI face restoration tool for people repairing poor-quality photos and developers adding restoration to image workflows. It runs locally with Python and PyTorch, with Linux support and optional NVIDIA GPU acceleration through CUDA. Its face models use knowledge learned by a pretrained generative model such as StyleGAN2 to reconstruct facial detail.

The focus is faces. GFPGAN accepts whole images as well as prepared face crops, can process folders of photos, and supports image upscaling. For photos that need work beyond the face, it can use Real-ESRGAN to enhance the background and other non-face regions. RestoreFormer inference is also included.

The available models make different tradeoffs between sharpness, natural appearance and preservation of a person's identity. Some produce sharper faces but can look unnatural; others favor more natural results but may slightly change identity. There are models with and without face colorization, and a clean implementation that doesn't require custom CUDA extensions. Those differences matter when choosing a model for a particular photo, especially if retaining someone's likeness is the priority.

GFPGAN uses the Apache 2.0 license and includes training code for developers who want to adapt the models. Local processing runs on your own hardware; browser demos through Hugging Face Spaces with Gradio and Google Colab provide hosted ways to try the restoration.

Similar to GFPGAN