Nodes/ComfyUI/CLIP Text Encode (Hunyuan Image)
ComfyUI Node Runs on cloud

CLIP Text Encode (Hunyuan Image)

Prompt Hunyuan Image in English or Chinese

By Comfy-Org·Created 4 years ago·Updated about 23 hours ago· 129,495
CLIP Text Encode (Hunyuan Image)
  • clip
  • CONDITIONING
bert
mt5xl

Hunyuan Image (the model family behind the "HunyuanDiT" name) is Tencent's bilingual image generator, and this is its text-encode node. It's been in core since July 2024 - the original commit literally described it as useful "for testing what each text encoder does" - and it uses two encoders instead of the three or four of the models around it.

The two boxes

  • bert - a bilingual BERT encoder. This is the one that makes Chinese work natively; the model was trained on English and Chinese both.
  • mt5xl - the multilingual T5-XXL. Same idea, much bigger, and it's where long natural-language descriptions land.

You feed both from the Hunyuan Image checkpoint's CLIP output, and the node tokenizes each box into its own slot and encodes them scheduled into one CONDITIONING. Same prompt in both boxes is the default and the safe answer; putting different content in each is a real technique, because the two encoders contribute different feature streams to the sampler.

What actually matters

The bilingual thing isn't a gimmick - it's the reason this node has a dedicated page instead of sharing the generic one. Hunyuan Image genuinely understands Chinese prompts, and if that's your language, you get better adherence writing naturally than fighting through a translator. Even in English it does well, but it's a model that rewards plain descriptive sentences over tag soup.

The gotchas

First, don't leave mt5xl empty. On most Hunyuan Image workflows the mT5 box carries the semantic weight, and a blank one gives you mush. Second, the node expects the Hunyuan Image CLIP specifically - the loader needs to produce a clip that has the mt5xl slot. Feed it a generic SDXL CLIP and you'll get a key error the moment it tries tokens["mt5xl"]. Both boxes take multiline text, so long prompts are fine.

Where it fits

The graph is the standard one: load the Hunyuan Image checkpoint, encode positive and negative through this node, KSampler, decode. It ships with ComfyUI core - nothing to install. If your Hunyuan Image output is ignoring your prompt, your first two suspects are an empty mt5xl box and the wrong CLIP loader, in that order. And if you're being fancy with scheduled prompts, the node encodes from scheduled tokens, so per-frame prompt variation is supported under the hood - but for a first pass, one good sentence in both boxes is all you need.

Categorymodel/conditioning/hunyuan image

Inputs (3)

NameTypeDefaultDescription
clipCLIP
bertSTRING
mt5xlSTRING

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING