Rhynio
AI & development

FLUX says your prompt was truncated at 77 tokens? Identify the encoder before shortening it

You see a CLIP warning, or it persists after increasing max_sequence_length. Trace the two text paths below to identify which encoder and configuration to inspect before rewriting your prompt.

The CLIP warning describes one path

A CLIP truncation warning does not establish that all FLUX conditioning lost the same text. In the checked Diffusers FluxPipeline, CLIP and T5 tokenize independently. max_sequence_length sets the T5 tokenization length; it does not lengthen CLIP or switch encoders.

If your warning names CLIP and 77 tokens, identify the CLIP path first. Tokens are not words, and this page does not count them. A missing object in an image cannot establish which text reached either encoder.

Scope: FLUX.1-dev/schnell text-to-image through the named Diffusers pipeline. The worked trace is historical v0.35.1, compared with v0.43.0. These are code-path examples, not universal limits for every FLUX implementation.

Match the warning to the next check

Warning names CLIP
Inspect tokenizer, text_encoder and prompt. The configured CLIP length comes from tokenizer.model_max_length (with a constructor fallback of 77). T5 has a separate check; a CLIP warning alone says nothing conclusive about T5 retention.
Warning names max_sequence_length
In these revisions this is the T5 warning path. Inspect tokenizer_2, text_encoder_2, effective prompt_2 and the sequence setting. The public call rejects a setting above 512; that ceiling does not prove your input fits. The default is 512 in the checked signature, but examples and wrappers may pass another value.
Wrapper, encoder availability or embedding provenance is unknown
Unresolved. Record the pipeline class, installed version, model identifier, loading code, effective arguments and full warning location. Do not infer this routing from a UI label or from advice for another runtime.

Both warning checks compare bounded token IDs with an untruncated tokenization. The decoded warning suffix is not an exact truncation preview here: the checked T5 code slices that display using tokenizer_max_length, even though T5 tokenization uses max_sequence_length. Inspect actual IDs with the matching tokenizer if an exact boundary matters.

Three routing scenarios

Fictional text illustrates routing only. The first two cases assume both encoders and tokenizers are present, valid matching batch inputs, and no precomputed embeddings. They do not claim that the short example triggers a warning.

Same text, separate encoding

prompt
A blue cup beside a red book; then a longer scene description…
T5 input
Same text as prompt
One prompt feeds two independent encoding pathsText encoding branch only, with both encoders present and no supplied embeddings. CLIP uses prompt and tokenizer.model_max_length to produce pooled conditioning. T5 uses prompt because prompt_2 is omitted and max_sequence_length to produce sequence conditioning. Each path has a separate warning check.CLIP pathprompttokenizer → text_encoderLength: tokenizer.model_max_lengthCLIP warning check → pooled conditioningT5 pathprompt_2 → prompttokenizer_2 → text_encoder_2Length: max_sequence_lengthT5 warning check → sequence conditioning
Text branch in the two checked Diffusers versions. Both outputs condition the transformer. Receiving the same text does not imply retaining the same tokens.

With no supplied embeddings and prompt_2 omitted, both paths receive the prompt text. Each tokenizer applies its own truncation. A CLIP warning establishes neither T5 truncation nor that T5 retained everything.

Next check: Inspect tokenizer_2, its effective max_sequence_length and its separate warning. Increasing that setting does not increase CLIP's configured length.

An explicit prompt_2 changes the T5 input

prompt
A blue cup beside a red book; then a longer scene description…
T5 input
A green vase on a table
Separate prompt fields feed separate encodersText encoding branch only, with both encoders present and no supplied embeddings. CLIP uses prompt and tokenizer.model_max_length to produce pooled conditioning. T5 uses an explicit prompt_2 and max_sequence_length to produce sequence conditioning. Each path has a separate warning check.CLIP pathprompttokenizer → text_encoderLength: tokenizer.model_max_lengthCLIP warning check → pooled conditioningT5 pathprompt_2 (explicit)tokenizer_2 → text_encoder_2Length: max_sequence_lengthT5 warning check → sequence conditioning
Text branch in the two checked Diffusers versions. Both outputs condition the transformer. The prompt fields can contain different text.

CLIP receives the cup-and-book prompt; T5 receives the green-vase prompt_2. Even if T5 does not truncate, that does not mean it retained the original cup-and-book text: that text was not its input.

Next check: Compare the actual arguments after wrapper processing. Do not assume the two prompt fields are merged.

Supplied embeddings or an unknown wrapper

Unresolved: the warning alone cannot establish the current conditioning inputs. In these FluxPipeline versions, supplied prompt_embeds bypass both text-encoding calls in encode_prompt. The public call also requires pooled_prompt_embeds when prompt_embeds are supplied.

Next check: Record where both embedding tensors were created, their encoder/tokenizer identities, source text and settings. For a wrapper, record its exact version and effective call. A warning may come from an earlier embedding step.

An omitted or empty string prompt_2 falls back to prompt in these versions because the source uses a truthiness fallback. A nonempty batch list follows the list branch; do not generalize empty-string behavior to every batch. This is not a recommendation to change or disable an encoder.

Check your source revision

The routing branch, independent length arguments, separate warning checks and supplied-embedding branch agree in these two snapshots. Other code can change between them. Use the current official FLUX reference and your installed source together. Unknown versions remain unverified by this comparison.

If an encoder was omitted during loading, first establish how its conditioning was supplied. A public call with precomputed tensors is a different path from generating them from text. Training scripts, ControlNet variants, ComfyUI custom nodes, hosted services, modified tokenizers and newer FLUX families need their own source trace.

Optional configuration record to copy into a document

Keep this record locally; mark unobserved values unknown. Check print preview before printing; this page's print layout has not been verified.

  • Runtime, pipeline class, installed version and source revision:
  • Exact model and loading configuration; both encoder/tokenizer identities and availability:
  • Warning text, emitting function and when it occurred:
  • Effective prompt and prompt_2: explicit / omitted / unknown:
  • CLIP tokenizer length and T5 max_sequence_length:
  • prompt_embeds and pooled_prompt_embeds: absent / supplied / unknown; creation provenance:
  • Outcome: CLIP path / T5 path / unresolved; next evidence to collect:

Evidence and limits

Updated . AI source inspection and lightweight call-recording stub tests of extracted routing statements. No actual tokenizer boundary test, model download, GPU inference, image-adherence comparison or human learning study was performed. Retaining text does not guarantee visual inclusion.

The 2024 FLUX.1-dev discussion and 2025 prompt-length report illustrate recurring confusion. Their replies and image observations do not validate your setup.