Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

CodeFormer

github.com

  • Free plan
  • Windows
  • macOS
  • Web
  • API
  • Self-hosted
7.8 Club score Visit github.com

What CodeFormer is

CodeFormer is a free, open-source research method for restoring faces in old photographs and AI-generated images. It uses a learned discrete codebook and Transformer-based code prediction to reconstruct degraded faces. A controllable weight trades image quality against fidelity: lower values tend toward higher quality, while higher values tend toward greater fidelity. The project supports face restoration and whole-image enhancement, with optional Real-ESRGAN upsampling for faces and backgrounds. Separate tools colorize black-and-white or faded cropped faces and inpaint cropped faces marked with a white brush. Video inference accepts .mp4, .mov, and .avi files; Windows and Mac users are told to install ffmpeg first. Integrations include Stable Diffusion WebUI, ChaiNNer, and ComfyUI. Setup lists PyTorch 1.7.1 or later, CUDA 10.1 or later, Python 3.8 in the example, and packages in requirements.txt. The Replicate API cannot be used commercially.

Who it suits

It suits developers and researchers needing local, API, web, or self-hosted face restoration and enhancement. Users of the project’s dataset or paper are asked to cite the work.

Good to know, and what to watch

  • Restores faces from degraded images
  • Offers quality-versus-fidelity control
  • Supports whole-image enhancement
  • Includes colorization and inpainting
  • Accepts common video formats
  • Whole-image fusion may damage hair texture
  • Replicate API cannot be used commercially
  • Requires PyTorch and CUDA setup
  • Third-party services are unaffiliated

The verdict

CodeFormer combines face restoration with enhancement, colorization, inpainting, and video support. It offers flexible deployment routes, but technical setup, licensing, and the documented hair-boundary limitation matter for project planning.

What the maker publishes

Additional tools
It includes face colorization for black-and-white or faded cropped faces and face inpainting for cropped faces masked with a white brush. source
API restriction
The Replicate model page says its CodeFormer API cannot be used commercially. source
Colorization and inpainting
Separate scripts provide colorization and inpainting for cropped and aligned face images. source
Image enhancement
The project supports face restoration and whole-image enhancement, with optional Real-ESRGAN upsampling for faces and backgrounds. source
Integrations
The project lists Stable Diffusion WebUI, ChaiNNer, and ComfyUI among integrations, and identifies Hugging Face, Replicate, and OpenXLab demos as author-maintained deployments. source
Intended users
The project page presents CodeFormer as a research method and asks users who use its dataset or paper to cite the work. source
Intended users
The project page presents CodeFormer as a face-restoration method and provides code and a demo for researchers and other users working with degraded face images. source
Known limitation
For whole-image processing, the face-background fusion step may damage hair texture at the boundary, according to the repository's comparison note. source
License
The project uses the NTU S-Lab License 1.0, and the Replicate model page says redistribution and use for non-commercial purposes should follow that license. source
License
The project uses the NTU S-Lab License 1.0, and the repository says redistribution and use should follow that license. source
Local requirements
The installation instructions list PyTorch 1.7.1 or later, CUDA 10.1 or later, and additional packages in requirements.txt. source
Official demos
The authors identify their Hugging Face Space, Replicate, and OpenXLab demos as official deployments they maintain. source
Purpose
CodeFormer is a robust blind face restoration method designed to restore faces in old photos and AI-generated images. source
Purpose
CodeFormer is a Transformer-based method for blind face restoration that predicts codes from low-quality face images. source
Quality and fidelity control
A scalar weight lets users trade image quality against fidelity, with smaller values tending toward higher quality and larger values toward higher fidelity. source
Quality control
A controllable weight trades image quality against fidelity, with lower values tending toward higher quality and higher values toward higher fidelity. source
Requirements
The README lists PyTorch 1.7.1 or later, CUDA 10.1 or later, Python 3.8 in its setup example, and other packages in requirements.txt. source
Restoration method
It uses a learned discrete codebook and Transformer-based code prediction to restore faces from degraded inputs. source
Security and compliance
The opened project and demo pages do not state security certifications or compliance standards. source
Support
The project README provides [email protected] for questions. source
Support
The repository directs questions to [email protected]. source
Third-party integrations
The repository lists integrations including Stable Diffusion WebUI and chaiNNer, and warns that other listed demos and services are third-party. source
Third-party services
The README identifies other listed demos, APIs, apps, websites, and integrations as third-party and unaffiliated with the authors. source
Video
The inference script accepts video input, with documented support for .mp4, .mov, and .avi files. source

Checked against the maker's pages on 11 Oct 2026.