What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

CodeFormer can make a badly distorted AI face look convincingly human, but it cannot recover a hidden “true” face. It is a blind face-restoration model that uses learned facial patterns to reconstruct missing or damaged details. The worse the source image, the more likely the result is a plausible invention rather than a faithful repair.

For the best balance, run the same image at several fidelity values—start around 0.5, then compare approximately 0.2, 0.5, and 0.8. Lower values usually produce stronger correction but increase identity drift; higher values preserve more of the input while leaving more defects visible.

What CodeFormer actually fixes

CodeFormer is primarily a blind face-restoration system. It detects faces, reconstructs facial structure and texture, and blends the repaired face back into the image. It is designed for faces damaged by low resolution, blur, compression, face swaps, denoising, or generative-image artifacts.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That makes it useful for common AI-image failures such as:

#1 Best Overall
HP Workstation PC Desktop Computer | Editing and Design | NVIDIA Quadro K1200 4GB GPU | Intel Core i5 | 32GB DDR4 RAM, 1TB SSD + 4TB HDD | Wi-Fi 5G + Bluetooth | Windows 11 Pro (Renewed)
  • Content Creation Workstation PC: Powered by the Intel Hexa-Core i5 (8th Gen) processor with 32GB DDR4 RAM and NVIDIA's Quadro K1200 4GB Graphics Card, this Workstation PC Computer is built for creative environments
  • NVIDIA's Quadro K1200 4GB Graphics Card: Graphic support built to be an efficient workstation for creative applications like photo and video editing, 3D Design, AutoCAD, and much more
  • Software Compatibility: Workstation PC for use with independent software vendors (ISV) and certified for use with modeling, rendering, and engineering software from Adobe, AutoCAD, 3DS Max, and many more
  • Massive Storage Solutions: An ultra-fast 1TB Solid State Drive (SSD) setup as the primary boot device; Boot and load programs with little to no lag; An additional 4TB Hard Disk Drive (HDD) is installed for additional storage; Never run out of storage
  • Connectivity for Creative Projects: USB 3.0 (x5) | USB 2.0 (x4) | USB Type-C (x1) | DisplayPort (x2) | Serial Port (x1) | VGA Port (x1) | Audio Combo Jack (x1) | Audio In (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)
  • asymmetrical or melted eyes;
  • duplicated pupils and irises;
  • fused or unreadable teeth;
  • distorted mouths and noses;
  • broken ears and hairlines;
  • misaligned eyebrows;
  • waxy skin and inconsistent proportions; and
  • faces that collapse because they were generated too small.

It is not the same as several nearby tools:

Task What it does
Upscaling Increases image size and may sharpen existing detail.
Face restoration Uses a learned facial prior to reconstruct damaged facial content.
Face swapping Replaces one identity with another.
Inpainting Fills a selected or missing region according to surrounding context.
Generative re-rendering Creates a new image or face from prompts, references, or other conditioning.

CodeFormer is most useful when a face is still recognizable enough to detect but contains local defects. It is much less dependable when the face is tiny, turned sharply away, heavily masked, entirely missing its eyes or mouth, overlapped by another face, deliberately abstract, nonhuman, or already sharp but semantically wrong.

The project supports whole-image restoration, aligned face crops, optional face upsampling, background enhancement through Real-ESRGAN, video input, colorization, and inpainting. See the official CodeFormer repository for the current documented options.

Why the result is reconstruction, not recovery

CodeFormer’s method maps a degraded face into a learned discrete facial codebook. A Transformer predicts codes that represent plausible facial content, allowing the model to produce natural-looking faces even when the input is severely damaged. Its fidelity control lets you choose how strongly the output should follow the source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That strength is also the fundamental limitation. The model does not retrieve hidden pixels, identify the original person, or understand what the subject “really” looked like. When information has been destroyed, it fills the gap using a learned facial prior.

The more information the source has lost, the more CodeFormer must guess.

So “turning monsters into humans” is a useful visual description, not a literal guarantee. A result may have better eyes, teeth, and facial proportions while being less faithful to the intended character.

