AI face restoration
Generated and upscaled images often produce mangled faces — smeared eyes, asymmetric features, plastic skin. Face-restoration models repair them. GFPGAN, CodeFormer, and RestoreFormer each take a different approach, and the single most important setting is the fidelity weight that balances invented detail against staying true to the original face.
How it works
These models detect faces, crop them, run a generative restoration network, and paste the result back with a blend:
final_face = restored_face × blend + original_face × (1 − blend)
- Weight / fidelity controls how aggressively the network rebuilds. Low = more new detail, high = closer to input.
- Blend strength controls how visible the restoration is in the final composite — your tool against the “pasted-on” look.
CodeFormer exposes an explicit weight; GFPGAN uses a fixed network with a visibility slider; RestoreFormer prioritises identity by design.
Tips and example settings
- Light cleanup of a good face: GFPGAN at ~0.5 visibility — neutral, fast.
- Badly degraded or AI-warped face: CodeFormer weight 0.5–0.7, blend 0.8.
- Portrait of a real, recognisable person: RestoreFormer, blend 0.7, so the identity is preserved.
- Restore, then upscale. Fix the small face first; enlarge the whole frame afterwards so artifacts are not amplified.
- In Automatic1111, set the restorer under Settings → Face restoration and the CodeFormer weight slider; in ComfyUI, drop in a FaceRestore node and feed the weight as a float input.