Nodes/ComfyUI-Pixaroma/Find and Replace Pixaroma
ComfyUI Node

Find and Replace Pixaroma

Sit it in a wire and rewrite text on the way through

By pixaroma·Created 5 months ago·Updated 5 days ago· 357
Find and Replace Pixaroma
    • text
    text

    Find and Replace Pixaroma is the node you drop between a text source and whatever consumes the text, to edit the text without touching the source. An LLM node spat out a prompt with a style you don't want? Swap it on the way through. Your prompt generator keeps adding an artist name you don't like? Strip it. The original node stays untouched; the edited text flows on downstream.

    It sounds trivial, but it's one of those "why did I live without this" nodes once you have a text pipeline - anything that chains a prompt through an LLM or another generator ends up needing a spot to patch the output, and this is that spot. The live before-and-after preview on the node body is the cherry: you see exactly what changed without running anything.

    How it works

    Wire a STRING into the required text input (an LLM node, Show Text Pixaroma, Text Pixaroma, anything with a string output) and the edited version comes out the text output. Inside, you stack rules, and they apply top to bottom:

    • One rule per edit: type what to find and what to replace it with. Leave the replace box empty to just delete the found text.
    • Toggle any rule off to skip it without deleting it - great for keeping a rule you only sometimes want.
    • Drag the handle to reorder; order matters because rules chain.

    The matching switches

    Four global toggles fine-tune how the matching behaves:

    • Case - match capital letters exactly (so "Art" doesn't match "art").
    • Whole word - only match whole words, so "art" doesn't get caught inside "artist".
    • Regex - treat the find text as a regular expression for advanced patterns. The node has built-in help with a regex cheat-sheet, and a safety net: a pathological pattern that could hang the browser is detected and skipped with a warning instead of freezing your run.
    • Tidy - after the edits, collapse double spaces and fix stray or doubled commas. Leave-behind garbage is the classic failure of find/replace chains; this mops it up in one toggle.

    There's also a Reset button that clears everything in one click.

    Install and gotchas

    Standard Pixaroma install: ComfyUI Manager (search "Pixaroma") or

    cd ComfyUI/custom_nodes
    git clone https://github.com/pixaroma/ComfyUI-Pixaroma
    

    Restart. No dependencies or model downloads.

    Three practical notes. First, the node only edits on the way through - if it's not wired into the flow, it does nothing, and that's correct. Second, the preview you see is the real result, so if the live preview and the run disagree, check that you don't have the node muted or bypassed. Third, the standing pack advice: after an update, hard-refresh with Ctrl+Shift+R (Cmd+Shift+R on Mac) if nodes look broken - the browser cache is the usual suspect.

    Category👑 Pixaroma/💬 Prompt & Text

    Inputs (1)

    NameTypeDefaultDescription
    textSTRINGThe text to edit. Wire a STRING output (an LLM node, Show Text Pixaroma, Text Pixaroma, etc.) into this input. The node edits it on the way through.

    Outputs (1)

    NameTypeDescription
    textSTRINGThe text after all your find/replace rules (and Tidy) are applied.