S&R
The find-and-replace node that earns its place in every workflow
- result
Find and replace. Three string inputs, one output. There is nothing glamorous about S&R, and that's precisely why it's the most-used string node in the pack - you'll wire it into prompt chains, file name builders, and cleanup passes far more often than you expect.
The boring utility that saves the day: you've got a prompt assembled from multiple nodes and a word you need swapped in every position. Or a filename with _v2 you want stamped to _final. Or a text block where every , should be , . Search-and-replace on strings is a chore ComfyUI doesn't do natively, and S&R does it in one hop.
How it works
It's a straight string replace: every occurrence of search inside original becomes replace. The output result is the modified text. No regex, no case-folding, no partial matching options - just exact, literal, every-occurrence substitution, like a text editor's Replace All.
The three inputs:
- original - the string you're modifying.
- search - the exact text to look for.
- replace - the text that goes in its place. Leave it empty to simply delete every match.
One string out: result.
Installing it
S&R is part of ComfyUI-TinyBee, the small MIT-licensed utility pack from TinyBeeman. No models, no heavy dependencies. Via Manager:
- ComfyUI Manager → Custom Nodes Manager.
- Search "ComfyUI-TinyBee" and install.
- Restart ComfyUI.
Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
Restart and it's under 🐝TinyBee/Strings. Pure standard library - the pack's jsonata dependency only affects its JSON Parser node.
Gotchas
The limitation is the feature: this is literal replacement. If your search text doesn't appear verbatim (including case), nothing changes - "Portrait" won't match "portrait". For case-insensitive or regex-aware replacing, the pack ships a beefier Search and Replace node with exactly those options, so reach for S&R when you want the simple thing and the bigger sibling when you need control. And remember it replaces every occurrence, not just the first - if that matters, structure your search string so it only matches where you intend.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| original | STRING | — | |
| search | STRING | — | |
| replace | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |