ComfyUI Node Runs on cloud

HunyuanVideo CFG

Turning real negative prompting back on

By kijai·Created 2 years ago·Updated 12 months ago· 2,595
HunyuanVideo CFG
    • hyvid_cfg
    negative_promptAerial view, aerial view, overexposed, low quality, deformation, a poor composition, bad hands, bad teeth, bad eyes, bad limbs, distortion
    cfg2.00
    start_percent0.00
    end_percent1.00
    batched_cfgfalse
    use_cfg_zero_starfalse

    HunyuanVideo is a guidance-distilled model - it has classifier-free guidance baked into its weights (that's what the sampler's embedded_guidance_scale input is), so it can produce well-guided output from a single forward pass instead of the traditional two. The tradeoff is that a real negative prompt - "don't show me X" - doesn't naturally apply the way it does on an older, non-distilled model. This node exists to bring that back: it runs true classifier-free guidance (a real conditional-plus-unconditional pass) for a slice of the schedule you choose, using an actual negative prompt.

    It's a settings node, and its output plugs into the hyvid_cfg optional input on HyVideoI2VEncode - not directly into the sampler, which is easy to assume wrong if you're used to how CFG usually wires up.

    The inputs that matter

    • negative_prompt - multiline text, and it ships with a genuinely useful default you can use as-is or as a template: "Aerial view, aerial view, overexposed, low quality, deformation, a poor composition, bad hands, bad teeth, bad eyes, bad limbs, distortion." That's the author's own tuned starting negative for this model.
    • cfg (default 2) - the guidance scale for this real-CFG pass. Note this defaults lower than typical SD-era negative-prompt values (5-9); this model doesn't need much on top of its embedded guidance.
    • start_percent / end_percent (0 to 1) - where in the schedule this applies. Outside that window, the model falls back to its baked-in guidance_embeds alone.
    • batched_cfg - batches the conditional and unconditional pass instead of running sequentially. Faster, more VRAM.
    • use_cfg_zero_star (default off here, unlike the TextEmbed Bridge node where it defaults on) - a CFG refinement aimed at an early-step artifact.

    Output: hyvid_cfg.

    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, then pip install -r ComfyUI-HunyuanVideoWrapper/requirements.txt, restart.

    Common issues & troubleshooting

    Wired it in but the negative prompt seems to have no effect. Double-check the output actually connects to hyvid_cfg on HyVideoI2VEncode, not directly on the sampler - this is the single most likely mistake, since most people expect a CFG node to attach where sampling happens.

    Generation got noticeably slower after adding this node. That's the expected cost of real CFG: for the percentage of the schedule where it's active, the model runs a genuine conditional-plus-unconditional pass instead of relying on its cheap baked-in guidance. Narrow start_percent/end_percent to cover less of the schedule if the slowdown isn't worth it for your use case.

    Cranking cfg high doesn't behave like it would on an SD-era model. This model already carries strong guidance from its embedded distillation; stacking a high real-CFG value on top can push things further than expected. Start near the default of 2 and nudge up in small steps rather than assuming SD-style values transfer directly.

    CategoryHunyuanVideoWrapper

    Inputs (6)

    NameTypeDefaultDescription
    negative_promptSTRINGAerial view, aerial view, overexposed, low quality, deformation, a poor composition, bad hands, bad teeth, bad eyes, bad limbs, distortion
    cfgFLOAT2.000–100guidance scale
    start_percentFLOAT0.000–1Start percentage of the steps to apply CFG, rest of the steps use guidance_embeds
    end_percentFLOAT1.000–1End percentage of the steps to apply CFG, rest of the steps use guidance_embeds
    batched_cfgBOOLEANfalseCalculate cond and uncond as a batch, increases memory usage but can be faster
    use_cfg_zero_starBOOLEANfalseUse CFG zero star

    Outputs (1)

    NameTypeDescription
    hyvid_cfgHYVID_CFG