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

Search & Replace x12 πŸ’Ž Just Nodes

Twelve search/replace pairs β€” the maximum-text-surgery node

By Arroz-11Β·Created 7 months agoΒ·Updated 3 days agoΒ· 0
Search & Replace x12 πŸ’Ž Just Nodes
    • STRING
    β—„textβ€”β–Ί
    β—„search_1β–Ί
    β—„replace_1β–Ί
    β—„search_2β–Ί
    β—„replace_2β–Ί
    β—„search_3β–Ί
    β—„replace_3β–Ί
    β—„search_4β–Ί
    β—„replace_4β–Ί
    β—„search_5β–Ί
    β—„replace_5β–Ί
    β—„search_6β–Ί
    β—„replace_6β–Ί
    β—„search_7β–Ί
    β—„replace_7β–Ί
    β—„search_8β–Ί
    β—„replace_8β–Ί
    β—„search_9β–Ί
    β—„replace_9β–Ί
    β—„search_10β–Ί
    β—„replace_10β–Ί
    β—„search_11β–Ί
    β—„replace_11β–Ί
    β—„search_12β–Ί
    β—„replace_12β–Ί

    Search & Replace x12 is the top of the Just Nodes search/replace line: twelve sequential pairs, one string input, one string output. If the family's smaller sizes are prompt cleanup, this one is prompt refactoring - a single node that can carry an entire rewrite stage.

    The behavior is identical to the x1, x3, x6, and x9 variants, so there's nothing new to learn. text arrives as a forceInput wire, and pairs search_1/replace_1 through search_12/replace_12 apply top to bottom, each a plain str.replace() hitting every occurrence. Leave a search_N empty and the pair is skipped, so the node costs nothing whether you use two pairs or all twelve.

    Twelve pairs of sequential replacement is a lot of transformation, which means the one skill that matters is ordering. Every pair edits the output of the previous one, so replacements compose: an earlier swap can create text that a later pair then matches. If you've ever debugged a "why did my prompt get mangled" mystery, it was almost certainly this - a chain of replacements where a later rule re-wrote an earlier result. Work top-down toward your final state, put the most destructive rules last, and the pipeline does exactly what you drew.

    Honestly, if you find yourself using all twelve slots regularly, that's a signal worth listening to - either your template system is emitting a lot of junk, or you've built a mini programming language out of string replaces. Both are legitimate; just be aware of which one you're doing. For everyone else, this is the node you keep in the back pocket for that one gnarly workflow where the generated prompt needs five different rewrites before the model can read it.

    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 - every occurrence, case-sensitive, no wildcards.
    • Pairs compose top to bottom; a later pair can rewrite an earlier pair's output. Order matters.
    • Empty search fields are skipped, so unused slots are harmless.
    CategoryπŸ’Ž Just Nodes

    Inputs (25)

    NameTypeDefaultDescription
    textSTRINGβ€”
    search_1optSTRINGβ€”
    replace_1optSTRINGβ€”
    search_2optSTRINGβ€”
    replace_2optSTRINGβ€”
    search_3optSTRINGβ€”
    replace_3optSTRINGβ€”
    search_4optSTRINGβ€”
    replace_4optSTRINGβ€”
    search_5optSTRINGβ€”
    replace_5optSTRINGβ€”
    search_6optSTRINGβ€”
    replace_6optSTRINGβ€”
    search_7optSTRINGβ€”
    replace_7optSTRINGβ€”
    search_8optSTRINGβ€”
    replace_8optSTRINGβ€”
    search_9optSTRINGβ€”
    replace_9optSTRINGβ€”
    search_10optSTRINGβ€”
    replace_10optSTRINGβ€”
    search_11optSTRINGβ€”
    replace_11optSTRINGβ€”
    search_12optSTRINGβ€”
    replace_12optSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”