Search And Replace From List
Multiple trigger-word swaps, written right in the node
- STRING
This sits between JNodes' other two search-and-replace nodes: more capable than the single-pair JNodes_SearchAndReplace, but without leaving the graph the way JNodes_SearchAndReplaceFromFile does. Instead of an external file, you write your list of substitutions directly into a multiline text box on the node itself - same one-pair-per-line format the README describes for the file-based version, replacing an obfuscated embedding name like 3mb3dd1n4 with something readable like embedding.
That makes it the right middle ground: reach for the plain SearchAndReplace node when you've got exactly one swap, this one when you've got a handful and want them portable inside the workflow file itself (so sharing the .json shares the substitution list too, no separate file to remember), and the file-based version when the list is long-lived, shared across many workflows, or you want to edit it without opening ComfyUI at all.
How it works
text is the string to process. list is a multiline field where each line is a search->replace pair - matching the same syntax the pack uses for its file-based sibling. The node parses every line and applies each substitution to text in one pass, handing back the fully processed result.
The inputs and outputs
text(STRING, multiline) - the text to process.list(STRING, multiline) - onesearch->replacepair per line.STRINGoutput - the text with every substitution applied.
How to install it
Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/JaredTherriault/ComfyUI-JNodes
pip install -r ComfyUI-JNodes/requirements.txt
then restart ComfyUI. No model downloads - plain text processing.
Common issues & troubleshooting
Malformed lines going unnoticed. Because the list lives in the widget rather than an external file you might sanity-check separately, it's easy to fat-finger a line and not notice - a missing ->, a stray extra one, a blank line in the middle. Test with a JNodes_PrintString or a preview node on the output the first time you write or edit the list, rather than trusting it silently worked.
List growing unwieldy inside the node. There's no hard limit here, but a multiline widget with dozens of substitution pairs gets hard to read and edit inside the graph itself. Once the list is genuinely long or you want to maintain it outside ComfyUI, JNodes_SearchAndReplaceFromFile is the better fit - same syntax, just externalized.
Forgetting the list travels with the workflow, which cuts both ways. Sharing this workflow file shares your substitution list along with it - convenient if that's exactly what you want (a self-contained workflow that "just works" for someone else), a minor privacy leak if the list happens to contain anything you didn't mean to publish (an internal project codename standing in for a trigger word, say).
Order-dependent substitutions producing surprising results. If one substitution's replacement text happens to match a later substitution's search term, the second one can fire on text the first one just inserted. Keep the list's substitutions independent of each other where you can, or double-check the final output when they aren't.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| list | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |