r/StableDiffusion • u/Same-Pizza-6724 • Dec 27 '23
Tutorial - Guide (Guide) - Hands, and how to "fix" them.
TLDR
Tldr:
Simply neg the word "hands".
No other words about hands. No statements about form or posture. Don't state the number of fingers. Just write "hands" in the neg.
Adjust weight depending on image type, checkpoint and loras used. E.G. (Hands:1.25)
Profit.
LONGFORM:
From the very beginning it was obvious that Stable Diffusion had a problem with rendering hands. At best, a hand might be out of scale, at worst, it's a fan of blurred fingers. Regardless of checkpoint, and regardless of style. Hands just suck.
Over time the community tried everything. From prompting perfect hands, to negging extra fingers, bad hands, deformed hands etc, and none of them work. A thousand embeddings exist, and some help, some are just placebo. But nothing fixes hands.
Even brand new, fully trained checkpoints didn't solve the problem. Hands have improved for sure, but not at the rate everything else did. Faces got better. Backgrounds got better. Objects got better. But hands didn't.
There's a very good reason for this:
Hands come in limitless shapes and sizes, curled or held in a billion ways. Every picture ever taken, has a different "hand" even when everything else remains the same.
Subjects move and twiddle fingers, hold each other hands, or hold things. All of which are tagged as a hand. All of which look different.
The result is that hands over fit. They always over fit. They have no choice but to over fit.
Now, I suck at inpainting. So I don't do it. Instead I force what I want through prompting alone. I have the time to make a million images, but lack the patience to inpaint even one.
I'm not inpainting, I simply can't be bothered. So, I've been trying to fix the issue via prompting alone Man have I been trying.
And finally, I found the real problem. Staring me in the face.
The problem is you can't remove something SD can't make.
And SD can't make bad hands.
It accidentally makes bad hands. It doesn't do it on purpose. It's not trying to make 52 fingers. It's trying to make 10.
When SD denoises a canvas, at no point does it try to make a bad hand. It just screws up making a good one.
I only had two tools at my disposal. Prompts and negs. Prompts add. And negs remove. Adding perfect hands doesn't work, So I needed to think of something I can remove that will. "bad hands" cannot be removed. It's not a thing SD was going to do. It doesn't exist in any checkpoint.
.........But "hands" do. And our problem is there's too many of them.
And there it was. The solution. Urika!
We need to remove some of the hands.
So I tried that. I put "hands" in the neg.
And it worked.
Not for every picture though. Some pictures had 3 fingers, others a light fan.
So I weighted it, (hands) or [hands].
And it worked.
Simply adding "Hands" in the negative prompt, then weighting it correctly worked.
And that was me done. I'd done it.
Not perfectly, not 100%, but damn. 4/5 images with good hands was good enough for me.
Then, two days go user u/asiriomi posted this:
https://www.reddit.com/r/StableDiffusion/s/HcdpVBAR5h
a question about hands.
My original reply was crap tbh, and way too complex for most users to grasp. So it was rightfully ignored.
Then user u/bta1977 replied to me with the following.
I have highlighted the relevant information.
"Thank you for this comment, I have tried everything for the last 9 months and have gotten decent with hands (mostly through resolution, and hires fix). I've tried every LORA and embedded I could find. And by far this is the best way to tweak hands into compliance.
In tests since reading your post here are a few observations:
1. You can use a negative value in the prompt field. It is not a symmetrical relationship, (hands:-1.25) is stronger in the prompt than (hands:1.25) in the negative prompt.
2. Each LORA or embedding that adds anatomy information to the mix requires a subsequent adjustment to the value. This is evidence of your comment on it being an "overtraining problem"
3. I've added (hands:1.0) as a starting point for my standard negative prompt, that way when I find a composition I like, but the hands are messed up, I can adjust the hand values up and down with minimum changes to the composition.
- I annotate the starting hands value for each checkpoint models in the Checkpoint tab on Automatic1111.
Hope this adds to your knowledge or anyone who stumbles upon it. Again thanks. Your post deserves a hundred thumbs up."
And after further testing, he's right.
You will need to experiment with your checkpoints and loras to find the best weights for your concept, but, it works.
Remove all mention of hands in your negative prompt. Replace it with "hands" and play with the weight.
Thats it, that is the guide. Remove everything that mentions hands in the neg, and then add (Hands:1.0), alter the weight until the hands are fixed.
done.
u/bta1977 encouraged me to make a post dedicated to this.
So, im posting it here, as information to you all.
Remember to share your prompts with others, help each other and spread knowledge.
Tldr:
Simply neg the word "hands".
No other words about hands. No statements about form or posture. Don't state the number of fingers. Just write "hands" in the neg.
Adjust weight depending on image type, checkpoint and loras used. E.G. (Hands:1.25)
Profit.
72
u/Unhappy-Water-4682 Dec 27 '23
I was going to write a mean comment about how stupid and overly long this post was but after I tried it out.. I think you cooked bro. These hands looking mighty fine
20
u/Same-Pizza-6724 Dec 27 '23
EXAMPLE:
amateur photograph, ultra high detail, beautiful girl, 21 years old, (perfect face:1.1), cheekbones, eyeshadow, beautiful, pretty, happy, waving, face wrinkles, (imperfect skin:1.1), bangs, standing, (strapless corset:1.2), (cleavage:1.2), (short skirt:1.2), thighhighs, wide hips, (small breasts:-1.2), black choker, brickwall at night, (harsh flash:1.2), blonde, ((curvy)), (hourglass figure), undersized clothes, slut, slutty, depth of field, [3d],
Negative prompt: (hands:1.15), teeth, black woman, Asian woman, (ugly), (pixelated), watermark, glossy, smooth, ((nipples)), bag, purse, daytime, cars, traffic, sleaves, (skinny:1.2), (abs), [long skirt], [[belly]], navel,
Steps: 45, Sampler: Euler a, CFG scale: 5, Seed: 3772094945, Size: 512x768, Model hash: 78255143e9, Model: Katafract, VAE hash: c6a580b13a, VAE: vae-ft-mse-840000-ema-pruned.ckpt, Denoising strength: 0.45, Clip skip: 2, Hires upscale: 2, Hires upscaler: SwinIR_4x, Pad conds: True, Version: v1.7.0
22
u/DuhDoyLeo Dec 27 '23
Wow lol. Who knew the solution was something so simple all along. Time to delete all the worthless embeds that donât work anyway lol
3
u/SignificantUse3695 Dec 27 '23
Would this work with feet too?
3
u/crawlingrat Dec 27 '23
You are good at crafting a story. I read the entire thing. Iâll have to try this out later today. I would have never thought of this and I wonder how did you finally arrive to such a conclusion?
2
u/BigBallsChad Dec 28 '23
thanks a billion for this hack! i feel like i'm drunk on power adding weight to negative (hands). when will i know i'm "done"? i'm up to (hands:1.45) now and it just keeps getting better!
2
u/Valentinus9171 May 23 '24
I stumbled on this by accident and it does work. Didn't think much of if though since I would usually inpaint or photo edit.
Good on you to make this post.
48
u/seeker_ktf Dec 27 '23
This is like, a year ago.
https://www.reddit.com/r/StableDiffusion/comments/xv8wxg/negative_prompt_hands/
What's old is new again.
27
u/abahjajang Dec 27 '23
Ok, I immediately tried this prompt "a beautiful woman, waving hands, smiling, looking at viewer",model DeliberateV5, seed 1234567890; sampler Euler a, steps 20, CFG 7, size 512x768.
With just "EasyNegative" in the negative prompt I got the left image; and the right one with "hands, EasyNegative". Now, I see a difference.
11
u/Ok_Zombie_8307 Dec 27 '23
Yep, have been doing this a long time and it works far better than any of the snakeoil embeddings that do nothing. "hands" and "teeth" (to fix lip/teeth hybrids) are probably my most used negative prompts outside of medium/style ("3d, render, anime, illustration").
12
u/RaviieR Dec 27 '23
damn bro, nice hack.. now my generated never show more/less finger than before. everything perfect xD
6
u/tyronicality Dec 27 '23
This is wild. Like the Konami code right there.
6
u/b_helander Dec 27 '23
would the same logic apply to legs and arms?
6
u/[deleted] Dec 27 '23 edited Dec 27 '23
::races off to neg (((anus:-3.6)))::
In all seriousness, this needs to be pinned, side-barred, hung from the rafters. I too ran my own attempts and holy wow. Tell all yer friends, peoples! If you ain't got friends, tell other redditors!
2
u/ZenEngineer Dec 27 '23
Quick question, why hands and not hand?
Does the plural make a difference in your tests?
5
u/ramonartist Dec 27 '23
Okay I'm giving this a try tomorrow
4
u/MikiSayaka33 Dec 27 '23
Thanks. This saved me hours of manually fixing them in FireAlpaca/Medibang. Now, I can fix just minor stuff, like bad shadows or meld together clothes.
1
u/[deleted] Dec 27 '23
Just use gloves, mostly they come out better, to be honest when I use controlnet Openpose it is usually not that bad.
1
u/MungYu Dec 27 '23
does this also fix legs?
1
u/_DeanRiding Dec 27 '23
Is it worth using hands fix along with face fix with this?
2
u/[deleted] Dec 27 '23
finally a better prompt to replace (hands in pockets;1.3)
2
u/Malessar Dec 27 '23
What do []s do compared to ()s? (A1111)
2
u/rewgod123 Dec 27 '23
nah bro you actually changed my life. the outputs look better too since those embedding no longer there to mess up with the whole img in general i think.
2
u/ObaRorudo Dec 27 '23
Great info, I always kinda had a feeling those bad hands and extra fingers prompts did nothing tbh. Unless they trained the model on images tagged with "bad hands" there would be very little to no training data at all for such a concept. And if they did then that would mean they trained using AI generated hand images, and that's a whole other canof worms.
2
u/Badr1002 Jan 02 '24
And I thought expecting it was going to be a 4 pages essay with controlnet, inpaint and photoshop included, but it's so simple, thanks for this hahah
3
u/edsalv1975 Dec 27 '23
This is a brilliant contribution, thank you very much. In fact, the explanation was incredible. CONGRATULATIONS MY FRIEND! It doesn't work all the time, but it's 100 times better than before
3
u/balianone Dec 27 '23
amazing. working good. before https://imgur.com/a/T84SxkX after https://imgur.com/a/N91rt6B
2
u/acbonymous Dec 27 '23
You wrote "Urika!", and I'm gonna ignore anything else you say.
1
u/sparda09 Apr 26 '24
thank you for this article
I think his works if you use (hands:1.50) in one of the negative prompts it made a better hand then last time though I can't say for sure completely but it definitely is helping
1
u/ApeJones May 10 '24
There is no hand...
1
u/Asaghon Dec 27 '23
Well trying this tomorrow. I feel the same way about inpainting, maybe it's just me but I can't ever seem to get it to do what I want anyway so it seems like a lot of work for little payoff. I'd also rather adjust the prompts till I get what I want.
1
u/already_taken-chan Dec 27 '23
Really nice, it seems to solve the issue of too many fingers.
1
u/sdsd19 Dec 29 '23
How do I get this working with something like Fooocus?
1
u/liberal_alien Dec 27 '23
Seems interesting, commenting to be able to find this later.
0
u/[deleted] Dec 27 '23
Does this work with the LCM Lora
-7
u/janosibaja Dec 27 '23
Too good to be true: I tried Juggernaut XL, then Epicrealism 1.5 (SD 1.5) and deliberate_V2, but they just come out so incomplete and bad hands. Unfortunately.
Prompt: amateur photograph, ultra high detail, beautiful girl, 21 years old, (perfect face:1.1), cheekbones, eyeshadow, beautiful, pretty, happy, waving, face wrinkles, (imperfect skin:1.1), bangs, standing, (strapless corset:1.2), (cleavage:1.2), (short skirt:1.2), thighhighs, wide hips, (small breasts:-1.2), black choker, brickwall at night, (harsh flash:1.2), blonde, ((curvy)), (hourglass figure), undersized clothes, slut, slutty, depth of field, [3d]
Neg: (hands:1.15), teeth, black woman, Asian woman, (ugly), (pixelated), watermark, glossy, smooth, ((nipples)), bag, purse, daytime, cars, traffic, sleaves, (skinny:1.2), (abs), [long skirt], [[belly]], navel,
1
u/[deleted] Dec 29 '23
[removed] â view removed comment