Nodes/ComfyUI-HunyuanVideoWrapper/HunyuanVideo Context Options
ComfyUI Node Runs on cloud

HunyuanVideo Context Options

Generating longer clips than the model was built for

By kijai·Created 2 years ago·Updated 12 months ago· 2,595
HunyuanVideo Context Options
    • context_options
    context_schedule
    context_frames65
    context_stride4
    context_overlap4
    freenoisetrue

    This is one of the few genuinely good reasons to still reach for this wrapper in 2026 rather than native ComfyUI Hunyuan support. Kijai says so directly in the README's own list of what's missing from native: "context windowing" is named first. This node is that feature.

    The idea is the same sliding-context-window technique AnimateDiff-Evolved popularized for extending video length past what a model's architecture and your VRAM would otherwise allow: instead of generating the entire clip as one enormous pass, the sampler processes overlapping windows of frames and blends them together at the seams. VRAM scales with the window size, not the total clip length, which is what makes much longer generations possible without needing proportionally more memory.

    The inputs that matter

    • context_schedule - uniform_standard, uniform_looped, or static_standard. These control how the windows step through the full sequence; uniform_looped is the one to reach for if you specifically want a clip that loops back to its start.
    • context_frames (default 65) - the window size, in pixel frames. The tooltip flags something easy to miss: this is pixel frames, not latent frames, and the latent space compresses 4 pixel frames into 1 - so the actual latent window is a quarter of this number.
    • context_stride (default 4) - how far the window steps forward each pass, in pixel frames, same latent-space caveat.
    • context_overlap (default 4) - how much consecutive windows overlap, which is what gives the blending at the seams something to work with. Same pixel-frame framing.
    • freenoise (default on) - shuffles the noise across windows. The tooltip is terse, but the practical effect community discussion around similar sliding-window techniques describes is reduced repetition and flicker at the window boundaries compared to using identical noise patterns across windows.

    Output: context_options, into HyVideoSampler's optional context_options input.

    How to install it

    Ships with the pack - no separate download for this node.

    • 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.

    No separate model files - this only changes how the sampler processes a clip using a model you've already loaded.

    Common issues & troubleshooting

    Visible seams or a stutter where windows meet. Raise context_overlap - more shared frames between adjacent windows gives the blend more to work with. This costs a bit more compute per window but is usually worth it for a smoother result.

    Motion doesn't feel continuous across the whole clip, or characters/scenes drift. This is an inherent limitation of window-based long-generation techniques generally, not unique to this node - each window only has direct context from its own overlap range, not the entire clip. Keep context_overlap generous and don't expect perfect long-range consistency the way a single short clip would have.

    Still running out of memory despite using context options. Remember context_frames is in pixel frames, divided by 4 for the actual latent window - if you set it very large expecting a small window, you may have actually configured a much bigger one than intended. Also make sure HyVideoBlockSwap is still doing its job; context options reduce how much sequence length costs, not how much VRAM the model itself needs per window.

    Not sure this is even necessary. If your clip already fits comfortably within num_frames on the plain sampler, you don't need this node - it exists specifically for going past what a single-pass generation and your VRAM can handle together.

    CategoryHunyuanVideoWrapper

    Inputs (5)

    NameTypeDefaultDescription
    context_scheduleCOMBO3 options: uniform_standard, uniform_looped, static_standard
    context_framesINT652–1000Number of pixel frames in the context, NOTE: the latent space has 4 frames in 1
    context_strideINT44–100Context stride as pixel frames, NOTE: the latent space has 4 frames in 1
    context_overlapINT44–100Context overlap as pixel frames, NOTE: the latent space has 4 frames in 1
    freenoiseBOOLEANtrueShuffle the noise

    Outputs (1)

    NameTypeDescription
    context_optionsHYVIDCONTEXT