Nodes/ComfyUI_RandomPerson/Random Person: Hair
ComfyUI Node

Random Person: Hair

Hair is cheap identity. This node randomises it properly.

By bradsec·Created 2 months ago·Updated 2 months ago· 5
Random Person: Hair
    • full_hair_description
    • sex
    • hair
    • facial_hair
    • seed
    seed0
    randomizetrue
    sexrandom
    hair_color_moderandom
    hair_color_allow_list
    hair_color_fixed(none)
    hair_style_moderandom
    hair_style_allow_list
    hair_style_fixed(none)
    hair_length_moderandom
    hair_length_allow_list
    hair_length_fixed(none)
    facial_hair_modeoff
    facial_hair_allow_list
    facial_hair_fixed(none)
    extra_attributes

    Hair is the cheapest way to make two people look different. Change the colour, the style, the length, and suddenly a crowd reads as individuals instead of the same face repainted. Random Person: Hair is the segment node from ComfyUI_RandomPerson that handles exactly that: hair colour, style, length, and facial hair, drawn per-seed from sex-aware JSON lists into one tidy comma-separated fragment.

    It shares its engine with the pack's other segment nodes and the big AIO. Run it solo when hair is the only thing you care about, or stack it with Identity, Face, Body, and Style and concatenate the fragments for a full person - again, set the same sex on each so the pieces agree.

    What it generates

    • hair colour - 28 options from ash blonde and chestnut brown to platinum and fire-engine territory (the allow_list accepts literal custom colours too)
    • hair style - the deep one, 57 entries: afro, bun, braids, bob, buzz cut, pompadour, twist out, locs…
    • hair length - very short through very long, plus shaved
    • facial hair - clean shaven, stubble, short/full beard, goatee, moustache, mutton chops, soul patch, van dyke (defaults off)

    The sex-awareness is the interesting part here, and it's baked into the data, not bolted on. The dropdowns union male and female values so the node is valid for any sex, and a small JS extension filters them once you pick male or female. Females never roll facial hair - the female facial-hair list is literally just "clean shaven", which contributes an empty description - and males get the beard list instead. Hair styles are gated the same way: pompadour, crew cut, and skin fade are male entries; space buns, curtain bangs, and twist out are female. Because the description is assembled as "auburn long hair worn loose waves", the output reads naturally in a prompt.

    The inputs that matter

    Standard pack pattern, three widgets per attribute: _mode (random/allow_list/fixed/off), _allow_list (comma-separated subset, unknown values kept literally), and _fixed (dropdown value for fixed mode). So hair_style_allow_list: bun, braids, ponytail rolls within three styles, or hair_color_fixed: auburn locks the colour while style and length randomise. extra_attributes appends free text verbatim.

    seed plus randomize is the usual: randomize on (default) gives a fresh hairstyle every run; off means the same seed reproduces the same hair.

    Outputs and wiring

    • full_hair_description - the assembled fragment, e.g. red very short hair worn twist out or auburn long hair worn loose waves
    • sex - resolved sex, for syncing with sibling nodes
    • hair - the colour+length+style combo on its own pin
    • facial_hair - the beard/stubble value alone (empty when off or for a female)
    • seed - INT

    Wire full_hair_description into a CLIP Text Encode's text input, or into a string concat node alongside the other segments. For a varied crowd, leave randomize on and batch.

    Install and gotchas

    ComfyUI Manager: search ComfyUI_RandomPerson, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bradsec/ComfyUI_RandomPerson
    

    It's under Add Node → Random Person. No pip dependencies, Python 3.10+, registers on both V1 and V3 APIs so it loads anywhere.

    The common annoyance: forget you left facial_hair off and your male characters are all clean-shaven by default. That's by design - flair categories start off - but it surprises people. Also, the sex filter only kicks in once you set the sex dropdown; at sex: random the node still picks a real male or female internally and draws only from that sex's lists - so a female-only style like a twist out can show up on what turns out to be a female person. If you need tight control, set a concrete sex.

    CategoryRandom Person

    Inputs (16)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000Seed for reproducibility. With randomize off, the same seed reproduces the same person.
    randomizeBOOLEANtrueOn: pick a new random person every run, ignoring the seed widget. Off: use the seed.
    sexCOMBOrandomrandom, male, or female. male/female filter the sex-specific dropdowns in the UI.
    hair_color_modeCOMBOrandomHow this attribute is chosen: random (any), allow_list (subset you list), fixed (the dropdown value), off (omit it).
    hair_color_allow_listSTRINGComma-separated values used when mode=allow_list. Unknown values are added as literal descriptors.
    hair_color_fixedCOMBO(none)Exact value used when mode=fixed. (none) falls back to random.
    hair_style_modeCOMBOrandomHow this attribute is chosen: random (any), allow_list (subset you list), fixed (the dropdown value), off (omit it).
    hair_style_allow_listSTRINGComma-separated values used when mode=allow_list. Unknown values are added as literal descriptors.
    hair_style_fixedCOMBO(none)Exact value used when mode=fixed. (none) falls back to random.
    hair_length_modeCOMBOrandomHow this attribute is chosen: random (any), allow_list (subset you list), fixed (the dropdown value), off (omit it).
    hair_length_allow_listSTRINGComma-separated values used when mode=allow_list. Unknown values are added as literal descriptors.
    hair_length_fixedCOMBO(none)Exact value used when mode=fixed. (none) falls back to random.
    facial_hair_modeCOMBOoffHow this attribute is chosen: random (any), allow_list (subset you list), fixed (the dropdown value), off (omit it).
    facial_hair_allow_listSTRINGComma-separated values used when mode=allow_list. Unknown values are added as literal descriptors.
    facial_hair_fixedCOMBO(none)Exact value used when mode=fixed. (none) falls back to random.
    extra_attributesSTRINGFree text appended to the description as-is, comma-separated. Pose, setting, props, extra detail, etc.

    Outputs (5)

    NameTypeDescription
    full_hair_descriptionSTRING
    sexSTRING
    hairSTRING
    facial_hairSTRING
    seedINT