Nodes/Custom Resolution I2V/CustomResolution_I2V_v1.1
ComfyUI Node

CustomResolution_I2V_v1.1

Wan I2V resolution that survives the VAE, minus the mental math

By AugustusLXIII·Created 8 months ago·Updated 8 months ago· 0
CustomResolution_I2V_v1.1
    • width
    • height
    • length
    • framerate
    aspect_ratioPortrait (2:3)
    resolution_levelk30: 480x720 / 440x784 / 592x592
    manual_overridefalse
    manual_width0
    manual_height0
    framerate16
    video_duration5.0

    Wan Image-to-Video is finicky about its numbers in a way that trips up everyone their first week. Dimensions have to be compatible with the 3D causal VAE, and the frame count has to land exactly right - 5 seconds at 16 fps is 81 frames, not 80, because Wan wants duration × fps + 1. Miss it and you get encoding errors, black tails, or a clip that just refuses to queue. CustomResolution_I2V is a tiny pure-math node that hands you all four numbers - width, height, frame length, framerate - precomputed against the Wan spec. No models, no GPU work, no hidden downloads. It's the sort of node you'd normally write yourself in five minutes, and you still might, but this one has the preset table done and versioned for you.

    What it actually does

    The whole node is one calculate_params function that returns four values. Pick an aspect ratio and a resolution tier and it looks up the matching dimensions from a built-in database of 20 tiers (k18 up through k55) covering three orientations each: portrait 2:3, portrait 9:16, and square. Landscape just swaps the portrait dimensions, so you're never hunting for a second set of numbers.

    The part worth respecting is the frame math. length is computed as int(video_duration × fps) + 1, which is exactly the convention the community settled on for Wan - 3 s at 16 fps gives 49 frames, 5 s at 16 fps gives 81, the two most common clip lengths in the wild. It's the classic off-by-one that produces silently broken clips, and this node removes the whole class of bug.

    The inputs that matter

    Seven inputs, and you'll touch maybe four:

    • aspect_ratio - Portrait (2:3), Portrait (9:16), Landscape (3:2), Landscape (16:9), or Square. The 16:9 and 9:16 options were the headline addition in v1.1 for cinematic and mobile work.
    • resolution_level - a k18–k55 dropdown. Each entry shows all three orientations ("k30: 480x720 / 440x784 / 592x592"), so don't be confused by the three numbers - only the one matching your aspect ratio is used. k30 is the default and is the sane starting point; k55 tops out around 880x1320 / 808x1440 / 1040x1040, which your VRAM probably won't thank you for.
    • manual_override with manual_width / manual_height - flip it on and your custom dimensions get rounded to the nearest multiple of 8 via (n + 4) // 8 * 8, which is what stops the "invalid shape" encoder errors. Leave either at 0 and it falls back to the preset level, which is a nice safety net.
    • framerate (16/24/30) and video_duration (1.0–10.0 s) feed the frame count. 16 fps is the Wan-native default; the 10-second cap is less a limit and more the model telling you where quality stops anyway.

    The manual width/height widgets grey out until you enable the override - that's the small JS extension the pack ships, and it's the only bit of "web" in this node.

    Installing it

    ComfyUI Manager is the way: search "Custom Resolution I2V", hit Install, restart. Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AugustusLXIII/ComfyUI_CustomResolution_I2V.git
    

    Restart ComfyUI and you'll find it under the WanVideo category. There is nothing else to do - the requirements.txt literally says no external dependencies, there are no model files, and it does not call any API. This is as friction-free as a custom node gets.

    Wiring it up

    Feed width, height, and length into your Wan I2V pipeline wherever it asks for latent dimensions and frame count - typically the empty-latent/VHS node feeding the Wan sampler, and framerate into anything that needs the FPS for the video encode. Everything stays an INT (or FLOAT for framerate), so it drops straight into standard inputs. Because it's pure math, it also makes a great control node: wire the same numbers into a text display to see exactly what your workflow is about to generate before you spend ten minutes waiting on a 14B model.

    Where people get burned

    The main trap is reading the resolution dropdown wrong - the "k30: 480x720 / 440x784 / 592x592" format lists all three aspect ratios, so grab the value that matches your selected orientation. And if you type a manual dimension that isn't a multiple of 8, don't fight it: the rounding is deliberate, and fighting it by picking 1240 instead of 1248 just moves the problem downstream. The node caps duration at 10 s for good reason - past 81 frames Wan clips start degrading no matter what your generator says.

    CategoryWanVideo

    Inputs (7)

    NameTypeDefaultDescription
    aspect_ratioCOMBOPortrait (2:3)Set the orientation. For Landscape options, the Portrait dimensions are swapped. Shown in order: 2:3, 9:16, Square.
    resolution_levelCOMBOk30: 480x720 / 440x784 / 592x592Predefined resolution tiers. Displays 2:3, 9:16, and Square dimensions respectively.
    manual_overrideBOOLEANfalseUse manual_width and manual_height instead of the preset levels.
    manual_widthINT00–8192
    manual_heightINT00–8192
    framerateCOMBO16Target frames per second.
    video_durationFLOAT5.01–10Total length of the video in seconds.

    Outputs (4)

    NameTypeDescription
    widthINT
    heightINT
    lengthINT
    framerateFLOAT