ComfyUI Node

Text Replace

Replace words in text from one line of rules: `green:red, orange:black`. All swaps happen at once, so `red:blue, blue:red` swaps them. `orange:` deletes. Use \, or \: for a literal comma or colon.

By Nynxz·Created 11 months ago·Updated 2 days ago· 5
Text Replace
    • text
    ◄text—►
    ◄replace►
    ◄whole_wordstrue►
    ◄match_casefalse►
    CategoryNynxz/Utils

    Inputs (4)

    NameTypeDefaultDescription
    textSTRINGThe text to change.
    replaceSTRINGfind:replace pairs, comma separated — e.g. green:red, orange:black
    whole_wordsoptBOOLEANtrueOnly whole words: `green` leaves `greenery` alone.
    match_caseoptBOOLEANfalseOff: `green` also finds `Green` and `GREEN`, and the replacement follows their case.

    Outputs (1)

    NameTypeDescription
    textSTRING—