The underlying method is described in the CodeFormer paper and its NeurIPS conference version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The fastest method: use the official online demo

For a quick experiment, use the author-maintained CodeFormer Hugging Face Space. Availability, queues, hardware, and quotas can change, so treat it as a testing route rather than guaranteed production infrastructure.

Rank #2
Acer Nitro V Gaming Laptop 16" WUXGA IPS 180Hz Display|AMD Ryzen 7 260|NVIDIA GeForce RTX 5060 |Backlit|Black| 32GB RAM DDR5 | 1024GB SSD |Windows 11 Home |Bundle with Mouse Pad
  • 【RAM & Storage】This computer comes with 32GB RAM DDR5 | 1024GB SSD
  • 【AMD Ryzen 7 260 Processor】It is a fast Hawk Point family chip for laptops that was announced at CES 2025. It features 8 Zen 4 cores (16 threads thanks to SMT support) running at up to 5.1 GHz.
  • 【 16” WUXGA (1920 x 1200) display 】Experience exceptional clarity and vibrant detail with the 16" WUXGA 1920 x 1200 display, featuring 100% sRGB color coverage for true-to-life, accurate colors. With a 180Hz refresh rate, enjoy ultra-smooth, fluid motion, even during fast-paced action.
  • 【Other features】NVIDIA GeForce RTX 5060,Advanced thermal design to maintain peak performance under heavy loads,quad-intake cooling, Win 11 Home
  • 【Bundle with mouse pad】Bundled with Mouse Pad featuring high-quality cloth surface promotes smooth mouse gliding and enhanced precision.
  1. Open the official CodeFormer Space.
  2. Upload an image containing a detectable face.
  3. Start with fidelity around 0.5.
  4. Inspect the output beside the original at 100% zoom.
  5. Try a lower value if the eyes, mouth, or facial structure remain broken.
  6. Try a higher value if the result no longer resembles the intended character.
  7. Save each result separately instead of overwriting the source.

Do not upload sensitive portraits without considering the service’s data handling, privacy terms, and your legal obligations. For commercial work, a hosted demo is not automatically commercially permitted: CodeFormer’s license and the platform’s terms are separate questions.

Understanding the fidelity value

The official implementation calls the control w and documents a range from 0 to 1. The repository’s example uses 0.5, but there is no universal best setting.

Value Typical behavior Useful when
0.0–0.3 Strongest correction and the greatest risk of identity drift. The face is severely damaged or the goal is simply to make it plausibly human.
0.4–0.6 Balanced correction and input preservation. A sensible starting range for most experiments.
0.7–0.9 More conservative; original defects may remain. The character’s identity, expression, or unusual features matter.
1.0 Maximum preservation within the model’s control. A conservative comparison baseline.

These ranges describe the documented quality-versus-fidelity trade-off, not a measured benchmark. Run a controlled sweep on the same source—such as 0.2, 0.5, and 0.8—while keeping every other setting unchanged.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not interpret “quality” as “truth.” A lower value can make a face cleaner and more attractive while changing its age, ethnicity, expression, proportions, or identity-bearing details.

Local installation

Local processing is preferable for private images, repeatable batches, and automation, but the official installation documentation is based on an older environment. The repository does not establish a modern, officially supported Python/PyTorch/CUDA matrix, so these commands should be treated as the author-documented baseline rather than a guarantee for every current computer.

From a terminal, the repository documents:

git clone https://github.com/sczhou/CodeFormer
cd CodeFormer

conda create -n codeformer python=3.8 -y
conda activate codeformer

pip install -r requirements.txt
python basicsr/setup.py develop

For the optional dlib face-detection or face-cropping path:

conda install -c conda-forge dlib

Download the required model files:

python scripts/download_pretrained_models.py facelib
python scripts/download_pretrained_models.py CodeFormer

The optional dlib model can be downloaded with:

python scripts/download_pretrained_models.py dlib

Use dlib only if your chosen workflow needs it. The README lists PyTorch >=1.7.1 and CUDA >=10.1, but those requirements do not guarantee compatibility with every modern driver, package release, or GPU.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run CodeFormer on an image

