HunyuanVideo Custom Prompt Template
Rewriting the system prompt behind your prompt
- hyvid_prompt_template
Here's something a lot of people don't realize about this pack: your prompt never goes to the model raw. It gets wrapped inside a Llama-3-formatted system prompt first, and the wrapper's default templates already tell the LLM to think in terms of five specific aspects - main content and theme, object color/shape/texture/spatial relationships, actions and movement, background/lighting/atmosphere, and camera angles/movements. That instruction text is baked into the built-in I2V_video/I2V_image/text templates you pick from on the encode nodes. This node exists for when you want to replace that instruction with your own.
Most people never need this. It's for when the default framing is steering the model in a direction that doesn't match what you're actually generating - say, you want the LLM focused purely on camera work, or you're testing whether a shorter, less prescriptive prompt gives you more creative freedom.
The inputs that matter
custom_prompt_template- a multiline string, defaulting to the full built-in Llama-3 chat template (system message plus a{}placeholder where your actual prompt text gets inserted). If you edit this, you need to preserve the Llama-3 special-token format (<|start_header_id|>,<|eot_id|>, and so on) - the model expects that exact structure to parse the conversation correctly.crop_start(default 95) - this is the one people miss. The LLM's raw output includes the system-prompt boilerplate along with the actual descriptive content;crop_starttells the wrapper how many tokens of that boilerplate to strip off before what's left conditions the diffusion model. It's tuned to match the default template's length. If you shorten or lengthen the system prompt incustom_prompt_template, you need to adjustcrop_startto match, or you'll either leak instruction text into your conditioning or accidentally crop off part of your actual prompt.
Output: hyvid_prompt_template, a PROMPT_TEMPLATE object that plugs into the wrapper's text-encoding pipeline in place of the built-in template choice.
How to install it
Ships with the pack - no separate download.
- ComfyUI Manager - search ComfyUI-HunyuanVideoWrapper, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper, thenpip install -r ComfyUI-HunyuanVideoWrapper/requirements.txt, restart.
You'll still need the LLM text encoder loaded (DownloadAndLoadHyVideoTextEncoder) - this node only changes what instruction that LLM receives, not whether you need it.
Common issues & troubleshooting
Output describes something completely unrelated to your prompt, or reads like instructions leaked into the scene. Almost always a crop_start mismatch after editing the template. If you changed the length of your custom system prompt, recount and update crop_start - it has to track the template, not stay at the default.
Errors from the LLM, or nonsensical output. Check the Llama-3 special-token formatting is intact and the {} placeholder for your actual prompt is still present exactly once. This model's LLM encoder expects a specific chat format; breaking it doesn't fail gracefully.
No visible difference from the defaults. If your custom template says roughly the same thing as the built-in one, don't expect dramatically different results - this node changes instructions to the LLM, not the diffusion model's own behavior. It's a way to redirect what the LLM extracts and emphasizes from your prompt, not a new feature layer on top of generation itself.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| custom_prompt_template | STRING | <|start_header_id|>system<|end_header_id|> Describe the video by detailing the following aspects: 1. The main content and theme of the video.2. The color, shape, size, texture, quantity, text, and spatial relationships of the objects.3. Actions, events, behaviors temporal relationships, physical movement changes of the objects.4. background environment, light, style and atmosphere.5. camera angles, movements, and transitions used in the video:<|eot_id|><|start_header_id|>user<|end_header_id|> {}<|eot_id|> | — |
| crop_start | INT | 95 | To cropt the system prompt |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| hyvid_prompt_template | PROMPT_TEMPLATE | — |