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

Search & Replace x9 πŸ’Ž Just Nodes

Nine search/replace pairs β€” when your prompt cleanup needs a pipeline

By Arroz-11Β·Created 7 months agoΒ·Updated 3 days agoΒ· 0
Search & Replace x9 πŸ’Ž 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 & Replace x9 is the "okay, this text pipeline is real now" size of the Just Nodes family. Nine sequential search/replace pairs on one node is enough to run a genuine rewrite stage - token cleanup, terminology swaps, formatting, and a couple of conditional overrides - all in a single pass between your prompt source and the encoder.

    It works exactly like its smaller siblings, just with more slots. text comes in as a forceInput wire, pairs apply in order, each str.replace() over every occurrence, and empty search_N fields are skipped. The node doesn't care if you use two pairs or nine.

    The one thing you must internalize at this scale is that the pairs compose. Pair 2 edits pair 1's output, pair 3 edits that - so your replacements can beget replacements. If pair 5 turns "cat" into "dog" and pair 8 swaps "dog" for "fox", the final output is "fox" and nothing about the intermediate step was wasted; the pipeline just worked as designed. The failure mode is only when you forget the pipeline exists and pair 8 silently rewrites what pair 5 carefully produced. Keep a mental model of the whole chain and you're fine.

    The realistic use here is heavier: a preset or wildcard system dumps a prompt with multiple conventions that need rewriting depending on the run - a character name, a style token, a quality-tag vocabulary the base model doesn't speak. Nine pairs is a comfortable budget for that. Any more, and you should probably question the system generating the text rather than the node that's patching it.

    Installing it

    Same as every Just Nodes node: 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, not regex. No wildcards, no case-insensitivity.
    • Order is the design: replacements compose top to bottom, and a later pair can rewrite an earlier pair's output.
    • Empty search fields are skipped, so unused slots are harmless.
    CategoryπŸ’Ž Just Nodes

    Inputs (19)

    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β€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”