XB-BOX - 📝 Wan T5 加载器(FP8)
The Wan T5 loader that reads umt5-xxl, not CLIP
- t5_model
Wan 2.1 and 2.2 don't use a CLIP text encoder for prompts - they use a UM-T5 encoder, which is a much bigger multilingual transformer. If you're building an XB-BOX Wan workflow, this is the node that loads it: it picks a file out of your text_encoders folder, converts its HuggingFace-style key names into the layout Wan's code expects, and hands you a WANTEXTENCODER for XB_WanTextEncode to use. Display name "📝 Wan T5 加载器(FP8)". Without it, the text-encode node upstream has nothing to work with.
How it works
The interesting bit is the key remapping. A stock umt5-xxl safetensors stores weights under HF names like encoder.block.0.layer.1.DenseReluDense.wi_0.weight; the Wan codebase wants blocks.0.ffn.gate.0.weight and friends. This loader does that conversion in memory (_convert_t5_keys), then builds the encoder through the ComfyUI-WanVideoWrapper's wanvideo.modules.t5, loading the tokenizer from the wrapper's own configs/T5_tokenizer folder. It also sniffs the state dict: if the file you pointed it at is already fp8, it flips quantization on automatically.
The inputs that matter
Only two required, and one of them is a dropdown of files:
- model_name - your
umt5-xxl-encodersafetensors (or an fp8 variant). Goes inComfyUI/models/text_encoders. - precision - bf16 default; fp16 saves a bit, fp32 is wasteful here.
- load_device (optional) - defaults to
offload_device, meaning the encoder sits in system RAM and only loads to the GPU when encoding. Good default. - quantization (optional) -
disabledorfp8_e4m3fn. If your card is tight, fp8 roughly halves the ~9GB this thing costs.
Output: a single t5_model socket (WANTEXTENCODER) that plugs straight into XB_WanTextEncode.
Install
The pack installs like the rest of XB_BOX - ComfyUI Manager search XB_ToolBox, or git clone https://github.com/WJLUOXIAO/XB_ToolBox into custom_nodes - then restart. Two prerequisites on top: the ComfyUI-WanVideoWrapper custom node (this loader constructs the encoder through it and needs its tokenizer files), and the actual umt5-xxl weights in text_encoders. Don't try to use this with the standard "Load CLIP" node - wrong type, wrong architecture.
Common issues
The loader will throw Invalid T5 model, expected 'umt5-xxl' format if you point it at a non-T5 file - that's your cue you grabbed the wrong download. If the node list is empty in model_name, you have nothing in text_encoders. And if ComfyUI dies with a wrapper-not-found error, that's the missing ComfyUI-WanVideoWrapper, not a bug in this node.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | 0 options: | |
| precision | COMBO | bf16 | 3 options: bf16, fp16, fp32 |
| load_deviceopt | COMBO | offload_device | 2 options: main_device, offload_device |
| quantizationopt | COMBO | disabled | 2 options: disabled, fp8_e4m3fn |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| t5_model | WANTEXTENCODER | — |