CLIPTextEncodeHunyuanDiT_motorway_edition
Two encoders, two prompt boxes, one condition
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
HunyuanDiT is Tencent's diffusion-transformer image model, and like Flux it doesn't use a single text encoder - it conditions on two of them: a BERT and an mT5-XL. CLIPTextEncodeHunyuanDiT is the node that turns that into conditioning, and this is its Motorway-ed clone: the CLIP comes out of the Motorway by key, you fill in both prompt boxes, and the finished conditioning goes back in under a key you name.
The practical consequence of the two-encoder design is that you write your prompt twice, and the two copies don't have to match word for word. BERT is the tokenizer-ish side - short, keyword-style phrasing plays to it - while the mT5-XL side rewards full natural-language sentences. People who just paste the same text into both boxes get fine results; people who tune the two separately get noticeably better prompt adherence, because each encoder is doing a different job.
How it works
The wrapper pulls one thing out of the Motorway and writes one back:
INPUT_clip_key- key for the HunyuanDiT CLIP (defaultclip). This needs to be the dual-encoder CLIP loaded for this model family, not an SD1.5 CLIP - architecture mismatch here produces silent garbage.bert- the prompt for the BERT encoder (multiline).mt5xl- the prompt for the mT5-XL encoder (multiline).OUTPUT_CONDITIONING_key- where the combined conditioning goes, defaultCONDITIONING.
The node instantiates the real core CLIPTextEncodeHunyuanDiT, runs both encoders, and stores the result under the output key. The only visible output is the MOTORWAY 🚌💨; the sampler downstream reads the CONDITIONING key.
One thing to keep straight: this is Hunyuan DiT, the image model - the node lives under advanced/conditioning and takes still-image conditioning. Don't confuse it with HunyuanVideo's text handling; different node, different pipeline, and the video side has its own encoders and its own conditioning shape.
Motorway specifics
MOTORWAY 🚌💨 is required. The defaults assume your CLIP lives under clip; if your loader wrote it under CLIP, update the field or you'll hit the signature 'MotorwayClass' object has no attribute 'hash_' error. Keys overwrite as they flow down the chain, so don't write this conditioning over a CLIP key you still need.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway
Restart, or find "ComfyUI_agilly1989_motorway" in ComfyUI Manager. No pip dependencies; the HunyuanDiT model files themselves are a separate download.
Fine print
This is an explicitly-beta pack - README opens with "BIG BROKEN WITH ASYNC WILL FIX WHEN I GET THE TIME/MOTIVATION" - and the current hotfix release has the _motorway_edition clone generation commented out of __init__.py, so on the newest main these nodes may not load at all. A workflow referencing them and coming up with missing nodes is hitting exactly that. GitHub issues are the channel; the author has said his Discord DMs get ignored.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_clip_key | STRING | clip | — |
| bert | STRING | — | |
| mt5xl | STRING | — | |
| OUTPUT_CONDITIONING_key | STRING | CONDITIONING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |