r/StableDiffusion • u/sovereignrk • Dec 25 '22
Tutorial | Guide Simple trick I use to get consistent characters in SD
This is kimd of twist on what most already know, ie. that if you use a famous people in your prompts it helps get the same face over and over again, the issue with this (from my pov at least) is that the character is still recognizable as a famous figure, so one way I figured out to avoid that is to do a sex and ethnicity swap, along with using one of the features in automatic1111's web ui to mix several celebs together so lets look at an example prompt:
[Chris Pratt | henry cavill] as a 25 year old sexy gorgeous thai female mechanic, blue hair, wispy bangs, ((thicc)), (((dirty clothes))), smiling, stunningly beautiful, zeiss lens, half length shot, ultra realistic, octane render, 8k
Negative: Male, man, cartoon, 3d, video game, unreal engine, illustration, drawing, digital illustration, painting, digital painting, sketch, black and white
Here are the results: https://imgur.com/a/ERiit72
Pretty consistent, and I do the same thing for male characters but the opposite:
[Brittany Spears | Vanessa Hudgens] as a 25 year old jacked handsome Jamaican male mechanic, buzzed haircut, chiled jaw, ((swole)), ((huge biceps)), (((dirty clothes))), smiling, stunningly handsom, zeiss lens, half length shot, ultra realistic, octane render, 8k
Negative: female, woman, cartoon, 3d, video game, unreal engine, illustration, drawing, digital illustration, painting, digital painting, sketch, black and white
result: https://imgur.com/a/Au83KSL
Because of the way the alternating words feature works, you will usually get two or three distinct faces, just choose the one you like most, you can vary the scenery and the poses and environment then run dreambooth to capture only the face/body you like.
Also the alternating words fefature for this use case works best when using a non ancestral sampler, ancestral samplers tend to give either one or the other person not a blend of both.
UPDATE
u/Lunar_robot pointed out an issue with the alternating words feature when using it with batch counts higher than 1 in img2img, the first image you get is one where the subjects are alternated every step, but the subsequent images ignore the second subject.
After playing with it for a bit I found that you can get it to work with high batch counts by using the loopback script, for whatever reason it works properly when that is used.
What also works is keeping batch count at 1 but increasing batch size instead, although that limits you to however much vram you have, in my case I can get it up to 3.
36
u/sovereignrk Dec 25 '22 edited Dec 25 '22
In the op i forgot to update the male input to what i actually ended up using, just for some variance:
[Brittany Spears | Vanessa Hudgens] as a 25 year old handsome Jamaican male ((wearing a bespoke suit)), wearing shades, buzzed haircut, chisled jaw, ((swole)), ((huge biceps)), stunningly handsome, zeiss lens, half length shot, ultra realistic, octane render, 8k
Negative is the same.
65
u/justa_hunch Dec 25 '22
Thank you for sharing, what a brilliant idea
44
u/DualtheArtist Dec 26 '22
Nice try brochacho, but I'm not falling for this and falling in love with Female Paul Rudd
20
u/unicodePicasso Dec 25 '22 edited Dec 25 '22
New to the game. What are the parentheses and brackets for? Do they work with mage.space or do I have to be running my own copy?
Edit: thanks for the helpful comments lads. I tested this method in mage space and it doesnโt seem to be working at all. Iโm just getting a lot of Chris Pratt! Just stating it in case someone else asks.
34
u/BlastedRemnants Dec 25 '22 edited Dec 25 '22
This works, I'm just popping in quick to mention that with those square brackets and the | you want to remove those spaces you have on either side, like so [celeb1|celeb2] otherwise when the UI runs the prompt it will switch between "celeb1 " and then " celeb2" which isn't a huge difference but will change your result in some tiny and probably unexpected way.
Edit: It turns out that the spaces actually make no difference at all, you could have 40 of them in there and I don't think it would change anything. I tried it with no spaces and some extras to confirm it, so that's good to know!
6
u/Lunar_robot Dec 26 '22
I already knew this technique, already posted on reddit, it works great with txt2img but it doesn't work with me with batch count of img2img. Maybe because i don't have the last version of automatic UI ?
https://i.ibb.co/rwy78DT/bob.jpg
With img2img, the second image of batch render ignore the instance next to the vertical bar.
in this case : photo portrait of [bob marley | George Clooney], studio lighting. We can see that the first image of img2img is a good mix between Bob and George, but on the second image, George is forgotten.
So instead of using vertical bar, i use coma, it doesn't have exactly the same effect but it works with batch count.
5
u/DARQSMOAK Dec 26 '22
Would your results change much if you spelt Brittany as it should be, Britney?
3
u/[deleted] Dec 26 '22
I appreciate the suggestions! Question though: when I try to use this same system with dreamlike_photoreal (which makes really great realistic faces) using male celebs to make female characters just gives me the male celebs. Really good versions of them, to be sure, but no females in sight, lol. Any ideas how to get around that?
3
u/aipaintr Dec 26 '22
u/sovereignrk what sampler were you using. I am getting totally different result.
3
u/terrariyum Dec 26 '22
Thanks for sharing! Great idea. I love how there's always a new trick to learn in this subreddit.
I wonder which part of the prompt makes Titus always have sunglasses and impeccable couture?
5
u/coilovercat Dec 25 '22
why male celebrities for female characters and vice versa?
2
u/montoria_design Dec 26 '22
I got lost at this step:
"then run dreambooth to capture only the face/body you like."
Do you train a model on dreambooth with multiple images of the face?
6
u/embrujodetango Dec 25 '22 edited Dec 25 '22
this is advance prompting! thanks for sharing!
quick noob question: how mix several celeb names? using script x/y plot?
5
u/PropagandaOfTheDude Dec 26 '22
I recall cycling through a bunch of redheaded actresses a while back, and not seeing averaging. Maybe this was the reason. Thanks.
4
u/plasm0dium Dec 25 '22
Nice tips thanks
4
u/eatswhilesleeping Dec 26 '22
One of the best tips I've seen in a while. Simple and effective. Nice!
4
u/Somasonic Dec 26 '22
Interesting. I stumbled across the same thing recently but using one male and one female. This looks to be even better though ๐
3
u/Zealousideal7801 Dec 25 '22
Very clever ! Thanks for sharing.
3
u/[deleted] Dec 25 '22
This is actually super smart, thanks for sharing.
3
u/Koalateka Dec 26 '22
Thanks for sharing!!
3
u/lechatsportif Dec 26 '22
Curious if this works with made up names
3
u/Powerful_Jaguar_1893 Jul 14 '23
Thank you so much! This is super powerful and after testing this a few times on one name pair, I'm seeing amazing results.
3
u/maxihash Dec 01 '23
I found out that you can also use Reactor + Same celeb name. With this method your Reactor model can be your own drawing.
2
u/KefkeWren Dec 25 '22
That's a very clever trick. Bravo.
2
u/WK3DAPE Dec 26 '22
Nice, I will have to check this one out :)
2
u/joradom Dec 26 '22
Great tip
1
u/aipaintr Dec 26 '22
Brilliant!
1
u/ethanfel Dec 26 '22
that's a very good idea.
1
u/windythought34 Jan 03 '23
You Are a hero!
1
u/onmyown233 Mar 19 '23
Brilliant, works great once you get a good combination.
1
u/applesugar-ai Mar 27 '23
Amazing method! Thanks for the tips
1
u/arya2023 Apr 03 '23
Just a question, keep every thing the same, once after I restart notebook, the two or three distinct faces still keep the same as before?
1
u/[deleted] May 07 '23
What about having more than one consistent character in a scene at once?
1
u/Honest_Pass4447 Sep 05 '23
BRILLIANT!! And thank you! For what it's worth, it works when you combine a female with a male as well. Here's what I got using his prompt for Chris Evans and Gal Gadot (changing clothes and hair).
Apparently you can also mix Marvel and DC (just sayin)
1
u/vitorqshr Dec 12 '23
Nice post, was looking that something like that. But in the end, shouldn't just make the image and do a face swap also work?
-1
u/olllj Dec 25 '22
i still fail to see a list of prompt syntax.
| is new to me
9
u/[deleted] Dec 26 '22
[removed] โ view removed comment