STARFlow-V Text Encoder Loader (FLAN-T5-XL)
Why STARFlow-V wants a whole FLAN-T5-XL directory, not a file
- text_encoder
Here's a small trap hiding in plain sight: the T2I side of this pack loads its FLAN-T5-XL encoder from a single .safetensors file, but the video side, STARFlow-V, wants a complete local directory. If you've just spent an hour sorting out the T2I text encoder and you drop a weights file into this loader's dropdown, nothing appears - because the dropdown doesn't list files. It lists directories. Understanding that one difference is basically the whole article.
What it does
STARFlowVTextEncoderLoader scans ComfyUI/models/text_encoders/ for subdirectories that contain a config.json - i.e. a full Hugging Face-format model directory - and offers them in the text_encoder_dir dropdown. Pick one and it builds a STARFlowVTextEncoder from that directory, in the dtype you choose. This mirrors how Apple's own pipeline loads the encoder (from the HF hub / local cache), and it's why the README is specific about placing a complete google/flan-t5-xl directory at ComfyUI/models/text_encoders/flan-t5-xl/. The encoder needs its tokenizer, config, and weights together to reproduce the exact reference behavior.
The inputs
Only two, both required, both simple:
text_encoder_dir- the dropdown of local model directories undermodels/text_encoders/. Expectflan-t5-xlafter you set things up. It also accepts an absolute path typed directly, so if your FLAN-T5-XL lives somewhere off the beaten path, you can point straight at it.dtype-bf16(default),fp16, orfp32. The default matches how the 7B checkpoint loads, and that consistency is what you want - no reason to mix.
Output is text_encoder (STARFLOW_V_TEXT_ENCODER), which feeds STARFlowVTextEncode.
Setting it up
Shared pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/RyukoMatoiFan/ComfyUI-STARFlow
pip install -r ComfyUI-STARFlow/requirements.txt
# restart ComfyUI
Then get a full FLAN-T5-XL directory in the right place. If you have huggingface-cli, the clean way is:
mkdir -p ComfyUI/models/text_encoders/flan-t5-xl
huggingface-cli download google/flan-t5-xl --local-dir ComfyUI/models/text_encoders/flan-t5-xl
If you don't want to install the HF CLI, downloading the repo from huggingface.co/google/flan-t5-xl (config, tokenizer files, and the model weights) into that directory works just as well. The node needs the directory to contain config.json - that's its existence check.
Gotchas
If the dropdown shows <no local FLAN-T5-XL directory found in models/text_encoders>, the directory isn't there or lacks config.json. Check the exact path - a nested subfolder like text_encoders/flan-t5-xl/snapshots/... won't match, because the scanner only lists one level deep. And a heads-up for the impatient: because it constructs a full T5EncoderModel from that directory, first load is slow, and the text encoder stays resident between runs (this loader doesn't offload by itself - the text encode node handles that). None of this is a bug; it's just what "load a whole model directory" costs. Get the directory right once and this node quietly becomes a two-dropdown formality.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text_encoder_dir | COMBO | 1 options: <no local FLAN-T5-XL directory found in models/text_encoders> | |
| dtype | COMBO | bf16 | 3 options: bf16, fp16, fp32 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text_encoder | STARFLOW_V_TEXT_ENCODER | — |