Nodes/duckcomfy personal nodes/Clip Chunk Manager
ComfyUI Node

Clip Chunk Manager

See — and fix — where CLIP silently breaks your prompt

By duckcomfy·Created about a year ago·Updated 10 months ago· 0
Clip Chunk Manager
  • clip
  • CONDITIONING
text

Clip Chunk Manager is the one genuinely original node in this pack, and it's aimed at a problem almost nobody sees: CLIP text encoders (the SD 1.5 / SDXL / Illustrious lineage) silently split your prompt into 77-token chunks, and that split can land in the middle of a tag. When it does, the tag's meaning gets mangled across the boundary and you get subtly wrong output with no error and no warning. This node makes the split visible and gives you back control over it.

The pack author calls it the reason the pack exists, and the README is refreshingly honest about it - it's marked ALPHA, mostly written by Claude, backed by a suite of hand-built test cases, and "the code quality is awful." That's the tone to calibrate your expectations with: the idea is excellent and it works, but you're using a sharp tool from someone who knows it's rough.

How it works

Two halves. First, as an encoder it behaves like CLIP Text Encode with a BREAK twist: your text is split on BREAK, each chunk is tokenized and encoded separately, and the conditioning tensors are concatenated along the token axis. That's how you manually force clean chunk boundaries - put BREAK exactly where you want the split, and CLIP chunks where you say instead of where it likes.

Second, and this is the clever part: a small frontend extension watches the text widget, and when the box loses focus it asks the backend to insert explicit BREAK markers wherever CLIP would have silently split the prompt. The backend loads only the CLIP from your checkpoint (not the whole model - it's a lean call), tokenizes your prompt, untokenizes each chunk to find where the 77-token boundaries fall, and rewrites your text with BREAK inserted at those exact points. Blur the widget and you literally see where the boundary was landing - including when it cuts a tag in half, which is the thing you could never see before.

Inputs and output

  • text - the prompt, multiline.
  • clip - the CLIP model, wired from your checkpoint or CLIP loader.
  • Output CONDITIONING, exactly like a standard text encode.

What it can and can't do

It's a CLIP tool for CLIP models. On SD 1.5, SDXL, and their finetunes, BREAK and chunk boundaries are real mechanics, and this node is genuinely useful for catching mid-tag splits. On the LLM-encoded generation (Flux 2, Z-Image, Krea 2, Anima), there's no 77-token boundary to break against - BREAK is meaningless there, so don't expect the magic to apply. Also, the auto-BREAK-on-blur needs to find a checkpoint: it looks for the connected CheckpointLoaderSimple (or scans the workflow for one), and if there's no checkpoint it can identify, it just skips the rewrite with a console warning.

Install

Part of duckcomfy personal nodes. ComfyUI Manager → search "duckcomfy personal nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/duckcomfy/duckcomfy_personal_nodes

Restart ComfyUI. No pip dependencies, no model downloads. Because it's ALPHA, keep an eye on updates - the author says they'll refine it when time allows, so the rough edges are known and being worked.

Gotchas

Expect the alpha roughness: the auto-insertion only fires on blur (not as you type), and it rewrites your widget text, so a prompt you'd carefully formatted may come back with BREAKs you didn't add - that's the feature, but it can be surprising on first use. It depends on CLIP-L tokenization, so checkpoints without a proper CLIP-L text encoder (some Flux/GGUF setups) won't get boundary detection. And since it's Claude-written, treat odd corner cases (heavily nested weights, comments) with suspicion - the test suite is solid but the author openly calls the code quality poor. For a pack of plumbing, this is the one node with real ideas in it.

Categoryduckcomfy

Inputs (2)

NameTypeDefaultDescription
textSTRINGThe text to be encoded.
clipCLIPThe CLIP model used for encoding the text.

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONINGA conditioning containing the embedded text used to guide the diffusion model towards generating specific images.