Two heads? Extra fingers? Here’s a guide to fix these common problems.
Stable Diffusion Software
We will use this Stable Diffusion GUI for this tutorial. See my quick start guide for setting up in Google’s cloud server.
Two-head problems
If you browse AI image sites, it’s not unusual to see images with two heads connecting together in Stable Diffusion. It is usually caused by using a portrait image size. Any image size that deviates from 1:1 aspect ratio has the potential of synthesizing the dreaded two heads.
To avoid it, use image size with 1:1 aspect ratio, for example, 512×512.
Three ways to tackle the two-head problem:
- Generate multiple images and discard those with two heads. (It’s not a bad idea, but it can cost you time and money.)
- Reduce aspect ratio. The closer to 1:1 ratio, the less likely you would encounter the infamous two-head.
- Generate a full-body image. (See next section for techniques.)
Not showing full body
AI artists highly seek full-body portraits. But it is also an area with which Stable Diffusion can have the most problems.
A common suggestion to get a full-body image is to use the keyword “full body portrait”. But more often than not, it just doesn’t work. Below are a few examples with the “full body portrait” keyword added. You can see the keywords are completely ignored.
Positive prompt:
[Amber Heard: Ana de Armas :0.3],((Victorian)) , Feminine,((Perfect Face)), ((arms outstretched above head)), ((Aype Beven)), ((scott williams)) ((jim lee)),((Leinil Francis Yu)), ((Salva Espin)), ((oil painting)), ((Matteo Lolli)), ((Sophie Anderson)), ((Kris Anka)), (Intricate),(High Detail), (bokeh).
Negative prompt:
((((ugly)))), (((duplicate))), ((morbid)), ((mutilated)), [out of frame], extra fingers, mutated hands, ((poorly drawn hands)), ((poorly drawn face)), (((mutation))), (((deformed))), ((ugly)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned face, (((disfigured))), out of frame, ugly, extra limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many fingers), (((long neck)))
Describing the lower body
A more consistent approach is to add keywords of what you want to see in the picture. For example
- standing
- long dress
- legs
- shoes
Below are generated with adding keywords standing and long dress.
Now it is showing more of the body, but we can do better.
Use portrait size
Previously, I said don’t use portrait size. But there are exceptions. You do want to use portrait size if you want to generate a full body image. Below are some examples of using portrait size in addition to using “standing” and “long dress” keywords.
Garbled faces and eyes
It is fairly common to see distorted faces. In fact, it happens to other body parts, just that our brain is particularly sensitive to any asymmetry in faces.
Inpainting
Inpainting is the go-to way to messed-up faces. The main reason for generating is that not enough pixels cover the face. You can send the picture to the inpainting tab and regenerate the face at a higher resolution.
See the inpainting article for a step-by-step guide.
Automatic inpainting
If you use Stable Diffusion to generate images of people, you will find yourself doing inpainting quite a lot. The process is mechanical and time-consuming. Why not automate it? The Adetailer extension does just that.
Face Restoration
Turn on face restoration to fix faces and eyes if your GUI supports it. See my previous post for details. If you are using a free site with no built-in face restoration support, use the following sites for post-processing.
In AUTOMATIC1111, you can enable Face Restoration on the Settings page > Face Restoration > Select Restore Faces.
Adjust the Codeformer weight to the lowest effect (highest value) you can get away with.
The drawback of this approach is that it may affect the style. The restored faces may have a slightly different style than the rest of the image.
Remember to turn it off when you are done.
Use an improved VAE
Do you know Stability AI released a patch to v1.4 and v1.5 models to fix eyes? They are called VAE. Check out this article for a guide to installing and using.
Use Hi-Res Fix
A garbled face is often caused by insufficient pixel coverage: The face is not covered by enough pixels to be rendered correctly.
To enable Hi-Res Fix, Click the Hires. Fix section on the txt2img page in AUTOMATIC1111. The default setting is good to go. Adjust the Upscaling by factor to adjust the final image size.
Messed-up finger
It’s well-known in the stable diffusion community that AI has problems getting fingers right. It is common to see distorted, too many or too few fingers.
The first fix is to include keywords that describe hands and fingers, like “beautiful hands” and “detailed fingers”. That tends to prime the AI to include hands with good details.
The second fix is to use inpainting. Create a mask in the problematic area. Use inpainting to generate multiple images and choose the one you like. I found it sufficient to reuse the same prompt as the original image.
Summary
In this post, we have detailed the solutions to the problems of two heads, not showing full-body, garbled faces and fingers.
Check out this article for advanced prompt techniques.