Nodes/ComfyUI-Long-CLIP/LongCLIPTextEncodeFlux
ComfyUI Node

LongCLIPTextEncodeFlux

The Flux node whose name is a lie (the harmless kind)

By SeaArtLab·Created 2 years ago·Updated about a year ago· 164
LongCLIPTextEncodeFlux
  • clip
  • CLIP
clip_name

It doesn't encode text. It patches a CLIP.

Read the name and you'd guess this node takes a prompt and spits out conditioning. It doesn't. LongCLIPTextEncodeFlux takes a CLIP plus a model file and hands you back a different CLIP - you still need a separate CLIPTextEncode node to actually encode anything. The name is a lie, but the harmless kind: it calls no API, needs no key, and doesn't touch your prompt directly.

Why you'd swap Flux's CLIP at all

Flux runs a dual text stack: the small CLIP-L (the same encoder SD 1.5 uses, with its 77-token ceiling) paired with Google's big T5-XXL. T5 is the reason Flux handles whole sentences - it reads long natural-language prompts in one pass, with no 77-token wall anywhere in sight. That's the context that makes this node interesting: the thing Long-CLIP fixes was never Flux's actual bottleneck, because T5 was doing the heavy lifting all along.

What this node does, per the source, is clone your Flux CLIP and replace the clip_l half with Long-CLIP-L running at 248 tokens, leaving t5xxl untouched. The combined encoder encodes with both halves, returns T5's output as the conditioning and Long-CLIP's pooled vector for guidance. One detail the code is very insistent about: it will not pad T5 to match the longer CLIP run - the tokenizer comments literally say "Do NOT pad T5XXL!" - so T5 keeps its own far-longer context and the two encoders just run at their natural lengths.

The README credits zer0int's work for this path. That's the CLIP fine-tuner who released his own Long-CLIP 248 drops, and that fine-tuning lineage is why a Flux-compatible long CLIP exists at all.

Inputs and outputs

  • clip_name - the LongCLIP-L weights file in your models/clip (or models/text_encoders) folder.
  • clip - a CLIP input. Wire the CLIP output of DualCLIPLoader configured for the FLUX.1 dev/schnell combo (t5xxl + clip_l).

Output: a single CLIP. It feeds CLIPTextEncode for positive and negative prompts, whose conditioning goes into FluxGuidance and then your guider - the same downstream path as the stock Flux CLIP.

Installing it

Same pack as the other two nodes - ComfyUI Manager (search "ComfyUI-Long-CLIP"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/SeaArtLab/ComfyUI-Long-CLIP

Restart, download longclip-L.pt from BeichenZhang/LongCLIP-L into models/clip (or models/text_encoders on newer ComfyUI). The README's "models/checkpoints" instruction is a typo - the node reads the clip folder. No extra dependencies; the pack ships no requirements.txt and leans on ComfyUI's existing torch/safetensors stack.

Common issues

  • Nothing in the clip_name dropdown → wrong folder. models/clip or text_encoders, not checkpoints.
  • Error loading the CLIP → check your DualCLIPLoader type. This node assumes the input CLIP has a t5xxl member, so it must be the Flux (t5xxl + clip_l) combo - feed it an SDXL or SD 1.5 CLIP and there's nothing to patch.
  • Expecting a miracle on prompt length → the honest take: Flux prompts were never truncating at 77 tokens, because T5 handled the sentence. Long-CLIP here nudges the CLIP-side signal. Some people report better fine-detail adherence; nobody reports a night-and-day change. It's a tinkerer's node, and that's fine - for Flux you're mostly swapping in this pack for curiosity, not rescue.
CategorySeaArt

Inputs (2)

NameTypeDefaultDescription
clip_nameCOMBO0 options:
clipCLIP

Outputs (1)

NameTypeDescription
CLIPCLIP