Run the command from the directory containing inference_codeformer.py, or adjust the path to match your checkout:

Rank #3
Sale
Lenovo IdeaCentre 24" FHD All-in-One Desktop, 8GB RAM 512GB SSD
  • Powerful Performance for Everyday Computing: Intel N100 Quad-Core processor delivers smooth multitasking for home office, students, and families. Handle web browsing, video calls, document editing, and streaming effortlessly with responsive performance.
  • Stunning 24" FHD Display with Eye Comfort: Enjoy vibrant visuals on the 23.8" Full HD screen with 99% sRGB color accuracy and anti-glare technology. Perfect for long work sessions, online learning, and entertainment with reduced eye strain.
  • Ample Memory & Fast Storage: 8GB DDR4 RAM ensures seamless multitasking, while 512GB SSD provides lightning-fast boot times, quick file access, and plenty of space for documents, photos, and applications.
  • Complete Connectivity Hub: Stay connected with WiFi 6, Bluetooth 5.1, HD webcam, dual microphones, and multiple ports (USB 3.2, USB 2.0, HDMI, Ethernet, audio jack). Ideal for video conferencing and peripheral connections.
  • All-in-One Value Package: Space-saving black design includes wired keyboard and mouse. Windows 11 Home pre-installed. Everything you need for productivity right away.
python inference_codeformer.py 
  -w 0.5 
  --input_path [image-folder-or-image-path]

For background enhancement and face upsampling, the official examples use:

python inference_codeformer.py 
  --bg_upsampler realesrgan 
  --face_upsample 
  -w 1.0 
  --input_path [image-or-video-path]

Real-ESRGAN can improve enlargement and background quality, but it is not a replacement for correcting malformed facial anatomy. Keep face restoration and general upscaling conceptually separate.

Aligned faces versus whole-image processing

For a pre-cropped, aligned face, use:

python inference_codeformer.py 
  -w 0.5 
  --has_aligned 
  --input_path [aligned-face-folder]

Aligned-face processing is valuable when you want controlled comparisons or plan to composite the repaired face manually. Whole-image processing can introduce face-background fusion effects, particularly around hair, ears, and other boundaries. The official README specifically warns that these effects can damage boundary texture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical approach is to crop one face, enlarge it if necessary, process it separately, and place the result back into the original with a layer mask. This gives you more control than allowing a full-image pass to rewrite the surrounding hair and skin.

A repeatable repair workflow

  1. Preserve the original. Work on copies and keep every fidelity version.
  2. Isolate the subject. Crop a single face when the image contains several people.
  3. Run a fidelity sweep. Compare at least low, middle, and high values.
  4. Inspect important features. Check eyes, pupils, teeth, ears, eyebrows, hairline, glasses, expression, and face boundaries at 100% zoom.
  5. Choose faithfulness over prettiness. The most photorealistic result may be the least faithful to the character.
  6. Blend selectively. Lower the restored layer’s opacity or mask the correction to the eyes, mouth, or other defective areas.
  7. Inpaint localized failures. If only one eye or the mouth is wrong, a targeted repair may be safer than replacing the entire face.
  8. Upscale afterward. Once the facial structure is acceptable, enlarge the complete image.
  9. Match the finish. Add appropriate grain, color, contrast, and sharpness so the face does not look pasted onto the image.

For a generated character, blending the original and restored layers often preserves more identity than using the strongest restoration output at full opacity.

Video support does not guarantee stable video

The repository documents video input using a command such as:

python inference_codeformer.py 
  --bg_upsampler realesrgan 
  --face_upsample 
  -w 1.0 
  --input_path [video.mp4]

Frame-by-frame restoration can introduce temporal inconsistency. Eyes, skin details, facial shape, and boundaries may shift between frames, especially when the source is blurry or the detector crops the face differently. Always judge the result while playing the video, not only by inspecting a few attractive still frames.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When CodeFormer makes the image worse

Identity drift

A severely damaged face may become a generic attractive face rather than the intended person or character. Increase w, use an aligned crop, lower the restored layer’s opacity, or restore only selected regions.

