Mpi RandPromptGen
A random prompt factory that actually thinks in sections
- overrides
- positive
- negative
- sections
- save_preset
Most random-prompt generators just grab a line from a text file and call it a day. Mpi RandPromptGen is built differently: it composes a prompt from named sections - shot type, hair, clothes, pose, expression, location, lighting - each drawn from a preset list, then assembled into a coherent sentence. It's the difference between "a random string of tags" and "a random person in a random place with consistent grammar."
It's the centerpiece of the ComfyUi-MpiNodes prompt-generation family, and it sits above a filesystem of preset JSON - which is both its power and its learning curve.
How it works
Every run, the node rolls each section and stitches them together with the pack's preset word order and transitions. The sections and their controls:
preset_folder- the folder holding your preset lists. The node reads asettings.jsonplus per-section list files from here, and its defaults ship in the pack'suser/prompt_gen_preset/folder.indoors_outdoors- 0 = indoors, 100 = outdoors, 50 = coin flip. Drives which location/lighting/clothing-set lists get used.pronoun- random, she, he, they, or it.shot_type,hair_styles,clothes,pose,expression- each an enum withrandomandnoneoptions on top of the preset entries.light_type- bright/dark toggle for the lighting section.pre_positive/post_positive- your own fixed text bookending the generated middle.seed- the whole roll is seed-driven, so lock it and the same run reproduces the same prompt.
It outputs positive and negative (the generated strings), sections (the raw section picks, for debugging), and save_preset (a preset object you can hand to MpiRandPromptGenSave to persist a configuration).
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
Restart, or ComfyUI Manager → search ComfyUi-MpiNodes. No pip deps or model downloads - but the preset files live inside the pack, so a fresh install has defaults, and your own preset folders are yours to create. AGPL-3.0 from v1.2.7 (MIT through 1.2.6).
The honest take
Two things to know before you fall in love. First, the shipped defaults are aimed at a particular aesthetic - the clothing enums include nude, bikini, lingerie, and the expressions skew playful. If that's not your genre, you'll want your own preset folder fast, and the MpiRandPromptGenOverrideList node is the clean way to swap lists without editing files. Second, this is an adult-content-flavored tool by default; a lot of the community's random-prompt generators are, and it's worth knowing what you're installing alongside the utility nodes. With your own presets it's a genuinely good character-variation engine - the sectioned grammar is the feature, not the bundled content.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| preset_folder | STRING | path/to/preset_folder | |
| pre_positive | STRING | — | |
| indoors_outdoors | INT | 500–100 | 0 = indoors 100 = outdoors 50 = 50% chance of either |
| pronoun | COMBO | 5 options: random, she, he, they, it | |
| shot_type | COMBO | 8 options: random, none, close up shot, medium shot, full body shot, selfie shot from above, +2 | |
| hair_styles | COMBO | 5 options: random, none, long wavy ginger hair in a ponytail, straight long hair with pink highlights, long dark brown hair in buns with orange highlights | |
| clothes | COMBO | 5 options: random, nude, set, bikini, lingerie | |
| pose | COMBO | 5 options: random, none, touching hair, hands on hips, crossed arms | |
| expression | COMBO | 9 options: random, none, smile, wink, tease, playful, +3 | |
| light_type | BOOLEAN | true | — |
| post_positive | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
| overridesopt | MPI_RANDPROMPT_OVR | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| positive | STRING | — |
| negative | STRING | — |
| sections | STRING | — |
| save_preset | MPI_PROMPT_PRESET | — |