Nodes/ComfyUI_PRNodes/RandomPromptMixed
ComfyUI Node

RandomPromptMixed

The prompt slot machine that shuffles your best tags into new ones

By pikenrover·Created 2 years ago·Updated about a year ago· 2
RandomPromptMixed
  • clip
  • CONDITIONING
  • CONDITIONING
  • LATENT
  • WIDTH
  • HEIGHT
  • STRING
  • STRING
prompts
seed0

This is the pack's actual star: a node that reads a file of your favorite prompts, tears them all apart into individual comma-separated tags, and assembles a brand-new prompt from random pieces of every one of them. Its sister node RandomPrompt just picks a whole saved prompt wholesale. RandomPromptMixed is the degenerate cousin that puts all your prompts in a blender and lets chance recombine them. It's a creativity lottery - some rolls come out genuinely striking, some come out nonsense, and that's kind of the point.

The use case is the one the pack is built for: generating lots of images to explore a style, then upscaling and uploading the good ones to CivitAI with full metadata. Because the node doesn't just make a prompt - it also emits the conditioning, a random-sized latent, the target width/height, and the final prompt text as strings, so the whole pipeline from sampler to Save Image w/Metadata can run without you typing a thing.

How it works

The prompts input is a dropdown of .prompt files living in ComfyUI/input. Each line of the file is one saved prompt, formatted positive|\|negative - the |\| is the positive/negative split marker (the repo ships an example.prompt showing the format). For the mixing, the node:

  1. Splits every line's positive prompt on commas and dumps every token into one big bag.
  2. Picks a random line to decide how many tokens the new prompt will have (the length of that line's positive side).
  3. Randomly draws that many tokens from the bag - with replacement, so duplicates and repeats are normal.
  4. Takes the negative prompt from a random line.

It also hard-codes some embedding names into every result (embedding:safe_pos, SimpleNegativeV3, embedding:safe_neg), and picks a base resolution from a short preset list for the latent. The seed input locks a roll - keep the seed if you like the prompt, change it to spin again.

Inputs and outputs

Only three inputs, and the clip one is from your checkpoint loader:

  • prompts - the .prompt file (put it in ComfyUI/input).
  • clip - CLIP from your loader.
  • seed - lock or re-roll.

Outputs, in order: CONDITIONING (positive) and CONDITIONING (negative) for your KSampler, LATENT, WIDTH and HEIGHT (the doubled target size for the pack's upscale/metadata chain), and two STRING outputs - the exact positive and negative prompts that were generated. That last pair is the important one: wire it into Save Image w/Metadata and your upload metadata matches what was actually generated, which CivitAI's parser will read correctly.

Install and gotchas

ComfyUI Manager, search "ComfyUI_PRNodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/pikenrover/ComfyUI_PRNodes

Restart. No pip deps. The one real setup task: your .prompt file must be in ComfyUI/input - that's the only directory the node scans, so a file sitting in Documents won't appear in the dropdown.

Three things that will trip you up:

  • The embeddings must actually exist. The node appends embedding:safe_pos, SimpleNegativeV3, and embedding:safe_neg to every prompt. If you don't have those files in your embeddings folder, ComfyUI doesn't error - it just silently ignores them, so your "safe" negative tags do nothing.
  • The bag-of-words shuffle is crude. Recombination with replacement means duplicated tags, contradictory ones, and pure gibberish on regular basis. That's not a bug; it's the design. Use a seed to bank a good roll.
  • The WIDTH/HEIGHT are doubled relative to the actual latent. The node generates at a modest base resolution and reports twice that size because the pack's workflow upscales and the metadata should record the final posted size. Don't wire them into anything that expects real pixel dimensions.

One more thing worth knowing: the node print()s the generated prompts to your console, so if you're curious what it actually produced, the terminal is the source of truth. Also worth noting - the mixing only ever combines tags from lines that are already in the file, so the quality ceiling is exactly the quality of the prompt library you feed it. Garbage in, very fast garbage out.

Categoryconditioning

Inputs (3)

NameTypeDefaultDescription
promptsCOMBO0 options:
clipCLIP
seedINT00–18446744073709550000

Outputs (7)

NameTypeDescription
CONDITIONINGCONDITIONING
CONDITIONINGCONDITIONING
LATENTLATENT
WIDTHWIDTH
HEIGHTHEIGHT
STRINGSTRING
STRINGSTRING