Sign In

Guide: Using Facial Analysis Data for Prompting Unique, Detailed Faces

Guide: Using Facial Analysis Data for Prompting Unique, Detailed Faces

Prompting for photorealistic people is usually quite simple and straight-forward, and usually it's only the hands that frustrate us.

For example, in EpiCPhotoGasm model, a simple prompt like "a beautiful 20-years-old Asian woman smiling and looking at camera" will produce a very realistic 'photo'. However, do this with a batch of 20 gens, and you'll find that around 50% or more of the faces look generally the same.

Of course adding prompt details like "soft oval face", "heart-shaped lips", "freckles", and other modifiers will provide good alterations, but many people generally don't understand the wide range of facial features that people can have, how to analyze/visualize them, and how to stuff them into a prompt without over-cooking the output.

So let's start mapping out some faces and figuring out what sort of details we can include into our prompts.

Section 1: Using Facial Analysis Data

For starters, you want to familiarize yourself with facial aesthetics and terms used. There are a couple online tools I recommend here:

1) https://www.faceshape.com/ (alternative - https://www.faceshapedetector.com/) - This will tell you basic face shape like (Oval, Triangle) with a couple other details like (Angular jaw, long face).

2) https://www.betaface.com/demo.html - This will give you a huge wall of "facial analysis data" which is hard to read, but we can use ChatGPT to turn it into a keyword-based list of prominent features.

So now let's get some facial data and run it through ChatGPT for an analysis of keywords to turn into a prompt:

5oclock shadow: no, age: 17 (60%), arched eyebrows: yes (35%), attractive: yes, bags under eyes: no, bald: no (95%), bangs: no (71%), beard: no, big lips: no (23%), big nose: no, black hair: no (49%), blond hair: no, blurry: no, brown hair: yes (77%), bushy eyebrows: yes (2%), chubby: no (92%), double chin: no, expression: neutral (82%), gender: female (93%), glasses: no, goatee: no, gray hair: no, heavy makeup: yes (95%), high cheekbones: no (52%), mouth open: no (86%), mustache: no, narrow eyes: no (56%), oval face: yes (91%), pale skin: yes (47%), pitch: -8.73, pointy nose: yes (10%), race: asian (52%), receding hairline: no (75%), rosy cheeks: no (60%), sideburns: no, straight hair: no (8%), wavy hair: yes (17%), wearing earrings: no (0%), wearing hat: no, wearing lipstick: yes (91%), wearing necklace: no (51%), wearing necktie: no (73%), yaw: 8.82, young: yes, chin size: extra small, color background: a9abae (4%), color clothes middle: 212026 (12%), color clothes sides: 212026 (1%), color eyes: 3f2926 (29%), color hair: 392622 (76%), color skin: cfa793, eyebrows corners: average, eyebrows position: extra low, eyebrows size: extra thin, eyes corners: average, eyes distance: far, eyes position: low, eyes shape: extra round, glasses rim: no, hair beard: none, hair color type: brown (76%), hair forehead: yes, hair length: very short, hair mustache: none, hair sides: thin, hair top: short, head shape: average, head width: wide, mouth corners: low, mouth height: average, mouth width: extra small, nose shape: extra straight, nose width: extra wide, teeth visible: no,

Prompt to ChatGPT: Extract the most prominent (high-confidence rating) facial features from this analysis and summarize it into a keyword-based list, excluding makeup, age, attractiveness, and clothing. Focus only on defining facial features. Use slightly descriptive terms and real colors instead of hex. You can include any unique features if they help describe the person's unique facial traits.

Please turn that into a keyword-based prompt for an AI image generator. Do not be narrative, use only a keyword-based approach seperated by commas.

ChatGPT's output: Female, Asian, arched eyebrows, brown hair, bushy eyebrows, oval face, pale skin, pointy nose, chin size extra small, eye color brown, hair color brown, very short hair length, eyes distance far, skinny body, wide head, small mouth, straight nose, very wide nose, teeth hidden.


And now let's copy that into our SD prompt, making any adjustments you feel necessary:

Okay, not bad! If you're using SD WebUI Prompt All-In-One, it should have automatically formatted that prompt and you can tweak weights further with a click of your mouse.

Section 2: Combining Features & Races

Now let's try to get even more unique facial features by combining traits and races.

Useful guides:

  1. https://www.nextdiffusion.ai/tutorials/prompt-editing-in-stable-diffusion-merging-images-seamlessly

  2. https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#prompt-editing

Let's touch on the core syntax involved here, it's incredibly simple:

[from:to:when]

First thing you wanted generated:Second thing you want generated:When SD should start focusing on the second thing, either in decimal or steps.

E.G if you do 30 steps, you can use 0.5 or 15 as the weight, as both would be half of 30.


Example:

a [Chinese:German:0.5] woman

As you can see, it created a distinctly German woman with strong Caucasian face, but in traditional Chinese clothing. Let's try to blend the ethnicity a bit more by adding more detail to the prompt:

a [Chinese woman with almond-shaped eyes and high cheekbones:German woman with blue eyes and a strong jawline:0.5]

Great stuff! We clearly see features of both races blending into the generated image. So let's try something a bit more technical and complex, with more weights and parentheses:

a [(Chinese woman with almond eyes, high cheekbones, and straight dark hair):(German woman with blue eyes and a pronounced chin, blonde hair and freckles):0.35][brown eyes:0.7]

Okay, here the facial quality is starting to degrade a little. This is because it generated a medium-shot where face details are harder for the AI to focus on.

Let's clean that up with ADetailer in the next section.

Section 3: Using ADetailer + LoRAs

There are plenty of guides on installing and using ADetailer, so DYOR/RTFM because it's really easy. However what I want to touch on is that we can focus on generating the main image in txt2img prompt, and cleaning up the facial details in ADetailer.

The great thing about ADetailer is that it accepts the same sort of complex prompts and even LoRAs, so we can really fine-tune the results. So let's try regening the last image with the same seed, but add more specific face details to our ADetailer prompt, complementing the main prompt but really focusing on extra details:

Main Prompt: a [(Chinese woman with almond eyes, high cheekbones, and straight dark hair):(German woman with blue eyes and a pronounced chin, blonde hair and freckles):0.35][brown eyes:0.7]
ADetailer Prompt: a [(Chinese woman with a small mole above her left lip and thin eyebrows):(German woman with plump lips and high defined cheekbones):0.35][brown eyes:0.7]

The result:

Model: EpicPhotoGasm V4

Now we have a much better face with a bit more blending between Chinese:German ethnicity. Well, Chinese:German hapas are fairly common in Europe, so let's try something a little less common:

Female,[Chinese:African:0.5],brown skin,arched eyebrows,brown hair,bushy eyebrows,oval face,small nose,chin size extra small,eye color brown,(black hair),wavy hair,eyes distance far,skinny body,wide head,small mouth,straight nose,very wide nose

Model: EpicPhotoGasm X

Wowies, I think I'm in love ♥♥♥

Alternatively:

Young female,[Chinese woman with almond-shaped eyes and oval face:African woman with plump lips and short nose, triangle face:0.45],black hair,shoulder-length curly hair,light makeup: mascara,blush,soft pink lipstick

Happy generating!


Credits / Tools Used:

Model: EpicPhotoGasm V4 (and latest X) https://civitai.com/models/132632/epicphotogasm

Lora: epiCRealLife Enhancer https://civitai.com/models/140993

WebUI Extension: SD WebUI Prompt All-In-One

84

Comments