Nodes/Nukun_ComfyUI_Nodes/Wan 2.2 Video Settings (Nukun)
ComfyUI Node

Wan 2.2 Video Settings (Nukun)

The Wan 2.2 frame-count trap, solved before it bites you

By OnekoSL·Created 3 months ago·Updated 11 days ago· 1
Wan 2.2 Video Settings (Nukun)
    • settings
    • width
    • height
    • length
    • fps
    • actual_duration
    • report
    modetext_to_video
    qualitybalanced
    orientationlandscape
    duration_seconds5.00
    fps16
    custom_width960
    custom_height544

    Wan 2.2 is the open video base most local workflows still sit on, and its TI2V-5B model has a quiet quirk: the frame count has to be 4n+1, and the resolution has to cooperate with a 3D causal VAE. Type 5s @ 16fps into a generic empty-latent node and you'll get 80 frames - which is 4n, exactly wrong, and the sampler will hand you back a broken or silently-shifted video. Nukun Wan 2.2 Video Settings exists to make that class of mistake impossible: you say "balanced, portrait, 5 seconds," and it hands you the exact validated frame count and dimensions as a settings object.

    How it works

    It's the front of the pack's Wan 2.2 toolkit, and everything else in that toolkit consumes its settings output. Reading the source, it snaps your duration and FPS into a 4n+1 frame count (intervals * 4 + 1, with the interval count rounded from duration * fps), picks dimensions from its presets, and validates that width/height are divisible by 32. Because it reports actual_duration = length / fps, you also see the small truth: 5 seconds at 16 FPS becomes 81 frames, which is 5.0625 seconds of playback, not 5. The math is right, the name just acknowledges the rounding.

    The inputs that matter

    • mode - text_to_video or image_to_video. Sets whether the downstream latent builder expects a start image.
    • quality - draft (640x352 landscape / 352x640 portrait / 512x512 square), balanced (960x544 / 544x960 / 704x704), quality (1280x704 / 704x1280 / 896x896), or custom.
    • orientation - landscape, portrait, or square; for custom, the node enforces the orientation by swapping dimensions.
    • duration_seconds (default 5) and fps (default 16).
    • custom_width / custom_height - only used when quality is custom; snapped to multiples of 32.

    Outputs are the settings object plus plain width, height, length, fps, actual_duration, and a text report you can log or preview. The settings wire is the one that feeds NukunWan22TI2VLatent and the rest of the toolkit - that's the whole point of this node as a hub.

    The honest take

    If you already have a Wan workflow with hand-tuned frame math, this node replaces a lot of fragile arithmetic with one dropdown. The report output is the quiet hero: it tells you the effective frame count and duration, so you can sanity-check that the video you got matches the video you asked for. It's a thin config node, but it's the linchpin of the pack's segmented continuation workflow - every later node takes these same settings, which is how the whole run stays consistent. For the wider Wan 2.2 story - frozen base, MoE, the fine-tune layer that makes it usable for a lot of people - the KB's Wan panel has the details; here, just know this node is the thing that keeps frame math from eating you.

    Installing it

    Part of Nukun_ComfyUI_Nodes. ComfyUI Manager (search "Nukun"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes
    

    Restart ComfyUI. Dependencies are numpy, Pillow, scipy, and PyWavelets - the Wan model itself comes from your own model folder, not this pack.

    CategoryNukun/Video/Wan 2.2

    Inputs (7)

    NameTypeDefaultDescription
    modeCOMBOtext_to_video2 options: text_to_video, image_to_video
    qualityCOMBObalanced4 options: draft, balanced, quality, custom
    orientationCOMBOlandscape3 options: landscape, portrait, square
    duration_secondsFLOAT5.000.0625–600
    fpsFLOAT161–120
    custom_widthINT96032–16384
    custom_heightINT54432–16384

    Outputs (7)

    NameTypeDescription
    settingsWAN22_VIDEO_SETTINGS
    widthINT
    heightINT
    lengthINT
    fpsFLOAT
    actual_durationFLOAT
    reportSTRING