Nodes/ComfyUI-WanVideoWrapper/Wan Video Prompt Extender
ComfyUI Node Runs on cloud

Wan Video Prompt Extender

Rewrite short prompts into what Wan actually wants

By kijai·Created about a year ago·Updated 2 months ago· 6,650
Wan Video Prompt Extender
  • qwen
  • STRING
prompt
max_new_tokens512
devicegpu
force_offloadtrue
system_prompt
custom_system_prompt
seed0

Wan responds much better to long, descriptive prompts than to short ones - it was trained on verbose captions, and "a woman walking on a beach" leaves a lot on the table. This node fixes that automatically. It runs a Qwen LLM over your short prompt and rewrites it into the detailed, cinematic style Wan likes: camera language, lighting, motion, the works. It's the same "prompt extension" idea Wan's official tooling uses, wired into ComfyUI so you don't have to hand-write a paragraph or paste your idea into a separate chatbot every time.

It's a genuinely useful quality lever, and one people underuse. If your Wan outputs feel flat or under-specified, expanding the prompt is often a bigger win than fiddling with samplers.

How it works

You feed it a loaded Qwen model (from QwenLoader) and your prompt. It runs the LLM with a system prompt that tells it how to expand - the presets cover T2V and I2V, and the different flavors matter. For I2V especially, the community rule is that the motion prompt should describe only the motion, not re-describe the image; the "I2V Rewriter" and "I2V Imagination" presets exist to produce exactly that kind of text. The expanded prompt comes out as a plain string you then encode and feed to Wan.

The inputs and outputs that matter

  • qwen (QWENMODEL) - the LLM, from QwenLoader. Required; this node is the front end, QwenLoader is the engine.
  • prompt (STRING, multiline) - your short idea. Type it plainly; the node does the elaboration.
  • system_prompt (optional enum) - the rewrite style, and the choice that matters most. Six presets: T2V Movie Director (English/Chinese), I2V Rewriter (EN/CN), and I2V Imagination (EN/CN). Pick T2V for text-to-video, an I2V one when you're animating an existing image. English or Chinese depending on your prompt language.
  • custom_system_prompt (optional) - override the presets with your own instructions if you want a specific expansion behavior.
  • max_new_tokens (default 512) - how long the expansion can run. 512 is plenty for a rich prompt; raise it only if you're getting cut off.
  • seed (optional) - for reproducible rewrites. device (gpu/cpu) and force_offload (default true) control where it runs and whether the LLM is unloaded afterward.

Output is STRING - the expanded prompt. Send it into your text encoder.

How to install it

Ships in the WanVideoWrapper. ComfyUI Manager: search ComfyUI-WanVideoWrapper, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt

then restart. You'll need a Qwen LLM downloaded and loaded through QwenLoader - that's a separate, sizable model download. The extender is only the prompt-writing logic; Qwen does the actual language work.

Common issues & troubleshooting

Output is cut off mid-sentence. Raise max_new_tokens. 512 is usually enough, but a very elaborate expansion can hit the ceiling.

The expansion fights your intent. Wrong preset. Using a T2V Movie Director prompt on an I2V run will make the LLM re-describe the whole scene, which is exactly what you don't want for I2V - the image already provides that. Switch to an I2V preset so it describes motion, not the picture. Or drop in a custom_system_prompt and steer it yourself.

VRAM pressure with Wan loaded too. Leave force_offload on so Qwen unloads after rewriting and the diffusion model gets the memory back. Running the LLM on cpu is a slower-but-VRAM-free fallback.

CategoryWanVideoWrapper

Inputs (8)

NameTypeDefaultDescription
qwenQWENMODEL
promptSTRING
max_new_tokensINT5121–2048Maximum number of new tokens to generate.
deviceCOMBOgpuDevice to run the model on. Default uses the main device.
force_offloadBOOLEANtrueForce offload the model to the offload device after generation. Useful for large models.
system_promptoptCOMBOSystem prompt to use for the model.
custom_system_promptoptSTRINGCustom system prompt to use instead of the predefined ones.
seedoptINT00–18446744073709550000

Outputs (1)

NameTypeDescription
STRINGSTRING