Nodes/comfyui-mixlab-nodes/Random Prompt ♾️Mixlab
ComfyUI Node Runs on cloud

Random Prompt ♾️Mixlab

Shuffle a word list into batches of prompts

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Random Prompt ♾️Mixlab
  • seed
  • STRING
max_count9
mutable_promptSwing Slide Climbing frame Sandbox See-saw Merry-go-round Jungle gym Trampoline Monkey bars Rocking horse Playhouse Hopscotch Balance beam Spring rider Water play area Ball pit Tunnel Zip line Basketball hoop Bicycle rack Spinner Climbing wall Rope ladder Tetherball Flying fox Swinging bridge Spiral slide Water sprinkler Pedal go-kart Miniature golf course
immutable_promptsticker, Cartoon, ``
random_sample

You've got a list of options - thirty types of playground equipment, say - and you want the model to riff through them without you hand-editing the prompt each run. RandomPrompt takes a list, randomly picks from it, and drops the pick into a fixed template. It's the quick way to spin up variety, or to generate a whole batch of themed prompts in one shot.

How it works

You give it two blocks of text. The mutable_prompt is your pool of options, one per line. The immutable_prompt is the fixed scaffolding that every prompt shares - style, format, quality tags - with a placeholder (the pack uses backticks, ``) marking where the random pick gets slotted in. Each run, the node samples from your pool and fills the template. Change the seed and you get different picks; it's the same mechanism as any randomizer, just aimed at prompt text.

Look at the defaults and it clicks: the mutable list is playground equipment ("Swing", "Slide", "Sandbox"...), and the immutable is `sticker, Cartoon, - so you get "sticker, Cartoon, Swing", "sticker, Cartoon, Slide", and so on. Same style, rotating subject.

The inputs that matter

  • mutable_prompt - your options, one per line. This is the pool it draws from.
  • immutable_prompt - the constant wrapper. Put your shared style/quality here and mark the insertion point with the backtick placeholder.
  • max_count - how many prompts to produce (up to 1000). This is what makes it a batch generator, not a single-pick node - set it to 9 and you get nine prompts out.
  • random_sample - enable shuffles/picks randomly; disable walks the list in order instead, which is what you want when you'd rather cover every option deterministically than gamble.
  • seed (optional) - locks the randomness. Same seed, same set of prompts, so you can reproduce a batch you liked.

Output is a STRING list - a batch of finished prompts. Feed it into whatever consumes a list of prompts (a batch prompt setup, or one at a time into your encoder).

Installing it

Get the pack via ComfyUI Manager (search mixlab, install comfyui-mixlab-nodes, restart), or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes

then install requirements and restart. No model download for this one - it's pure text wrangling.

Common snags

  • Nothing gets swapped in. You dropped the placeholder from immutable_prompt. The node needs the backtick marker to know where the random pick goes; without it you just get the fixed text repeated.
  • Same prompt every time. Either random_sample is disable, or your seed is fixed and your pool is tiny. Enable random sampling and vary the seed.
  • Fewer prompts than expected. max_count caps the output. Also, with random_sample on, picks can repeat - it samples, it doesn't guarantee unique coverage. If you want every option exactly once, use disable to walk the list in order.
  • This node pairs naturally with Mixlab's batch-prompt / workflow-to-app features, which is where the "generate 9 variations and render them all" pattern really pays off.
Category♾️Mixlab/Prompt

Inputs (5)

NameTypeDefaultDescription
max_countINT91–1000
mutable_promptSTRINGSwing Slide Climbing frame Sandbox See-saw Merry-go-round Jungle gym Trampoline Monkey bars Rocking horse Playhouse Hopscotch Balance beam Spring rider Water play area Ball pit Tunnel Zip line Basketball hoop Bicycle rack Spinner Climbing wall Rope ladder Tetherball Flying fox Swinging bridge Spiral slide Water sprinkler Pedal go-kart Miniature golf course
immutable_promptSTRINGsticker, Cartoon, ``
random_sampleCOMBO2 options: enable, disable
seedopt*00–18446744073709550000

Outputs (1)

NameTypeDescription
STRINGSTRING