Search & Replace x1 π Just Nodes
Search & replace for your prompt text β yes, actually, that useful
- STRING
Search & Replace x1 is a text-editing node for your prompt string, and it earns its keep in ways you don't expect until you've wired one in. You give it text, one search term, and one replacement, and it swaps every occurrence. Nothing clever, nothing hidden - a straight str.replace().
Where this shines is prompt plumbing, not prompt writing. A template system or a preset node hands you a prompt with a token you need to rewrite before it hits the encoder - swap a character name, translate a set of tags, clean up a marker a wildcard tool left behind. Or use it the other way: a shared base prompt where one keyword flips the whole subject. One node between your prompt source and the sampler, and suddenly you're editing prompts at runtime instead of by hand.
Each search/replace pair works sequentially: the result of pair 1 feeds into pair 2. With a single pair that's a non-event, but it's why the bigger siblings (x3, x6, x9, x12) exist - the sequence matters, because a later replacement can rewrite text that an earlier one just produced. Chain replacements in the order you want them to compose.
The text input is forceInput, meaning you're expected to wire a string in from somewhere rather than type it - this node is a pipe, not a fountain. The search_1 / replace_1 pair are plain text boxes. Leave search_1 empty and the pair is skipped entirely, which is how the fixed-slot variants stay painless when you're not using every slot.
Where it fits in the pack
This is the partner node to Prompt Stack and the Picker family. Prompt Stack cleans your text, Picker selects between options, Search & Replace rewrites what you got. All three are string-in/string-out, so you can chain them in any order and end at a CLIP Text Encode.
Installing it
Standard Just Nodes install - ComfyUI Manager, search "Just Nodes", install, restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/Arroz-11/ComfyUI-Just-Nodes.git. No dependencies beyond what ComfyUI ships, no model files, MIT licensed.
Gotchas
- It's plain text replace, not regex. No
\d+, no wildcards, no case-insensitive magic. If you need regex, you need a different node. - It replaces every occurrence, not just the first.
- Order matters once you have multiple pairs - later pairs see the output of earlier ones. If "replace AβB" and then "replace BβC" both run, you end up with C, because the second pair sees the B that the first pair created.
For a single cleanup that's all you need. For real text surgery, grab the x6 or x9 variant from the same pack - same behavior, more slots, same zero-config install.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | β | |
| search_1opt | STRING | β | |
| replace_1opt | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |