ScramblePrompts_m9
Generate prompt variations on autopilot — just don't forget the seed
- clip
- conditioning_optional
- CONDITIONING
You know the feeling: a prompt that's 90% good, and you'd love ten more takes on it without retyping a word. That's what this node does. It's the ComfyUI port of MarcusNyne's Scramble Prompts extension for A1111 - the mid-2024 tool that got a small burst of love on r/StableDiffusion before vanishing into niche territory. Drop it where your CLIP Text Encode sits and it hands your KSampler a mutated version of your prompt on every run: chunks reordered, a few deleted, weights jiggled. Same base prompt, a stream of cousins.
The whole point is batch exploration. Instead of hand-editing tags, you fix the concept and let the node shuffle the presentation. Wire a seed into it and every seed is a different take on the same idea. That's the "batched prompt variations" superpower ComfyUI's graph model is built for, packaged as one node.
How it works
The node parses your prompt by commas - but a "prompt" is a comma-chunk not inside parentheses, so (red hair), smiling is two prompts while (red, hair) is one. It reads each chunk's existing CLIP weight from the paren count and :weight syntax, then runs up to three operations on a percentage of chunks:
- Reorder -
order_prompts_percent(default 20) shuffles that many chunks. - Remove -
remove_prompts_percent(default 0, capped at 30) deletes that many. Chunks containing any keyword inkeep_promptsare protected, and LoRA tags are never removed. - Reweight -
modify_weights_percent(default 20) nudges weights by up to ±weight_range, clamped so nothing goes below zero or overmax_weight.
It writes the result back in standard token:weight notation and encodes it through your CLIP model. The grammar is the same A1111-compatible one the SD 1.5/SDXL crowd already speaks.
The inputs that matter
- prompt and clip - your text and the CLIP model, same as a text encoder.
- remove_prompts_percent and keep_prompts - the delete button and its undo list. If something you care about keeps vanishing, put its keyword in
keep_prompts. - modify_weights_percent, weight_range, max_weight - how aggressive the reweighting is.
max_weightis your sanity cap against 2.0+ cooked weights. - print_output - prints the final mutated prompt to the console so you can confirm it's alive.
Optional inputs: seed_optional (see the trap below) and conditioning_optional, which concatenates another prompt node's conditioning onto yours - README example 2 keeps your main CLIP Text Encode positive and stacks scrambled flavor on top.
The trap that makes people think it's broken
ComfyUI caches node outputs. Leave seed_optional unplugged and the scramble runs exactly once - every later generation reuses the cached result, so nothing ever changes again. Connect a seed primitive (or your Seed node) into seed_optional and each seed produces a fresh variation. This is the single most common failure mode with this node, and the README calls it out explicitly. Same seed, same mutation - that's the feature; no seed at all is the bug.
Install
ComfyUI Manager → search m9 Prompts → Install → restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/MarcusNyne/m9-prompts-comfyui
then restart ComfyUI. Zero extra dependencies and zero model downloads - it's pure Python on the standard library. Both nodes land under the M9 Prompts category.
The honest caveat
This node lives in the CLIP attention-weight universe. It writes (word:1.3) style syntax, and that syntax is silently discarded by the LLM/T5 encoders on Flux, Z-Image, Anima and the rest of the newer lineage. On those models reordering and removal still work; the weight jiggling does nothing. For SD 1.5, SDXL, Illustrious, NoobAI and Pony, it's all live. If you run one of those, the flow is: fix your seed input, turn on print_output, and start a small batch - you'll see a genuinely different prompt in the console on every pass.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| clip | CLIP | — | |
| order_prompts_percent | INT | 200–100 | — |
| remove_prompts_percent | INT | 00–30 | — |
| keep_prompts | STRING | — | |
| modify_weights_percent | INT | 200–100 | — |
| weight_range | FLOAT | 0.50–2 | — |
| max_weight | FLOAT | 1.90–3 | — |
| print_output | BOOLEAN | false | — |
| conditioning_optionalopt | CONDITIONING | — | |
| seed_optionalopt | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |