Nodes/ComfyUI-Just-Nodes/Search & Replace x3 πŸ’Ž Just Nodes
ComfyUI Node

Search & Replace x3 πŸ’Ž Just Nodes

Three search/replace pairs in one pipe β€” text surgery, minimal fuss

By Arroz-11Β·Created 7 months agoΒ·Updated 3 days agoΒ· 0
Search & Replace x3 πŸ’Ž Just Nodes
    • STRING
    β—„textβ€”β–Ί
    β—„search_1β–Ί
    β—„replace_1β–Ί
    β—„search_2β–Ί
    β—„replace_2β–Ί
    β—„search_3β–Ί
    β—„replace_3β–Ί

    Search & Replace x3 is the first variant in the Just Nodes family that feels like a real tool rather than a demo. Three search/replace pairs on one node, applied to whatever string flows through - and suddenly you can rewrite a prompt in one pass instead of chaining three separate nodes.

    The behavior is identical to the x1 sibling, scaled up: text (forceInput, so wire something in) enters, then pairs search_1/replace_1 through search_3/replace_3 apply in order. Each pair does a plain str.replace() - every occurrence, no regex. Leave a search_N empty and that pair is skipped, so an unused slot costs you nothing and doesn't break the chain.

    The sequential detail is where people get burned, so it's worth stating plainly: the output of pair 1 feeds pair 2, and pair 2's output feeds pair 3. That's usually what you want - clean a token, then translate it, then format it - but it means a later pair can re-edit text an earlier pair produced. If you're swapping "dog β†’ cat" and then "cat β†’ bird", you end up with "bird", because pair 2 sees the "cat" that pair 1 just made. Order your pairs with the final result in mind.

    A genuinely handy pattern with three pairs: one to strip a marker a preset system left behind, one to swap a subject term, one to normalize a tag. Put the node between your prompt source and the CLIP Text Encode, and you're editing prompts at runtime without ever touching the original text.

    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 dependencies beyond ComfyUI's own stack, no model files, MIT licensed.

    Gotchas

    • Plain string replace, not regex. Every occurrence, no wildcards, case-sensitive.
    • Order matters - later pairs see the output of earlier ones, so a replacement can itself get replaced.
    • Pairs are optional - empty search fields are simply skipped, which keeps the fixed-count variants painless.
    CategoryπŸ’Ž Just Nodes

    Inputs (7)

    NameTypeDefaultDescription
    textSTRINGβ€”
    search_1optSTRINGβ€”
    replace_1optSTRINGβ€”
    search_2optSTRINGβ€”
    replace_2optSTRINGβ€”
    search_3optSTRINGβ€”
    replace_3optSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”