Nodes/ComfyUI/Replace Text (DEPRECATED)
ComfyUI Node Runs on cloud

Replace Text (DEPRECATED)

The old dataset-node version of find-and-replace

By Comfy-Org·Created 4 years ago·Updated about an hour ago· 129,962
Replace Text (DEPRECATED)
    • texts
    texts
    find
    replace

    If you're here because a workflow threw a "Replace Text (DEPRECATED)" at you, good news: the node still runs, and the fix is a two-minute swap. Replace Text (ReplaceText) is a leftover from ComfyUI's dataset-processing tooling - the one that batches over lists of training captions - and it's been marked deprecated in favor of the newer core Replace Text (StringReplace) node. Same name family, different class, one of them is current.

    The core-team note in the source is blunt: "This node is superseded by the other Replace Text node." That's the whole story. It does literal find-and-replace on text, exactly like its replacement, but it lives on a legacy code path that isn't getting polish.

    How it works

    Mechanically: text.replace(find, replace) - Python's standard literal replacement. Every occurrence of find ("Text to find") in the texts input ("Text to process") becomes replace ("Text to replace with"). Three inputs, one output (texts, "Processed texts"). Literal, all-occurrences, no regex, no flags, no count. Same behavior you'd get from a plain .replace() in a script. Note the "texts"/"Processed texts" labels again - the plural naming is the fingerprint of the dataset-family nodes it came from, and a reminder that the schema's STRING socket is doing the work of what was once a list-capable pipeline.

    So the node isn't broken - it just isn't where ComfyUI's text utilities live anymore. Deprecated here means "still present so old graphs load, not where we're investing."

    What to use instead

    The drop-in replacement is the core Replace Text (StringReplace) node: string → the text, find and replace → same names, same literal behavior, same single STRING output. Swap the old node for the new one and the graph behaves identically. If your replacement needs patterns instead of literals - "any digit, any whitespace run" - that's Replace Text (Regex) (RegexReplace), which adds flags, a count limit, and backreference support in the replacement text.

    Common issues

    The only real "issue" with this node is identity confusion: there are three similarly named replace nodes in core, and old tutorials don't always say which they mean. If someone pastes a ReplaceText class name, you're looking at the deprecated one. The others are StringReplace (current, literal) and RegexReplace (current, pattern). When in doubt, convert to StringReplace - you lose nothing, and you stop depending on a legacy path that could vanish in a future version. A deprecated node you only keep because a saved graph references it is fine; a deprecated node you're building new work on is a habit worth breaking.

    Categorytext

    Inputs (3)

    NameTypeDefaultDescription
    textsSTRINGText to process.
    findSTRINGText to find.
    replaceSTRINGText to replace with.

    Outputs (1)

    NameTypeDescription
    textsSTRINGProcessed texts