Search & Replace x6 π Just Nodes
Six search/replace pairs β the prompt-cleaning workhorse
- STRING
Search & Replace x6 is the size most people settle on. Six search/replace pairs on one node covers a full prompt-cleaning pass - strip the markers, swap the subjects, normalize the tags - without ever chaining a row of single-purpose nodes down the canvas.
Mechanics, shared with the whole family: text is forceInput, so you wire a string in from a preset node, a Picker, or another text node. Pairs search_1/replace_1 through search_6/replace_6 apply sequentially, each a plain str.replace() over every occurrence. Empty search_N fields are skipped, so you can use four pairs and leave the other two blank without any config ceremony.
The sequencing caveat carries over and matters more at this size: pair 2 edits the output of pair 1, pair 3 edits that, and so on down the line. Six pairs means five chances for an earlier replacement to become the subject of a later one. That's a feature when you're deliberately composing transformations, and a bug when you're not expecting it. Rule of thumb: put the most destructive replacement last, or at least order pairs so nothing you already fixed gets re-matched.
Where this fits: it pairs beautifully with Preset Manager from the same pack. Preset Manager resolves {VARIABLE} templates and can leave artifacts or conventions you want to rewrite per-character; drop a Search & Replace x6 between it and the CLIP Text Encode and you've got a per-run rewrite stage without editing the preset file.
Installing it
Same as the whole pack: ComfyUI Manager β search "Just Nodes" β install β restart, or cd ComfyUI/custom_nodes && git clone https://github.com/Arroz-11/ComfyUI-Just-Nodes.git. No model files, no extra dependencies, MIT licensed.
Gotchas
- Plain string replace, no regex - no wildcards, no case-insensitive matching.
- Sequential application: later pairs see and can rewrite earlier pairs' output.
- Empty search fields are skipped, so unused slots are free.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | β | |
| search_1opt | STRING | β | |
| replace_1opt | STRING | β | |
| search_2opt | STRING | β | |
| replace_2opt | STRING | β | |
| search_3opt | STRING | β | |
| replace_3opt | STRING | β | |
| search_4opt | STRING | β | |
| replace_4opt | STRING | β | |
| search_5opt | STRING | β | |
| replace_5opt | STRING | β | |
| search_6opt | STRING | β | |
| replace_6opt | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |