Nodes/ComfyUI-Prompt-Helper/Encode (multi-str)
ComfyUI Node

Encode (multi-str)

Break the 77-token wall by putting each line on its own chunk

By Elypha·Created 2 years ago·Updated 12 months ago· 0
Encode (multi-str)
  • clip
  • CONDITIONING
text

If you've ever stuffed a paragraph into a CLIP Text Encode on an SD 1.5 or SDXL model and watched the tail end get ignored, this is the node that fixes it. Encode (multi-str) takes a multi-line text box, encodes each line as its own conditioning chunk, and concatenates them into a single CONDITIONING output. No more silent truncation, and no more hand-placed BREAK tokens.

Here's what's actually happening under the hood. The node splits your text on newlines, trims each part, and drops the empty ones. Then each part goes through the standard two-step encode - clip.tokenize() then clip.encode_from_tokens_scheduled() - and the resulting conditionings are concatenated into one list. On a CLIP model, that means each line gets its own 77-token window instead of everything fighting for one. Each line behaves like its own block, which is precisely the "forest shouldn't bleed into the girl" problem that BREAK used to solve - the KB's prompt-engineering essay calls BREAK "dead weight" on modern LLM encoders because there's no chunk boundary anymore, but here the boundary is real and it's built in.

Two inputs, both required: text (multi-line - the tooltip says it plainly: separate different parts of the conditioning with a newline) and clip (the CLIP model, from a checkpoint, dual, or triple loader). One output: CONDITIONING, wired straight into your sampler's positive or negative input.

The trap

The clip input is checked for None, and the node raises a loud, useful error if it's missing - the message even tells you the usual cause (your checkpoint loader doesn't have a valid text encoder). What it won't warn you about is model compatibility: this is a CLIP-era tool. On Flux and other LLM-encoded models, conditioning chunks and their concatenation work differently and this node's line-splitting isn't the move.

Installing it

The pack is dependency-free - nothing beyond what ComfyUI already installs. ComfyUI Manager → search ComfyUI-Prompt-Helper, or:

cd ComfyUI/custom_nodes
git clone https://github.com/elypha/ComfyUI-Prompt-Helper

Restart, and it's under prompt_helper.

Bottom line: one text box, newline-separated blocks, and a CONDITIONING that finally has room for all of them. For long SDXL prompts it's the difference between "good enough" and "everything I asked for actually showed up."

Categoryprompt_helper

Inputs (2)

NameTypeDefaultDescription
textSTRINGSeparate different parts of the conditioning with a newline.
clipCLIPThe CLIP model used for encoding the text.

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING