CodeFormer
Robust face restoration with an adjustable fidelity–quality trade-off.
- Star 数
- 18.2K
- Fork 数
- 3.7K
- 未关闭 Issue
- 283
- 最近提交
- 2025-11-18
数据来自 GitHub API · 更新于 2026-10-15
CodeFormer 是什么?
CodeFormer restores faces using a learned codebook prior and lets you tune how faithful the result stays to the input. It also handles colorization and inpainting of faces. Note the non-commercial S-Lab license.
主要功能
- Fidelity weight slider (-w) to balance realism vs. likeness
- Face colorization and inpainting
- Whole-image and video support
系统要求
- 平台
- Windows · macOS · Linux
- 显卡
- NVIDIA recommended
- Python
- 3.8
如何安装 CodeFormer
根据项目 README 整理。开源项目更新很快,请以 GitHub 页面上的最新说明为准。
Python
- 1Clone and install.
git clone https://github.com/sczhou/CodeFormer cd CodeFormer pip install -r requirements.txt python basicsr/setup.py develop - 2Download the pretrained models and restore a folder of photos.
python scripts/download_pretrained_models.py facelib python scripts/download_pretrained_models.py CodeFormer python inference_codeformer.py -w 0.7 --input_path inputs/whole_imgs
优势
- Excellent on heavily degraded faces
- Adjustable fidelity
不足
- Non-commercial license
CodeFormer 替代品对比
| 软件 | Star 数 | 许可证 | 平台 | 显存 |
|---|---|---|---|---|
| CodeFormer Robust face restoration with an adjustable fidelity–quality trade-off. | 18.2K | S-Lab License 1.0 (non-commercial) | — | |
| GFPGAN Blind face restoration for old and low-quality photos. | 37.7K | Apache-2.0 | — | |
| Real-ESRGAN Practical image and video super-resolution models. | 37.1K | BSD-3-Clause | — | |
| Upscayl Free desktop app that upscales images with AI. | 50.6K | AGPL-3.0 | — | |
| rembg Remove image backgrounds from the command line, Python or an HTTP server. | 25.1K | MIT | — | |
| BiRefNet High-resolution dichotomous segmentation — state-of-the-art background removal. | 4.3K | MIT | — |
常见问题
CodeFormer 免费吗?
是的——CodeFormer 是开源软件,采用 S-Lab License 1.0 (non-commercial) 许可证。商用前请确认软件及模型权重的许可条款。
CodeFormer 支持 Windows、Mac 和 Linux 吗?
CodeFormer 支持:Windows, macOS, Linux。
运行 CodeFormer 需要什么配置?
NVIDIA recommended
如何安装 CodeFormer?
1. Clone and install. 2. Download the pretrained models and restore a folder of photos.
CodeFormer 有哪些好的替代品?
常见替代品包括 GFPGAN, Real-ESRGAN, Upscayl, rembg,详见本页对比表。
可以不安装、在线使用 CodeFormer 吗?
如果只想要结果,AiLoft 可在浏览器中运行 GPT Image 2.5、Nano Banana Pro 等顶级图像模型,无需显卡和配置。
不想安装?直接在浏览器里生成图片
无需显卡、驱动或 Python。在线使用 GPT Image 2.5 和 Nano Banana Pro,并排对比效果。