Nodes/HunyuanVideo-1.5 nodes/HunyuanVideo Glyph by T5
ComfyUI Node

HunyuanVideo Glyph by T5

Rendering real text in HunyuanVideo 1.5 — the glyph trick

By yuanyuan-spec·Created 10 months ago·Updated 10 months ago· 28
HunyuanVideo Glyph by T5
  • byt5_kwargs
  • prompt_format
  • hyvid_cfg
  • extra_kwargs
enable_offloadingtrue

Video models are famously bad at writing words. Ask one for a sign that says "CAFE" and you get a six-letter soup of half-formed glyphs. HunyuanVideo 1.5 sidesteps this with a second text path based on byT5 and the Glyph-SDXL-v2 checkpoint, and HyVideo15GlyphByT5 is the node that runs it. If you're generating clips with legible signage, captions, or any text baked into the frame, this is the piece of the complete workflow you're looking for.

How it works

The main prompt is encoded by the big Qwen2.5-VL text encoder into hyvid_embeds. But 1.5 has an extra trick: quoted strings inside your prompt get pulled out and encoded separately by byT5, which is a byte-level T5 model - the "Glyph" half of the name, borrowed from Glyph-SDXL's image-text rendering. This node reads the prompt out of hyvid_cfg, finds everything wrapped in quotes (it regexes for "..." and “...”), tokenizes and encodes it with the byT5 model, and packages the result as extra_kwargs. That dict then travels into HyVideo15Transformer, which feeds the glyph embeddings to the model alongside the normal text conditioning.

So the practical recipe is: put the text you want rendered in quotes inside your prompt, e.g. a prompt ending in ...a neon sign reading "COFFEE". The regex only matches quoted substrings, so unquoted words get no special treatment. enable_offloading (default on) shuttles the small byT5 model to the offload device while it works, keeping VRAM free for the transformer.

The inputs that matter

  • byt5_kwargs and prompt_format - both come straight from HyVideo15Byt5Loader. That loader is the prerequisite; without it there's nothing to encode with.
  • hyvid_cfg - optional, from HyVideo15CFG, so this node knows the prompt and whether classifier-free guidance is on (guidance_scale > 1 doubles the embeddings for the negative side).

Output is extra_kwargs (HYVID15EXTRAKWARGS), which goes into HyVideo15Transformer.

Installing it

Same pack as everything else: ComfyUI Manager → search "HunyuanVideo-1.5 nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/yuanyuan-spec/comfyui_hunyuanvideo_1.5_plugin
cd comfyui_hunyuanvideo_1.5_plugin
pip install -r requirements.txt

Restart, and make sure the models are present. This node needs two things under ComfyUI/models/text_encoders/: byt5-small (from google/byt5-small) and Glyph-SDXL-v2 (from ModelScope, AI-ModelScope/Glyph-SDXL-v2). HyVideo15Byt5Loader will auto-download both when its paths are set to "None", so if that loader runs clean you're set.

Gotchas

The most common failure is the glyph checkpoint missing: you'll get a RuntimeError naming Glyph-SDXL-v2/checkpoints/byt5_model.pt. That means the ModelScope download didn't complete - check the text_encoders/Glyph-SDXL-v2 folder and grab the file manually from the ModelScope page if needed. Also don't expect miracles: glyph rendering in a video model is still a young feature, so short, high-contrast text works far better than long sentences, and it renders at the resolution of the frame - a 480p clip will not give you crisp 1080p typography. The simplified samplers also load byT5 internally, but only the complete workflow exposes the toggle; that's the price of the one-click convenience.

CategoryHunyuanVideoWrapper1.5

Inputs (4)

NameTypeDefaultDescription
byt5_kwargsHYVID15BYT5KWARGS
prompt_formatHYVID15MULTILINGUALPROMPTFORMAT
enable_offloadingoptBOOLEANtrue
hyvid_cfgoptHYVID15CFG

Outputs (1)

NameTypeDescription
extra_kwargsHYVID15EXTRAKWARGS