STARFlow T5 Text Encode
STARFlow speaks FLAN-T5-XL, and this node is the mouth
- conditioning
Most ComfyUI models are picky about their text encoders - SD 1.5 wants CLIP, SDXL wants the double stack, FLUX wants T5. STARFlow's pick is FLAN-T5-XL, and STARFlowT5TextEncode is the node that turns your prompt into the conditioning the sampler actually understands. It's the closest thing in this pack to a standard CLIPTextEncode, with one structural difference you'll trip on: it needs the T5 weights dropped into your text_encoders folder as a single file, and it builds the architecture itself.
How it works
The node loads a T5 encoder using the google/flan-t5-xl config, then loads the weights from whatever file you point it at. It grabs the tokenizer from Hugging Face's cache - that's a tiny download, don't panic. Then it does the STARFlow-specific prompt wrapping: your text gets an aspect ratio appended (e.g. ... in a 16:9 aspect ratio.), optionally a noise level prepended, and it encodes both your prompt and an empty-string negative so the sampler has both halves for classifier-free guidance. Both embeddings get concatenated into one STARFLOW_CONDITIONING tensor, which is why you only see one output.
The T5 model itself is cached in memory between runs, so after the first encode, subsequent ones are fast.
The inputs that matter
t5_model- the dropdown of files inComfyUI/models/text_encoders/. You want an encoder-only safetensors file, likemodels--google--flan-t5-xl--text_encoder.safetensors. The node literally prints a warning if your file looks like decoder weights. This is the number-one way people break this node.text- your prompt. It's a force-input string, so the node expects you to wire aString/Textnode into it rather than type in a widget. Multiline, so feed it a whole paragraph.aspect_ratio-1:1,16:9,9:16,4:3,3:4,21:9,9:21. This gets baked into the conditioning and tells the sampler what canvas to make. Pick it here, not in some EmptyLatent node.
Then the optional extras: max_length (128 default, up to 512) is the token cap; noise_std (0.3 default) is the noise level baked into conditioning if you enable cond_noise_level (false by default). For a first run, change nothing except the text and aspect ratio.
Output is a single STARFLOW_CONDITIONING that only STARFlowSampler consumes.
Installation
Same pack install as the rest of this suite:
cd ComfyUI/custom_nodes
git clone https://github.com/RyukoMatoiFan/ComfyUI-STARFlow
pip install -r ComfyUI-STARFlow/requirements.txt
# restart ComfyUI
The requirements.txt adds transformers and sentencepiece - you need both for T5 tokenization, and ComfyUI won't have sentencepiece by default. Model-wise you need the FLAN-T5-XL encoder file in ComfyUI/models/text_encoders/; converted files and checksums are published at huggingface.co/AkaneTendo25/starflow.
Common issues
The classic failure: you drop a full FLAN-T5-XL checkpoint or a decoder-flavored file in and get a silent-ish mismatch - the node loads with strict=False, so it may print "missing/unexpected" counts and continue with garbage conditioning. Check the console output on first load; it explicitly warns when the file looks like decoder weights. Second classic: forgetting the aspect ratio here and then wondering why the sampler's output shape doesn't match your expectation - the sampler derives everything from this node's metadata, so this is where the geometry is decided. Get the encoder file right and a String wired in, and this node fades into the background, exactly where a text encoder belongs.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| t5_model | COMBO | T5-XL model file from models/text_encoders/ (e.g., flan-t5-xl.safetensors) | |
| text | STRING | Text prompt to encode (connect a String node) | |
| aspect_ratio | COMBO | 1:1 | Output aspect ratio |
| max_lengthopt | INT | 12864–512 | Maximum sequence length for T5 tokenizer |
| noise_stdopt | FLOAT | 0.300–1 | Noise standard deviation for generation |
| cond_noise_levelopt | BOOLEAN | false | Include noise level in text conditioning |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| conditioning | STARFLOW_CONDITIONING | — |