XY Input: Prompt S/R
Prompt S/R
- X or Y
Prompt S/R - "search and replace" - is the XY input for comparing prompt wording. You pick a word or phrase in your prompt, then list a bunch of replacements, and the plot generates one image per replacement with everything else held constant. Want to see "a photo of a red car" versus green, blue, and black, same seed and composition? This is the node. It's a straight port of Automatic1111's Prompt S/R plot mode, and it's the cleanest way to isolate the effect of a single prompt change.
On its own it does nothing - it feeds an XY Plot node.
How it works
You tell it the exact text to find (search_txt) and give it a list of things to swap in. The first cell of the plot uses your original prompt as-is (the search text stays), and each subsequent cell replaces the search text with the next replacement value. So with search text "red" and replacements "green", "blue", the plot is three cells: red, green, blue. Everything the KSampler does is identical except that one substituted word.
The search is literal, so whatever you type in search_txt has to appear exactly in your actual prompt - same spelling, same case.
The inputs and outputs
target_prompt-positiveornegative. Which prompt the search-and-replace runs on.search_txt- the text to find in that prompt. This must match a substring of the prompt you're actually using, character for character.replace_count- how many replacement slots to show. Default3.replace_1,replace_2, … - the replacement values, one per cell.
The output is labelled X or Y (XY type) → into the X or Y input of an XY Plot node.
Installing it
ComfyUI Manager → search Efficiency Nodes for ComfyUI, or:
cd ComfyUI/custom_nodes
git clone https://github.com/jags111/efficiency-nodes-comfyui
Restart after. No extra downloads.
Common issues
The number-one failure is a search_txt that doesn't exactly match your prompt. If the search text isn't found, the replacement can't happen and the cell just renders your original prompt - so you get a row of identical images and wonder why. Copy the phrase straight out of your prompt to be safe, and watch the capitalization.
Second gotcha: your prompt lives on the Efficient Loader (or whatever's encoding it), and the plot only works through an XY Plot feeding an Efficient KSampler. The search runs against that prompt, so make sure you're editing the right one.
Pack-wide: if the node's missing, look for IMPORT FAILED in the console (often a pip freeze error), and update ComfyUI, the packages and the node. This pack tends to break on ComfyUI frontend updates; updating to the latest commit is the standard fix.
Inputs (52)
| Name | Type | Default | Description |
|---|---|---|---|
| target_prompt | COMBO | 2 options: positive, negative | |
| search_txt | STRING | — | |
| replace_count | INT | 30–49 | — |
| 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 | — | |
| replace_30 | STRING | — | |
| replace_31 | STRING | — | |
| replace_32 | STRING | — | |
| replace_33 | STRING | — | |
| replace_34 | STRING | — | |
| replace_35 | STRING | — | |
| replace_36 | STRING | — | |
| replace_37 | STRING | — | |
| replace_38 | STRING | — | |
| replace_39 | STRING | — | |
| replace_40 | STRING | — | |
| replace_41 | STRING | — | |
| replace_42 | STRING | — | |
| replace_43 | STRING | — | |
| replace_44 | STRING | — | |
| replace_45 | STRING | — | |
| replace_46 | STRING | — | |
| replace_47 | STRING | — | |
| replace_48 | STRING | — | |
| replace_49 | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| X or Y | XY | — |