CodeFormer

Model Information

Display Name: CodeFormer

API Model ID: sczhou/codeformer

Category: Image tools

Description: CodeFormer is a state-of-the-art face restoration model designed to recover detail and identity from old, blurry, low-resolution or AI-generated faces. Built on a Vector-Quantized codebook prior with a fidelity-quality control knob, it is widely used for photo restoration and post-processing of AI image outputs. **Key Features:** - Robust face restoration on degraded or AI-generated photos - Adjustable fidelity-quality trade-off (`codeformer_fidelity` 0.0–1.0) - Optional background enhancement via Real-ESRGAN - Final upscale factor of 1×, 2× or 4× **Capabilities:** - Old photo restoration (scratches, blur, low-res) - AI-generated face cleanup (artifact removal, identity sharpening) - Profile picture / portrait enhancement - Pre-print photo restoration **Best For:** - Restoring family / archival photos - Cleaning up generative AI face outputs - Avatar / profile picture enhancement - Forensic photo enhancement (research only) **Technical Specs:** - Architecture: Vector-Quantized codebook + Transformer - Typical run time: ~5 seconds - Input: any common face image (URL or base64) - License: S-Lab (research / non-commercial — confirm terms for production)

How to Use This Model

To use CodeFormer via the HInow.ai API, use the model ID: sczhou/codeformer

API Request Example (Image Generation)


POST https://api.hinow.ai/v1/images
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "model": "sczhou/codeformer",
  "prompt": "Your image description here"
}
              

Pricing

  • total: $0.01

Available Parameters

  • codeformer_fidelity: Fidelity-quality balance (0.0-1.0). Higher = more faithful to original. (Options: 0.0, 0.3, 0.5, 0.7, 0.9, 1.0)
  • background_enhance: Apply Real-ESRGAN to the background. (Options: true, false)
  • face_upsample: Upsample the restored face. (Options: true, false)
  • upscale: Final output upscale factor. (Options: 1, 2, 4)

Quick Reference

To use this model, set: "model": "sczhou/codeformer"

Featured: No

Documentation: https://hinow.ai/models/sczhou/codeformer

API Endpoint: https://api.hinow.ai/v1

Back to Models

CodeFormer

sczhou/codeformer

$0.010
per image

About

CodeFormer is a state-of-the-art face restoration model designed to recover detail and identity from old, blurry, low-resolution or AI-generated faces. Built on a Vector-Quantized codebook prior with a fidelity-quality control knob, it is widely used for photo restoration and post-processing of AI image outputs.

Key Features:

  • Robust face restoration on degraded or AI-generated photos
  • Adjustable fidelity-quality trade-off (codeformer_fidelity 0.0–1.0)
  • Optional background enhancement via Real-ESRGAN
  • Final upscale factor of 1×, 2× or 4×

Capabilities:

  • Old photo restoration (scratches, blur, low-res)
  • AI-generated face cleanup (artifact removal, identity sharpening)
  • Profile picture / portrait enhancement
  • Pre-print photo restoration

Best For:

  • Restoring family / archival photos
  • Cleaning up generative AI face outputs
  • Avatar / profile picture enhancement
  • Forensic photo enhancement (research only)

Technical Specs:

  • Architecture: Vector-Quantized codebook + Transformer
  • Typical run time: ~5 seconds
  • Input: any common face image (URL or base64)
  • License: S-Lab (research / non-commercial — confirm terms for production)

Capabilities

Image tools

Parameters

codeformer_fidelity

Fidelity-quality balance (0.0-1.0). Higher = more faithful to original.

0.00.30.50.70.91.0
background_enhance

Apply Real-ESRGAN to the background.

truefalse
face_upsample

Upsample the restored face.

truefalse
upscale

Final output upscale factor.

124

Code Examples

curl -X POST https://api.hinow.ai/v1/images \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $HINOW_API_KEY" \
  -d '{
    "model": "sczhou/codeformer",
    "prompt": "Transform this image into cyberpunk style",
    "images": [
      "https://example.com/image1.jpg",
      "data:image/png;base64,iVBORw0KGgo..."
    ],
    "parameters": {
      "codeformer_fidelity": "0.0",
      "background_enhance": "true",
      "face_upsample": "true",
      "upscale": "1"
    }
  }'