Nodes/ComfyUI-Alchemine-Pack/Fix Break After TIPO
ComfyUI Node

Fix Break After TIPO

Clean up the weird BREAK artifacts TIPO leaves in your prompts

By alchemine·Created about a year ago·Updated 2 days ago· 2
Fix Break After TIPO
    • processed_text
    text

    FixBreakAfterTIPO is a one-trick node for a very specific problem: TIPO - the "Tag Illustrating Prompt Optimizer" LLM that anime tag-prompters love to run prompts through - occasionally emits BREAK tokens in a malformed form, like (BREAK:-1) (a BREAK wrapped in a weight notation) or BREAK, with a stray comma. This node finds those and normalizes them to plain BREAK tokens so your SDXL prompt doesn't choke on them.

    If you've never run TIPO, you may never need this node. If you have, you've seen the artifacts: TIPO's output is otherwise beautiful, comma-separated Danbooru-tag gold, but every so often it sneaks in (BREAK:-1) or (BREAK:-1), something - and a literal (BREAK:-1) in your prompt text gets encoded as a weighted token that does not behave like the BREAK token the SDXL CLIP encoder is supposed to receive. The fix is simple, and this node automates it.

    How it works

    Two regex passes, that's it:

    1. (BREAK:-1)BREAK. Any weight-wrapped BREAK gets unwrapped to the plain token.
    2. Commas around BREAK get removed: , BREAK BREAK and BREAK,BREAK. So white dog, BREAK, blue sky becomes white dog BREAK blue sky - preserving the whitespace around the BREAK.

    That's the entire node. It takes one text input and returns processed_text. It's deliberately minimal, which is exactly what you want from a post-processor: it shouldn't touch anything else in your prompt.

    Where it fits

    In a prompt pipeline it usually runs right after the TIPO (or any LLM) output and before anything that counts tokens or breaks segments - slot it between OpenAI Inference output and your text encoder. The pack's own framing places it among its Prompt nodes as the TIPO cleanup step, and if you're using ProcessTags with auto-break, feeding it already-clean BREAKs avoids double-processing weirdness.

    Install

    Part of ComfyUI-Alchemine-Pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alchemine/comfyui-alchemine-pack
    pip install -r requirements.txt
    

    Or via ComfyUI Manager (search "ComfyUI-Alchemine-Pack"). Only dependency is python-dotenv; no models.

    Common issues

    The honest caveat: it only fixes the exact patterns (BREAK:-1) and comma-around-BREAK. If your LLM emits (BREAK:1.2) (a positive weight) or a genuinely broken token, this node won't catch it - you'll need an Evaluate snippet for those. And if you're not running TIPO, you don't need this node at all; don't add it to every workflow out of completeness. It's a fixer for a real, narrow annoyance, and it fixes it well.

    CategoryAlcheminePack/Prompt

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    processed_textSTRING