Rank #4
Corel Photo Video Ultimate Bundle 2023 | PaintShop Pro 2023 Ultimate and VideoStudio Ultimate 2023 | Powerful Photo and Video Editing Software [PC Download]
  • PRO-LEVEL PHOTO EDITING SUITE: Edit and enhance images with full set of progressive tools, powerful layer-based editing capabilities, artificial intelligence adjustments, and unique workspaces
  • POWERFUL VIDEO EDITING SUITE: Create stunning movies and slideshows with this powerful, fun, and intuitive video editing suite, packed with advanced features and premium effects
  • CREATIVE CONTENT: PaintShop Pro includes color palettes, brushes, gradients, patterns and picture tubes; VideoStudio boasts hundreds of cool effects including Face Effects and AR Stickers
  • ULTIMATE-EXCLUSIVE BONUS: Transform your images into photo animations or photo art, try digital painting, create mesmerizing cinemagraphs, and enjoy premium video effects collections from NewBlueFX and proDAD
  • POPULAR FORMATS: Easily migrate content and plugins, then export to popular formats and devices, easily share online, or burn to disc

Age, appearance, or ethnicity drift

Learned facial priors can pull unusual faces toward an average-looking result. They may alter apparent age, skin tone, facial proportions, wrinkles, scars, makeup, or other identity-bearing features. This is especially important when editing a real person’s portrait.

Expression loss

A grimace, smile, squint, or unusual expression may become neutral. A more conservative setting or partial masking can preserve the original expression.

Style mismatch

Anime, painterly, horror, creature, and deliberately abstract images may be pushed toward photographic human realism. CodeFormer is not a character-design system. Inpainting or a new generation with reference conditioning may provide better control.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

False detail and seams

New pupils, teeth, pores, wrinkles, and hair details can look convincing while being entirely invented. Hair, glasses, ears, necks, and skin edges may also develop visible seams.

Small or overlapping faces

The detector may miss tiny faces, merge overlapping faces, or process multiple subjects inconsistently. Process one face at a time whenever possible.

CodeFormer versus GFPGAN

GFPGAN is a major alternative based on a generative facial prior. Both systems can alter identity when the input is severely damaged, and neither is universally superior.

Criterion CodeFormer GFPGAN
Main control Fidelity weight w from 0 to 1. Model version and upscale-related settings.
Strength Explicit quality-versus-fidelity adjustment. Strong practical generative facial restoration.
Identity risk Can rise sharply at low fidelity values. Can also change identity on severely damaged faces.
License signal NTU S-Lab License 1.0; commercial use requires permission. The project is released under Apache 2.0, though bundled weights and dependencies still require review.
Best comparison Sweep several fidelity values on the same input. Use the same input and compare at the same output scale.

Choose the output that preserves the required subject and expression, not the model with the better reputation or the most polished-looking face.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

No face detected

  • Enlarge the image with a general upscaler first.
  • Crop closer to the face.
  • Try an aligned crop around 512×512 pixels.
  • Install and try the optional dlib detector.
  • Remove extreme borders or masks.
  • Process one face at a time.

CUDA, PyTorch, or dependency errors

Common causes include an incompatible PyTorch/CUDA combination, missing model weights, BasicSR not being installed in editable mode, insufficient GPU memory, or an existing environment with conflicting packages. A fresh environment near the documented Python 3.8 baseline is safer than installing into a large Stable Diffusion environment.

