🪠️ WWAA Search and Replace Text
A dependable find-and-replace for your prompts, no regex required
- modified_text
If you've ever wanted to swap every "photorealistic" in a prompt for "35mm film," or replace one LoRA trigger word with another across a batch, you know stock ComfyUI makes you do it by hand or drag in a text-manipulation pack that needs a regex manual. WWAA Search Replace Text is the plain version: type what to find, type what to put instead, and every occurrence is replaced. No regex, no escaping, no surprises.
It's the simplest node in the WWAA pack's string collection, and that's its selling point. Three inputs, one output, and the behavior is exactly Python's str.replace() - a straight, case-sensitive, all-occurrences substitution on multiline text. search_string and replace_string are both single-line text fields (if you need commas or semicolons in your search, this plain node actually handles them fine, unlike the semicolon-delimited multi version). Leave the search field empty and the node politely returns your text unchanged instead of erroring - a small nicety that suggests the author learned the hard way what happens when you don't guard that.
Where it fits
- Prompt normalization: standardize wording before encoding, e.g. swap
blurry→sharp focuseverywhere. - LoRA trigger swapping: swap
etv8→Ernestacross captions or prompt batches when you renamed a trigger word. - Template cleanup: strip a placeholder token that your downstream pipeline doesn't understand.
The output modified_text feeds straight back into a prompt encoder, a text writer, or the next string node in your chain. It also works great inside batch and loop workflows - the pack's own Image Batch Loader / prompt-file ecosystem is full of places where you'd route every line through one of these.
Install
Ships in WWAA-CustomNodes. ComfyUI Manager: search "WWAA Custom Nodes", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/hgabha/WWAA-CustomNodes
# restart ComfyUI
Zero extra dependencies - this node is pure Python string handling. It appears under the 🪠️ WWAA/String menu.
Honest assessment
It does one thing, and you'll either find it indispensable or never touch it. The case-sensitivity catches people: replace("photo", "film") won't touch "Photo" with a capital P, so if your sources vary in casing you'll want to normalize case first or use the multi-replace node with both variants. And because it's a plain substring match, it'll happily replace inside larger words - replacing "cat" also mangles "catalog" - so spell out enough context to be safe. For its intended job, though, it's the node you'd actually reach for over a heavyweight text-manipulation pack: dependable, readable, and boring in the best way.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text_input | STRING | — | |
| search_string | STRING | — | |
| replace_string | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| modified_text | STRING | — |