Nodes/Nilor Nodes by Nilor Corp/๐Ÿ‘บ Wan Tile Resolution
ComfyUI Node

๐Ÿ‘บ Wan Tile Resolution

Stop hand-computing tile sizes for Wan upscaling โ€” let it pick a valid one for you

By nilor-corpยทCreated 2 years agoยทUpdated 6 months agoยท 6
๐Ÿ‘บ Wan Tile Resolution
    • tile_width
    • tile_height
    โ—„input_width1920โ–บ
    โ—„input_height1080โ–บ
    โ—„target_width3840โ–บ
    โ—„target_height2160โ–บ
    โ—„size_preferencelargestโ–บ

    Tile-based upscaling for Wan video is a genuinely good technique - generate at 480p, then feed the frames through a tile upscaler to get 1080p or higher without the VRAM explosion of one giant pass. The annoying part is the math. Tile sizes for Wan have hard constraints: they need to be multiples of 16, they have to stay inside a supported dimension range, and the area has to land between the model's minimum and maximum tile areas. Get it wrong and your upscaler either errors or produces tiles that don't tile. ๐Ÿ‘บ Wan Tile Resolution is a calculator that does that arithmetic for you and hands back a valid tile_width and tile_height.

    The way it works is the interesting part, because it's more than a clamp. You give it your source frame size (input_width/input_height) and your target output size (target_width/target_height), and it searches through all the candidate 16-multiple tile sizes that fit inside the model's supported bounds - dimensions between 384 and 1794 pixels, area between 384ยฒ and 1024ยฒ. Among the valid candidates it scores by aspect-ratio fidelity to your source (so the tiles stay close to the shape of your frames), penalizes tiles that smash into the hard bounds, and then picks by your size_preference. "largest" gives you fewer, bigger tiles; "smallest" gives you more, safer ones - useful when VRAM is the binding constraint. The defaults are set up for a 1080p source upscaled to 4K, which is a very reasonable place to start.

    Inputs and output

    • input_width / input_height - your source frame size. Must be positive multiples of 16 (the source checks this and errors otherwise).
    • target_width / target_height - the resolution you're upscaling to, used as the tile-size ceiling.
    • size_preference - largest (default) or smallest.
    • tile_width / tile_height (INT outputs) - wire these into the tile-size inputs of your Wan tile upscale node.

    Installing it

    Part of Nilor Nodes (nilor-corp/nilor-nodes):

    cd ComfyUI/custom_nodes
    git clone https://github.com/nilor-corp/nilor-nodes
    

    or ComfyUI Manager โ†’ search "Nilor Nodes" โ†’ install โ†’ restart. No model files. The README lists Kijai's comfyui-kjnodes as a prerequisite, and the pack pulls its usual heavy dependency stack (boto3, fastapi, huggingface_hub, openexr) no matter how few nodes you use.

    Troubleshooting

    The error messages are unusually specific for this pack, and they tell you exactly what to fix. input_width/input_height must be multiples of 16 - that's the classic trap, since most source resolutions (1920ร—1080 is fine, but 1280ร—720 from a video that got odd frames isn't) pass through untouched. Target dimensions below 384 raise, and if the targets are too small to admit any valid tile, you get a "does not allow a tile within the supported range" error. If you're upscaling to something huge, the search still respects the model's hard area cap, so the tiles it returns are always valid - trust the outputs over whatever you would have hand-picked. This pack has no community support to ask, so the source is your reference; the scoring logic is all there if you want to know exactly why it chose a given tile.

    CategoryNilor Nodes ๐Ÿ‘บ/Utilities

    Inputs (5)

    NameTypeDefaultDescription
    input_widthINT192016โ€“9007199254740991โ€”
    input_heightINT108016โ€“9007199254740991โ€”
    target_widthINT384016โ€“9007199254740991โ€”
    target_heightINT216016โ€“9007199254740991โ€”
    size_preferenceCOMBOlargest2 options: largest, smallest

    Outputs (2)

    NameTypeDescription
    tile_widthINTโ€”
    tile_heightINTโ€”