Nodes/ComfyUI-STARFlow/STARFlow-V Text Encoder Loader (FLAN-T5-XL)
ComfyUI Node

STARFlow-V Text Encoder Loader (FLAN-T5-XL)

Why STARFlow-V wants a whole FLAN-T5-XL directory, not a file

By RyukoMatoiFan·Created 8 months ago·Updated 2 months ago· 0
STARFlow-V Text Encoder Loader (FLAN-T5-XL)
    • text_encoder
    text_encoder_dir
    dtypebf16

    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 under models/text_encoders/. Expect flan-t5-xl after 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, or fp32. 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.

    CategorySTARFlow-V

    Inputs (2)

    NameTypeDefaultDescription
    text_encoder_dirCOMBO1 options: <no local FLAN-T5-XL directory found in models/text_encoders>
    dtypeCOMBObf163 options: bf16, fp16, fp32

    Outputs (1)

    NameTypeDescription
    text_encoderSTARFLOW_V_TEXT_ENCODER