ComfyUI Node

Break Encoder

Bring back the A1111 BREAK keyword — without the ConditioningConcat spaghetti

By relhamdi·Created 7 months ago·Updated 2 months ago· 1
Break Encoder
  • clip
  • conditioning
  • text
break_keywordBREAK
text
cleanuptrue

If you came over from A1111, you remember BREAK. It let you split a prompt into separately-encoded chunks, and it was quietly one of the most useful punctuation marks in the whole ecosystem. ComfyUI never gave you a native BREAK - you had to build a CLIPTextEncode per block and chain them through ConditioningConcat, which is exactly as tedious as it sounds. BreakEncoder is the fix: one node that splits, encodes, and concatenates for you.

What it actually does

You write a prompt with BREAK on its own lines, feed it a CLIP encoder, and get a single CONDITIONING output - the same thing a chain of ConditioningConcat nodes would produce. Each block is tokenized and encoded separately, then concatenated along the sequence dimension, matching the behavior of A1111/Yodayo's BREAK. The practical upshot: the model treats each block as a more independent unit than it would inside one flat prompt. People use it to quarantine a subject from its background, to stop quality tags from getting diluted by the rest of the prompt, and to paste blocks together that would otherwise smear into each other.

It drops straight in where a CLIPTextEncode would go - clip in, conditioning out to your KSampler's positive or negative.

The inputs that matter

  • clip - your CLIP encoder, typically straight from a checkpoint loader.
  • break_keyword - the splitter, default BREAK. Case-sensitive. break will not split anything.
  • text - the multiline prompt with break blocks.
  • cleanup (default on) - runs the same prompt-cleanup pass this whole pack shares on each block: kills spaces before commas, double commas, empty parentheses, that whole family of artifacts. Blocks that collapse to empty get filtered out silently.

Two outputs: conditioning (into the sampler) and text, which shows exactly what got encoded - blocks joined by \n---\n. That second output is a gift for debugging, because you can see precisely what cleanup changed before it hit the encoder.

How it's put together

Under the hood it splits on the keyword with a regex, drops empty blocks, cleans if asked, then tokenizes and encodes each block and concatenates the tensors with torch.cat. Nothing exotic, nothing to download - the pack's only declared Python dependency is torch, which you already have. If any step fails, it raises a clear error and stops the workflow rather than silently producing garbage.

Installing it

This ships in the ComfyUI-RE-CustomUtils pack. Easiest via ComfyUI Manager (search "ComfyUI-RE-CustomUtils"), or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/relhamdi/ComfyUI-RE-CustomUtils

Restart ComfyUI. No extra pip packages, no model files, no API keys. If you don't use Manager yet, you should - it's the pack-installer most of the ecosystem runs on, and this pack is exactly the kind of small utility it exists to handle.

Where people get burned

  • Case. BREAK is exact. If nothing splits, that's the first thing to check.
  • Empty blocks. Blocks that are empty after cleanup are filtered silently, but if every block dies, the node errors out. A prompt that's only BREAK lines will do that.
  • No clip. It validates that clip is present and refuses to run without it.

One honest caveat: this is a workflow-ergonomics win, not a quality silver bullet. BREAK-style encoding was always a bit of a community superstition wrapped around a real mechanism - you encode separately, you concat. Whether it changes your results depends on the model. But for keeping a prompt assembled in one readable text box instead of five linked nodes, it's worth it.

CategoryRE-CustomUtils

Inputs (4)

NameTypeDefaultDescription
clipCLIP
break_keywordSTRINGBREAK
textSTRING
cleanupBOOLEANtrue

Outputs (2)

NameTypeDescription
conditioningCONDITIONING
textSTRING