Nodes/ComfyUI-QwenImageWanBridge/HunyuanVideo Prompt Expander
ComfyUI Node

HunyuanVideo Prompt Expander

Expand a short prompt using the encoder you already loaded

By fblissjr·Created about a year ago·Updated 4 months ago· 188
HunyuanVideo Prompt Expander
  • clip
  • clip
  • expanded_prompt
  • debug_info
prompt
system_prompt
max_tokens512
temperature0.01
bypassfalse

Here's a genuinely clever bit of engineering. Video models like fuller prompts - the difference between "a dog running" and a proper shot description with lighting, camera, and motion is real. Normally you'd load a second LLM to expand your prompt, eating more VRAM. But HunyuanVideo's text encoder is already a full language model (Qwen2.5-VL). So HunyuanVideoPromptExpander reuses those loaded weights to do the expansion - it adds only the lm_head (the small final layer needed to generate text) rather than loading a whole separate model. Free-ish prompt expansion off the encoder you were going to load anyway.

That's the standout feature: no extra model, no second big download, no doubling your memory. For a workflow that already has the Qwen encoder in memory, this is close to a free upgrade to your prompts.

How it works

You pass it the same clip (Qwen2.5-VL) you loaded for encoding, plus your short prompt. It runs the model in generation mode - using its language-model head - to rewrite your prompt into a richer, more cinematic description, then passes both the clip and the expanded text onward. Temperature defaults very low (0.01), which means near-deterministic expansion: it elaborates faithfully rather than inventing wild new content. There's a bypass toggle so you can wire it into a graph permanently and switch it off when you'd rather use your prompt verbatim.

One honest caveat, and it's the tension at the heart of this node: expansion makes prompts longer, and these LLM encoders start drifting past ~75-100 effective tokens. A tastefully expanded prompt helps; a bloated one hurts. Watch the length.

The inputs and outputs that matter

  • clip (required) - the Qwen2.5-VL encoder. It reuses these weights, which is the whole trick.
  • prompt (required) - your short starting prompt.
  • system_prompt - instructions for how to expand (tone, focus, what to emphasize).
  • max_tokens (default 512) - caps the length of the expansion. Lower it to keep the result tight.
  • temperature (default 0.01) - how creative the rewrite is. Very low means faithful and repeatable; nudge up for variety.
  • bypass (default off) - pass the prompt through unchanged when on.

Outputs: clip (passed through, so you chain it into the encoder), expanded_prompt (the rewritten text - you can inspect it), and debug_info.

How to install it

ComfyUI Manager: search ComfyUI-QwenImageWanBridge, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/fblissjr/ComfyUI-QwenImageWanBridge

then restart. No extra model - it borrows the Qwen2.5-VL weights already loaded by HunyuanVideoCLIPLoader. That's the point.

Common issues & troubleshooting

The expanded prompt is too long and results get muddy. Lower max_tokens. Expansion that pushes past ~75-100 effective tokens works against the encoder's attention; a focused expansion beats an exhaustive one.

The expansion drifts from your intent. Tighten it with a system_prompt telling it what to emphasize, and keep temperature low - at 0.01 it stays close to your prompt, higher lets it wander.

You want your exact prompt this run. Flip bypass on. You can leave the node wired in and toggle expansion per generation instead of rewiring the graph.

CategoryHunyuanVideo/Utilities

Inputs (6)

NameTypeDefaultDescription
clipCLIP
promptSTRINGSimple prompt to expand (e.g., 'a cat watching birds')
system_promptoptSTRINGCustom system prompt (leave empty for default self-expand)
max_tokensoptINT512100–1024Maximum tokens for expanded prompt
temperatureoptFLOAT0.010–1Generation temperature (0.01 = near-deterministic)
bypassoptBOOLEANfalseSkip expansion, pass prompt through unchanged

Outputs (3)

NameTypeDescription
clipCLIP
expanded_promptSTRING
debug_infoSTRING