Wan 2.2 Video Settings (Nukun)
The Wan 2.2 frame-count trap, solved before it bites you
- settings
- width
- height
- length
- fps
- actual_duration
- report
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_videoorimage_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), orcustom.orientation- landscape, portrait, or square; forcustom, the node enforces the orientation by swapping dimensions.duration_seconds(default 5) andfps(default 16).custom_width/custom_height- only used when quality iscustom; 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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | text_to_video | 2 options: text_to_video, image_to_video |
| quality | COMBO | balanced | 4 options: draft, balanced, quality, custom |
| orientation | COMBO | landscape | 3 options: landscape, portrait, square |
| duration_seconds | FLOAT | 5.000.0625–600 | — |
| fps | FLOAT | 161–120 | — |
| custom_width | INT | 96032–16384 | — |
| custom_height | INT | 54432–16384 | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| settings | WAN22_VIDEO_SETTINGS | — |
| width | INT | — |
| height | INT | — |
| length | INT | — |
| fps | FLOAT | — |
| actual_duration | FLOAT | — |
| report | STRING | — |