Run the latest models all in one Sandbox 🏖️

CodeFormer Image to Image

fal-ai/codeformer
Fix distorted or blurred photos of people with CodeFormer.
Inference
Commercial use

Input

Additional Settings

Customize your input with more control.

Result

Idle

What would you like to do next?

Download

Your request will cost $0.0021 per megapixel.

Logs

CodeFormer Editor | [image-to-image]

CodeFormer restores degraded facial images through a transformer-based architecture that balances quality and identity preservation at $0.0021 per megapixel. Trading speed for fidelity control, you adjust the quality-identity tradeoff via a single parameter rather than accepting fixed restoration results. Built for production workflows where facial image quality directly impacts user experience, from profile photo cleanup to archival restoration.

Use Cases: Profile Photo Enhancement | Archival Photo Restoration | Low-Quality Facial Image Recovery


Performance

At $0.0021 per megapixel, CodeFormer delivers configurable facial restoration with 2x upscaling built in, approximately 476 restorations per dollar for standard 512x512 inputs on fal.

MetricResultContext
Fidelity Control0.0-1.0 adjustableBalance quality vs identity preservation per inference
Upscaling Factor2x defaultConfigurable up to higher resolutions with face_upscale parameter
Cost per Megapixel$0.0021~476 standard 512x512 restorations per $1.00 on fal
Face DetectionCenter-only or multi-faceOptional only_center_face parameter for targeted restoration

Configurable Quality-Identity Tradeoff

CodeFormer uses a transformer architecture with a controllable fidelity parameter; you're not locked into a single restoration approach. Standard restoration models force a fixed balance between enhancing quality and preserving facial identity. CodeFormer exposes this as an API parameter.

What this means for you:

  • Adjustable fidelity weight (0.0-1.0): Lower values prioritize photographic quality and detail enhancement, higher values preserve original facial features and identity markers, tune per use case rather than accepting model defaults

  • Selective face restoration: Process only the center face or all detected faces via the only_center_face parameter, reducing unnecessary computation when working with group photos or complex scenes

  • Built-in upscaling: 2x upscaling factor applies by default with optional face_upscale control, eliminating the need for separate upscaling steps in your pipeline

  • Alignment options: Toggle face alignment preprocessing via the aligned parameter to handle images where facial features aren't centered or standardized


Technical Specifications

SpecDetails
ArchitectureCodeFormer
Input FormatsJPEG, PNG, WebP via URL
Output FormatsPNG with preserved or enhanced resolution
Default Resolution2x input resolution (configurable via upscale_factor)
LicenseCheck model page for current terms

API Documentation | Quickstart Guide | Enterprise Pricing


How It Stacks Up

FASHN Virtual Try-On V1.5 – CodeFormer prioritizes facial restoration with configurable fidelity control for archival and profile photo workflows. FASHN specializes in garment try-on scenarios where clothing fit and appearance matter more than facial enhancement, serving e-commerce and fashion applications where product visualization drives conversion.