CodeFormer
CodeFormer is a free, open-source research method for restoring faces in old photos and AI-generated images.
What CodeFormer is
CodeFormer is a free, open-source research method for restoring faces in old photos and AI-generated images. It uses a learned discrete codebook and Transformer-based code prediction to reconstruct faces from degraded inputs. A controllable weight lets users trade 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 provide colorization for black-and-white or faded cropped faces and inpainting for cropped faces marked with a white brush. Its inference script accepts .mp4, .mov, and .avi clips; Windows and Mac users are instructed to install ffmpeg first. Setup requirements include PyTorch 1.7.1 or later, CUDA 10.1 or later, Python 3.8 in the setup example, and other packages in requirements.txt. Integrations include Stable Diffusion WebUI, ChaiNNer, and ComfyUI. The project uses the NTU S-Lab License 1.0, and the Replicate model page says its API cannot be used commercially. The project presents CodeFormer as a research method and asks users who use its dataset or paper to cite the work.
Good
- Supports face and whole-image enhancement.
- Weight setting balances image quality and fidelity.
- Includes colorization and face inpainting tools.
- Accepts .mp4, .mov, and .avi video.
Watch out
- Setup lists PyTorch and CUDA requirements.
- Windows and Mac video use requires ffmpeg.
- Replicate API use cannot be commercial.
Who it suits
CodeFormer may suit developers and researchers seeking a face-restoration method they can run through listed platforms or integrate into image workflows. Its setup requirements and research framing are relevant for users considering local use.
Verdict
CodeFormer offers face restoration, enhancement, colorization, and inpainting, with a setting to adjust quality versus fidelity. Check its setup requirements and license terms, particularly the stated commercial restriction on the Replicate API.
The facts
Each one read from CodeFormer's own pages, with the date it was checked.
What it does
- 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.checked 4 Oct 2026
- API restriction
- The Replicate model page says its CodeFormer API cannot be used commercially.checked 4 Oct 2026
- Colorization and inpainting
- Separate scripts provide colorization and inpainting for cropped and aligned face images.checked 11 Oct 2026
- Image enhancement
- The project supports face restoration and whole-image enhancement, with optional Real-ESRGAN upsampling for faces and backgrounds.checked 4 Oct 2026
- Integrations
- The project lists Stable Diffusion WebUI, ChaiNNer, and ComfyUI among integrations, and identifies Hugging Face, Replicate, and OpenXLab demos as author-maintained deployments.checked 4 Oct 2026
- 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.checked 11 Oct 2026
- 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.checked 11 Oct 2026
- License
- The project uses the NTU S-Lab License 1.0, and the repository says redistribution and use should follow that license.checked 11 Oct 2026
- Local requirements
- The installation instructions list PyTorch 1.7.1 or later, CUDA 10.1 or later, and additional packages in requirements.txt.checked 11 Oct 2026
- Purpose
- CodeFormer is a Transformer-based method for blind face restoration that predicts codes from low-quality face images.checked 11 Oct 2026
- 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.checked 11 Oct 2026
- Quality control
- A controllable weight trades image quality against fidelity, with lower values tending toward higher quality and higher values toward higher fidelity.checked 4 Oct 2026
- 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.checked 4 Oct 2026
- Restoration method
- It uses a learned discrete codebook and Transformer-based code prediction to restore faces from degraded inputs.checked 4 Oct 2026
- Security and compliance
- The opened project and demo pages do not state security certifications or compliance standards.checked 4 Oct 2026
- Support
- The repository directs questions to [email protected].checked 11 Oct 2026
- Third-party integrations
- The repository lists integrations including Stable Diffusion WebUI and chaiNNer, and warns that other listed demos and services are third-party.checked 11 Oct 2026
- Third-party services
- The README identifies other listed demos, APIs, apps, websites, and integrations as third-party and unaffiliated with the authors.checked 4 Oct 2026
- Video
- The inference script accepts video input, with documented support for .mp4, .mov, and .avi files.checked 11 Oct 2026
- Video enhancement
- The inference script accepts video clips ending in .mp4, .mov, or .avi; the README says Windows and Mac users should install ffmpeg first.checked 4 Oct 2026
- Whole-image enhancement
- The project supports enhancing whole images and can use Real-ESRGAN to upsample faces or enhance background regions.checked 11 Oct 2026
Where it runs
- Official demos
- The authors identify their Hugging Face Space, Replicate, and OpenXLab demos as official deployments they maintain.checked 11 Oct 2026
Alternatives to CodeFormer
- 1

Pixelcut
Free planAndroidiOSWebAPI8.3From $8 a month - 2
Cutout.Pro
Free planAndroidiOSWebAPI8.2From $5 a month - 3

ImageColorizer
Free planAndroidiOSWebmacOS8.2From $19.99 a year - 4
Sogni
Free planAndroidiOSWebAPI8.2From $20 a month - 5

PicWish Old Photo Restoration
Free planAndroidiOSWebAPI8.0From $9.95 a month - 6

DaVinci AI Photo Restoration
AndroidiOSWeb7.7From $39.99 a month
