XY Inputs: PromptSR //EasyUse
PromptSR — swap one word or phrase across a whole grid
- X or Y
"PromptSR" is search-and-replace for your prompt, run across a grid. Give it a word or phrase to find and a list of replacements, and it hands easy XY Plot Advanced one column (or row) per variant - your original prompt untouched, then the same prompt with that phrase swapped for each replacement in turn. It's the node for "what does this prompt look like if I swap 'red car' for 'blue car', 'green car', 'rusted car'" without retyping the whole thing five times.
Why you'd reach for it
Any time you want to isolate the effect of one word or phrase while holding everything else in the prompt constant - testing color words, art-style tags, subject descriptors, camera angles, whatever single term you suspect is doing the heavy lifting. Because this operates on raw text before encoding, it's a cleaner comparison than swapping whole prompts by hand: the rest of the sentence, its structure, and its token order stay identical, so any difference in the output is more plausibly attributable to the phrase you actually changed.
How it works
Pick whether you're editing the positive or negative prompt, type the exact text to search for in search_txt, and fill in your replacement candidates. The node always includes your original prompt unchanged as the first entry - that's your baseline - then appends one more entry per replacement you've filled in, each with search_txt swapped for that replacement. replace_count controls how many of the numbered replacement fields actually get used, so bump it up if you add more than the default three. The result gets tagged as either "Positive Prompt S/R" or "Negative Prompt S/R" and passed to easy XY Plot Advanced, which runs one generation per entry - original plus however many swaps - with everything else in your workflow held fixed.
The inputs and outputs that matter
target_prompt-positiveornegative: which prompt the search-and-replace applies to.search_txt- the exact text to find. Needs to match the wording in your actual prompt for the swap to do anything.replace_all_text(default off) - off replaces just the first match ofsearch_txt; on replaces every occurrence in the prompt.replace_count(default 3) - how many of thereplace_1…replace_29fields get included as grid entries. Raise it if you've filled in more than three replacements.replace_1throughreplace_29- your replacement candidates, one per field. Only the firstreplace_countof these are used.
Output is a single X or Y, wired into whichever axis of easy XY Plot Advanced you want the search-and-replace sweep on.
How to install it
ComfyUI Manager: search ComfyUI Easy Use, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use
Windows: double-click install.bat. Linux/Mac: pip install -r requirements.txt. Restart ComfyUI. No models, no extra dependencies.
Common issues & troubleshooting
The single most common miss: search_txt has to match the actual text in your prompt exactly, including case and spacing. If you type "Red Car" into search_txt but your prompt says "red car", nothing gets replaced and every entry in the grid - aside from the unavoidable baseline - will look identical to the original. Copy the phrase straight out of your prompt rather than retyping it from memory.
Second, replace_count is easy to forget about: if you fill in replace_4 and replace_5 but leave replace_count at the default 3, those extra fields are silently ignored and won't show up in your grid. Bump the count to match however many replacement fields you've actually filled in.
Third, watch replace_all_text if your search phrase is a common word or a substring of something else in the prompt - with it on, every occurrence gets swapped, which is what you want for a word repeated deliberately but can produce unintended changes if the phrase happens to appear somewhere you weren't thinking about. With it off, only the first occurrence changes, which is usually the safer default for a one-word or one-phrase test.
Finally, as with any grid tool here: this feeds easy XY Plot Advanced, which also needs a pipe from your loader wired in - this node's output alone doesn't have a workflow to run against.
Inputs (33)
| Name | Type | Default | Description |
|---|---|---|---|
| target_prompt | COMBO | 2 options: positive, negative | |
| search_txt | STRING | — | |
| replace_all_text | BOOLEAN | false | — |
| replace_count | INT | 31–29 | — |
| replace_1 | STRING | — | |
| replace_2 | STRING | — | |
| replace_3 | STRING | — | |
| replace_4 | STRING | — | |
| replace_5 | STRING | — | |
| replace_6 | STRING | — | |
| replace_7 | STRING | — | |
| replace_8 | STRING | — | |
| replace_9 | STRING | — | |
| replace_10 | STRING | — | |
| replace_11 | STRING | — | |
| replace_12 | STRING | — | |
| replace_13 | STRING | — | |
| replace_14 | STRING | — | |
| replace_15 | STRING | — | |
| replace_16 | STRING | — | |
| replace_17 | STRING | — | |
| replace_18 | STRING | — | |
| replace_19 | STRING | — | |
| replace_20 | STRING | — | |
| replace_21 | STRING | — | |
| replace_22 | STRING | — | |
| replace_23 | STRING | — | |
| replace_24 | STRING | — | |
| replace_25 | STRING | — | |
| replace_26 | STRING | — | |
| replace_27 | STRING | — | |
| replace_28 | STRING | — | |
| replace_29 | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| X or Y | X_Y | — |