How to Restore Faces with Stable Diffusion?

Mike Rule

Updated on

Gone are the days when Stable Diffusion generated blurry or distorted faces. Now, a feature known as Face Restoration in Stable Diffusion AUTOMATIC1111 webUI has been moved to the Settings menu (not missing) and is consistently activated for all images when the feature is enabled. Thanks to that, Stable Diffusion enables you to easily generate high-quality characters and effectively reconstruct distorted faces or missing facial features.

To save you time and effort, this article will delve into the techniques and tools available for restoring faces using Stable Diffusion plus how to enable it if you have a headache with Stable Diffusion Restores faces missing problem.

What is & How to Enable Stable Diffusion Restore Faces?

The Face Restoration feature in Automatic1111 Stable-Diffusion-WebUI uses advanced modeling techniques to enhance the quality of generated faces. By refining and generating facial details and reducing artifacts, this feature produces more realistic and visually appealing results.

Where is Stable Diffusion Restore faces feature? To enable the Stable Diffusion Restore Faces feature, just navigate to Settings on the top, scroll down to find "Face restoration" in the sidebar, and click the button. There are two face restoration models, each comes with its model weight for you to adjust to decide how much you want to fix the face(s) in your image.

Stable Diffusion Restore Faces

CodeFormer

A prediction network utilizing Transformer architecture, referred to as CodeFormer, has been developed to analyze the global composition and context of low-quality facial images for code prediction. This innovation facilitates the identification of natural faces that closely resemble the intended target faces, even in instances where the input images are significantly compromised.

GFPGAN

This is a fundamental image blending technique, akin to adjusting the opacity of that particular layer. To regulate the strength of the facial correction, one can manipulate the codeformer weight; however, such control is not available for GFPGAN.

Stable Diffusion Restore Faces CodeFormer vs GFPGAN

Prompt: "Portrait of a woman,long straight brown hair,white dress,street background"
Negative prompt: "bad anatomy,bad hands,three hands,three legs,bad arms,missing legs,missing arms"
Model: DreamShaper
Other settings: default

Overall, CodeFormer has effectively captured the nuances of facial features, while GFPGAN is recognized for its accuracy in rendering facial structures. Given that each algorithm possesses distinct strengths and weaknesses, it is advisable to experiment with both to determine which one is most suitable for your specific requirements.

How to Enable & Restore Faces with Stable Diffusion?

#1. Restore faces in Automatic1111

Step 1. Go to Settings in AUTOMATIC1111 Stable-Diffusion-WebUI.

Step 2. Scroll down to find "Face Restoration" and click on it.

Step 3. On the right, enable the "Restore faces" option, and choose CodeFormer or GFPGAN model.

Step 4. Click the "Apply settings" button, then the restoration process will be smoothly incorporated into the image generation workflow. Thus, enhancing distorted, unnatural, or freaky faces happens while generating images.

Stable Diffusion Restore Faces

#2. Restore faces with Inpainting

You can also use the Stable Diffusion Inpainting feature to fix the problems with faces. Even if there is no Restore faces button, the Restore faces function in Stable Diffusion works here.

Step 1. After generating your image, click on the "palette" tab under the image to send the image and generation parameters to img2img inpaint tab.

Stable Diffusion Inpainting

Step 2. Click the "Use brush" tool and select the specific area of the face in the image you want to restore and enhance. Then, adjust the Inpaint parameters.

Stable Diffusion Inpainting 2

Step 3. When everything is OK, click on the "Generate" button to restore the face.

#3. Restore faces while upscaling

You can also restore faces in your image while upscaling it. You can send the generated image and generation parameters to extra tabs by clicking on the "Triangle" tab.

Stable Diffusion Extra Tabs

Then, you will see the face restoration options like GFPGAN and CodeFormers. Select any face restoration model you want and adjust the visibility. When everything is OK, hit the "Generate" button.

Stable Diffusion Upscale Restore Faces

A Better Way to Restore Faces

Stable Diffusion face restoration feature works well with an appropriate model during image generation, but it probably can’t handle images uploaded from a computer very well. Also, the setup and parameter settings are quite complex.

While Stable Diffusion offers impressive yet complicated capabilities for face restoration, there are dedicated tools that can provide even more specialized and efficient solutions. Winxvideo AI is one such tool that excels in face restoration tasks from old photos, scratched images, and noisy pictures, offering you a streamlined face restoration and image enhancement experience when Stable Diffusion Restore faces is not working for you.

Winxvideo AI Restore Faces

Step 1. Download Winxvideo AI, install and launch it.

Step 2. Click on the "Image AI" button on the main UI, and add your image(s). Winxvideo AI lets you process multiple images simultaneously, saving time and effort.

Step 3. Choose an AI model, e.g. Gen Detail v2, and adjust the Model Settings. You can choose to upscale your image to a higher resolution or not to improve image quality.

Step 4. In the "Image Restoration" section, select "Face Restoration" and choose one mode from "High Quality Faces", "Center Face", and "All Faces".

Step 5. If needed, click on "Colorizing Monochrome Image" to colorize your image if it is in Black & White.

Step 6. Specify the "Export Settings" and click on the "RUN" button to restore faces with Winxvideo AI.

Free Download Free Download

Note: AI tools for Mac are currently unavailable, but they're coming soon. Stay tuned.

FAQs about Stable Diffusion Restore Faces

1. Where did face restoration go in AUTOMATIC111?

If you are encountering Stable Diffusion button gone or missing issue, don’t worry, the feature just has been moved to the Settings menu.

2. How to enable restore faces in Stable Diffusion?

Just go to Settings in AUTOMATIC111 Stable Diffusion webui, find "Face Restoration" option and click on it. Then, enable the "Restore faces" option on the right, choose a desired model and the hit "Apply settings" to enable the feature.

3. Can Stable Diffusion generate faces?

Yes, Stable Diffusion can generate faces. In fact, it's one of its most popular applications. By providing specific prompts, you can instruct the model to create images of people with various ages, genders, ethnicities, and facial expressions. However, faces sometimes are blurry, freaky, unnatural, distorted with missing eyes or a crooked nose, you should activate Stable Diffusion Restore faces in advance when generating faces.

4. Why are faces distorted in Stable Diffusion?

The distortion of faces in Stable Diffusion can result from various factors, including inadequate training data, unclear prompts, limitations of the model, and the configuration of hyperparameters.

Related Articles