Text Find and Replace
Swap a substring in your prompt mid-graph
Exactly what it says: it finds a substring in your text and replaces it with something else. Text Find and Replace is the search-and-replace you already know from every text editor, dropped into the ComfyUI graph so you can rewrite prompt text on the fly.
Where it earns its place is templating. Keep a base prompt with a placeholder - a photo of SUBJECT in a forest - and swap SUBJECT for whatever you're generating this run. Combine it with the batch text nodes and you've got a poor man's prompt template engine: one skeleton, many fillings, without retyping the whole prompt each time.
How it works
The README description is the whole node: "Find and replace a substring in a string." You give it the input text, the substring to find, and the replacement, and it returns the text with every match swapped. Straightforward string replacement - feed a prompt in, get the edited prompt out.
It shines in a chain. Load a base prompt from a Text Multiline or a file, run it through Find and Replace to inject the variable part, then concatenate on your quality tags and encode. Each transformation is a visible node instead of manual editing, which means you can wire the replacement value from somewhere else in the graph and let it change automatically.
Inputs and outputs that matter
The three inputs that matter are the text to operate on, the find substring (what to look for), and the replace substring (what to put there). The output is the rewritten STRING, which flows into a CLIP encode, this pack's Text to Conditioning, or another text node for more processing.
Note the WAS text convention: outputs are plain STRING now, not the legacy ASCII type. If an old guide references ASCII text, it's the same wire renamed for clarity in 2023.
How to install it
ComfyUI Manager: search was-node-suite-comfyui, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
then install the pack's requirements.txt in your ComfyUI venv and restart. Pure string handling - no downloads.
Common issues & troubleshooting
Nothing got replaced. The find string has to match exactly, and it's typically case-sensitive - Subject won't match subject. Check spelling, capitalization, and any stray spaces in your placeholder. A placeholder that's easy to type unambiguously (like __SUBJECT__) avoids accidental partial matches.
It replaced too much. Substring replace matches anywhere the text appears, including inside other words. If your find token is a common fragment, it'll hit unintended spots. Use a distinctive placeholder that can't occur naturally in your prompt.
I need multiple replacements at once. This node does one find/replace. For several swaps, chain a few of these, or look at the pack's "Text Find and Replace by Dictionary," which applies a whole dictionary of replacements in one node.
I wanted regex / pattern matching. This is a plain substring swap, not a full regex engine. For simple placeholder filling it's perfect; for pattern-based edits you'll want something more specialized.
Whole pack won't import after a ComfyUI update. The familiar WAS Node Suite issue - package downgrades vs a ComfyUI bump. Re-run the pack's requirements against the activated venv, or install.bat. Maintenance-only since late 2023.
Inputs (0)
No inputs
Outputs (0)
No outputs