santa hat
deerdeer nosedeer glow
Sign In

How to Fix Faces with AUTOMATIC1111

How to Fix Faces with AUTOMATIC1111

Preface

I am sitting here right now and want to create an image for this article and am currently experiencing the so-called demonstration effect. Unlike yesterday, today everything is working as I expected it to be.

Since it can be a problem in general and it is a recurring problem, I will refer to an image from yesterday for the following explanations. Often images are not useable when the faces are deformed or malformed.

I will give two good references next to the explanation of my example. These references explain better and in more detail what I am demonstrating here. So I do not have to reinvent the wheel again.

Assumptions

In the context of this article, I assume that the web UI AUTOMATIC1111 is installed. Furthermore the Extension ADetailer should be available. ADetailer is not needed for the presented example but it is needed to work with examples from the references.

Another assumption is that the image with the ugly face is sent directly from txt2img to img2img. The settings presented below require the original prompt for the image. Otherwise it is more complicated to manipulate the face and eyes.

Example Image

I had to create some image for a CIVITAI post to show how my new LoRA model works. For this purpose I wanted to use a cat with top hat. Most of the images created were frustrating as the ADetailer did not work as desired, even though the image was suitable apart from the face. Figure 1 shows one of the created bad images.

Figure 1: Cat with malformed face

As one can see the eyes of the cat are friendly spoken ugly and unreal. In the next section I explain how one can fix this.

How to Fix the Face

I decided to use an approach for fixing the faces without using ADetailer. This can be done by using Inpainting.

Go to img2img and Inpaint to use Inpainting.

With the following setting

  • Mask mode: Inpaint masked

  • Masked content: Original

  • Inpaint area: Only masked

  • Denoising strength: 0.7

one will get fast and good results for the malformed face.

Keep in mind that you have to paint the mask over the face as accurate as possible. Then the results out of the box quite good.

See [1,2] for more information how to fix faces.

Resulting Images

Figure 2 and Figure 3 are two images out of a set of 6 with the desired result. I prefer Figure 3 but that is a matter of taste.

Figure 2: Cat with fixed face

Figure 3: Cat with fixed face

Side Note

Today ADetailer works on all examples as I would expect it to all the time. The bottom line is, if ADetailer does not seem to work as expected, restart AUTOMATIC1111 or, if in doubt, restart the entire local computer system. I have had similar cases in the past. It's like with a marslander. Switch off, switch on, works again.

Conclusion

As it could be demonstrated an ugly face can be improved in a way that an unusable image is usable after applying Inpainting.

Final Words

Have a nice day. Have fun. Be inspired!

References

[1] https://stable-diffusion-art.com/adetailer/

[2] https://openaijourney.com/fix-eyes-in-stable-diffusion/

2

Comments