Nodes/ComfyUI-YogurtNodes/Replace Delimiter (Yogurt Nodes)
ComfyUI Node

Replace Delimiter (Yogurt Nodes)

Fix Ugly Delimiters in One Node

By yogurt7771·Created 2 years ago·Updated 4 days ago· 1
Replace Delimiter (Yogurt Nodes)
    • text
    text
    from/
    to_

    Half of working with strings in ComfyUI is cleaning up strings that other tools produced. YogurtReplaceDelimiter is the smallest possible version of that: it takes a string, swaps one delimiter for another, and hands you the result. Three inputs, one output, no surprises.

    • text - the string to fix.
    • from - the delimiter to find, default /.
    • to - what to replace it with, default _.

    The default pair alone covers the most common annoyance in this ecosystem: file paths with slashes (models/loras/foo) becoming filename-safe underscores (models_loras_foo). One node between your path string and a save node, and your output filenames stop looking like broken directory paths.

    The regex twist

    Where it beats a plain "find and replace" is that from accepts a regular expression. That means one pass handles a whole family of separators at once. A prompt list pasted as red, green; blue | yellow can be normalized in a single shot with something like:

    from: [,\s;|]+
    to: ", "
    

    So this is really two nodes in one: a dumb character swap for the 90% case, and a mini-cleaner for the messier 10%. Just remember to is always literal - only the search side gets regex powers. If your from contains characters that are special in regex (., (, [, +, *), escape them with a backslash or they'll be interpreted as patterns instead of literals.

    Where it fits

    Use it anywhere text crosses a boundary: cleaning LLM output before it becomes a filename, normalizing prompt separators before a split node, converting tag lists between formats. It's one of those nodes that looks trivial until you realize you've wired it into three workflows.

    Install and gotchas

    Ships in the ComfyUI-YogurtNodes pack. ComfyUI Manager → search ComfyUI-YogurtNodes → install, or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
    cd ComfyUI-YogurtNodes
    pip install -r requirements.txt
    

    Restart ComfyUI after installing. It appears under the "Yogurt Nodes" menu with the "(Yogurt Nodes)" suffix on its display name.

    The only real gotcha is the regex-escaping one above, and the expectation setting: this node does not touch the text's content, only its separators. If you need to pull chunks out of a string rather than swap characters, the pack's YogurtRegexNode is the one with extraction and capture groups. Different tools, same pack.

    CategoryYogurtNodes/String

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    fromSTRING/
    toSTRING_

    Outputs (1)

    NameTypeDescription
    textSTRING