Canonical: https://instain.ru/en/ai/codeformer/
Language: en

S-Lab, Nanyang Technological University  model

# CodeFormer. 

Restore faces in blurred and compressed photos

4.40 / 5    [Directory score](https://instain.ru/en/ai/codeformer/#editorial-rating) [Official website ](https://github.com/sczhou/CodeFormer)

This face restoration model handles blurred and compressed images. You can compare outputs at different levels of fidelity to the source.

![CodeFormer repository with examples of face recovery in photos.](https://instain.ru/assets/images/codeformer-screen-7c49a70251ec-1200.webp)

CodeFormer repository with examples of face recovery in photos.  [Open the source ](https://github.com/sczhou/CodeFormer)

## The regulation of similarity affects the face

CodeFormer restores portraits with blurring, noise and low-resolution traces. The model has a weight parameter of similarity. When the value is increased, processing is usually closer to the original image. With a smaller value, the face may look sharper, but the risk of differences in appearance increases. The difference sometimes manifests itself only in small things, for example, in the bending of the eyebrow. For the archive, choose the most moderate result if it is read enough for the intended size.

## Comparison for family archives

In the training example there is a scanned group picture. First, save the whole scan and make a copy. Handle the option with a restrained recovery, then one with a large model influence. Put the faces next to it and check the eyelid line, glasses, lip shape and facial expressions. If the detail turns out to be sharp, but it cannot be distinguished from the source, do not take it for the feature found. The family signature under the picture should be based on known information.

## When it is better to treat only the face

A separate mode is available for already prepared persons. When working with the whole frame, check how the restored area is combined with the grain and softness of the rest of the photo. If the changed background interferes, leave it from the original and compare only the portrait area. Keep two copies so that the result can be revised or replaced later. The processed image has visual value for display, but the original scan is better suited for documentary use and verification of indistinguishable details.

## Suitable tasks

- Prepare a careful copy of the blurred portrait

- Compare recovery with different values of similarity

Features 

## Strengths

- Adjustable source compliance priority

- Modes for individual face and full image

Things to consider 

## Limitations

- The model can come up with plausible details

- Too much change changes the similarity.

## Selection and conditions

Free access

Not confirmed

Trial period

Not confirmed

No sign-up required

Not confirmed

Russian interface

Not confirmed

Local installation

Yes

API

Not confirmed

“Not confirmed” means there is not enough information. The feature may still be available; check the developer’s terms.

Input formats

Image

Result

Image

### Terms

The authors provide code, weights and instructions for processing whole images or separately aligned faces. Requirements for the environment are given in the repository.

From task to first result

## Practical example

Task

Prepare a careful copy of the blurred portrait

What to prepare

Your own scan of an old family photograph; the original file is retained separately, with agreed processing and distribution rights.

### Task brief or prompt

Assignment: produce one restored version of a photograph, then compare the face, clothing, and background with the original. Do not treat newly appearing details as historical facts. Save the source beside the processed copy and label the use of AI.

### Expected result

A copy of a photograph for viewing or an album; the authenticity of reconstructed features and lettering is not assumed.

### How to check the result

- Compare faces with the original and other confirmed photos of people.

- Check jewelry, textures, and lettering: do not present reconstruction as documentary evidence.

- For printing, check a small test section at actual size.

An editorial teaching example of a task brief, not the result of hands-on testing of the service. Check that the required mode is available, that you have rights to the source material and that the intended use of the result is permitted.

Check details

## Official sources

-  [Official CodeFormer repository ](https://github.com/sczhou/CodeFormer)

-  [Demonstration of the CodeFormer team ](https://huggingface.co/spaces/sczhou/CodeFormer)

-  [Study by CodeFormer authors ](https://arxiv.org/abs/2206.11253)

This description is based on the developer’s material. Features, prices and availability may change; check the primary source before use.

About the tool

Developer

S-Lab, Nanyang Technological University

Category

[Images](https://instain.ru/en/category/images/)

Access

The authors provide code, weights and instructions for processing whole images or separately aligned faces. Requirements for the environment are given in the repository.

Payment

Local launch is possible with published weights. Read the NTU S-Lab License 1.0 and comply with the conditions for using images.

API

Check the developer documentation

[Developer terms ](https://github.com/sczhou/CodeFormer)

Directory score

4.40 / 5 

Features

4.50 / 5 

Workflows

4.30 / 5 

Ecosystem

4.30 / 5 

Documentation

4.50 / 5 

Scores are an editorial guide to the directory. They are not user reviews or the results of personal testing.

[See the methodology ](https://instain.ru/en/methodology/)

Keep exploring

## For similar tasks

[Full category  ](https://instain.ru/en/category/images/)

Images 

###  [SwinIR](https://instain.ru/en/ai/swinir/)

Photo upscaling, denoising and JPEG cleanup

4.35 / 5   model  

Free access confirmed

Images 

###  [Remini](https://instain.ru/en/ai/remini/)

Photo enhancement and a restored version for a family archive

4.15 / 5   service  

Trial available