Best Value
Acer Aspire Laptop 2026, Touchscreen, Intel Ultra 7 258V, 32GB RAM+2TB SSD
  • AI-Powered Efficiency: NEXT-GEN AI ACCELERATION – Powered by the Intel Core Ultra 7 258V processor with a dedicated NPU (47 TOPS), this system enables Copilot+ PC features like real-time video effects, background blur, auto-framing, AI photo editing, and task automation—all running locally for privacy and offline use. Ideal for creative professionals and remote workers.
  • Remote Work Champion: BUILT FOR THE REMOTE WORK ERA – 32GB LPDDR5X RAM ensures smooth operation even with dozens of browser tabs, multiple applications, and background processes running. The 2TB PCIe SSD provides ample storage for documents, presentations, photos, and videos while delivering near-instant boot times and application launches. Windows 11 Home with AI Copilot drafts emails, summarizes meetings, and automates repetitive tasks.
  • Content Creation Ready: CREATIVE WORK WITHOUT COMPROMISE – Intel Arc 140V graphics with 8 Xe cores accelerates photo editing in Lightroom, handles 1080p video editing in Premiere/DaVinci Resolve, and supports GPU-accelerated effects. The 14" touchscreen enables intuitive photo retouching and precise editing with stylus support. Ideal for photographers, videographers, graphic designers, and social media content creators.
  • Home Office Command Center: COMPLETE HOME OFFICE SOLUTION – WiFi 6E ensures stable video calls and fast file uploads to cloud storage. The included USB hub provides HDMI, USB-A, USB-C, SD card, and Ethernet ports—eliminating the need for multiple adapters. Set up your professional workspace in seconds, whether at home, a coffee shop, or client office.
  • All-Day Mobility: ULTRA-PORTABLE PROFESSIONAL DESIGN – At just 3.09 lbs and 0.7" thin, this laptop fits easily in any bag for commuting between home office, co-working spaces, and client meetings. Long battery life supports full workdays away from outlets. Perfect for freelancers, consultants, digital nomads, and remote employees who demand desktop performance in a portable package.

If a GPU failure is actually an out-of-memory error, reduce the input size, process a cropped face, close other GPU applications, or test CPU execution if your setup supports it. CPU processing may be slow rather than broken.

The result looks too different

  • Increase fidelity toward 0.7–1.0.
  • Use --has_aligned with a controlled crop.
  • Reduce the restored layer’s opacity.
  • Mask only the damaged eyes, mouth, or other regions.
  • Compare with GFPGAN.
  • Use inpainting instead of a full-face replacement.

The output still looks monstrous

  • Test 0.4, 0.3, and 0.2 gradually.
  • Increase face resolution before restoration.
  • Repair the worst structure with inpainting.
  • Try another restoration model.
  • Stop lowering fidelity once the output becomes a polished but unrelated face.

The background is damaged

Use aligned-face restoration and composite the repaired crop yourself, or disable optional background enhancement. Whole-image face-background fusion can harm hair and boundary textures.

When to use something else

  • Use CodeFormer: the face is badly degraded and you want adjustable, plausible facial reconstruction.
  • Use a general upscaler: the anatomy is already correct and the main problem is softness, compression, or resolution.
  • Use inpainting: only one eye, tooth, mouth, or hairline needs repair.
  • Generate again: the face is fundamentally wrong, nonhuman, highly stylized, or tied to a specific character design that restoration keeps changing.
  • Try GFPGAN: CodeFormer’s facial style is unsuitable or a direct comparison produces a better result.

Real-ESRGAN is best understood as a general restoration and upscaling component, not a complete solution for malformed facial anatomy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Privacy, consent, and licensing

Cloud processing sends the image away from your computer. That matters for private photographs, client work, unreleased artwork, and real-person images. Facial restoration can also alter biometric features, so obtain appropriate consent and do not represent a generated reconstruction as an authentic photograph or recovered identity.

CodeFormer’s repository uses the NTU S-Lab License 1.0. Do not describe it as automatically free for commercial use; the license says commercial use requires contacting the contributors.

The author-maintained Replicate CodeFormer page provides hosted inference but states that its API cannot be used commercially. Paying for hosting does not override the model’s license. Review both the model license and the platform terms before deploying CodeFormer in paid work, a client service, or a SaaS product.

The practical decision

Use CodeFormer when a recognizable but damaged face needs plausible reconstruction and you can evaluate the result for identity drift. Begin around w=0.5, compare several settings, and prefer a conservative or blended output when the character matters. If the face is already anatomically correct, use an upscaler. If the problem is localized, use inpainting. If CodeFormer repeatedly changes the subject, regenerate or use reference-controlled editing instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.