Nodes/VRGameDevGirl Video Enhancement Nodes/MiniMax H3 Spatial Tile Plan (VRGDG)
ComfyUI Node

MiniMax H3 Spatial Tile Plan (VRGDG)

One node that does the tiling math so your H3 upscale stops OOMing

By vrgamegirl19·Created about a year ago·Updated about 23 hours ago· 819
MiniMax H3 Spatial Tile Plan (VRGDG)
    • grid_rows
    • grid_cols
    • spatial_w_overlap
    • spatial_h_overlap
    • fade_width
    • fade_height
    • min_tile_size
    • chunk_length
    • temporal_overlap
    • tile_width
    • tile_height
    • summary
    ◄width1920►
    ◄height1088►
    ◄vram_preset16gb►

    Upscaling video on a consumer card is a puzzle with an annoying number of dials: how many tiles across, how many down, how much overlap between them, how many frames per chunk, how much temporal overlap. Get one wrong and you either run out of memory halfway through a 90-second render or you get visible tile seams and flicker.

    The pack's own answer, in the AI Video Builder, is "don't make the user think about it." This node exposes that same solver to a normal graph. Feed it the resolution you're upscaling to and how much VRAM you have; get back eleven integers and a human-readable summary.

    The eleven integers

    Call it a tile plan. It's resolution-driven, so the only thing that changes the answer is the target size and your card:

    • grid_rows and grid_cols - the tile grid
    • spatial_w_overlap and spatial_h_overlap - requested overlap in pixels
    • fade_width and fade_height - blend width at tile edges
    • min_tile_size - the floor a solved tile is allowed to hit
    • chunk_length and temporal_overlap - how many frames per temporal chunk, and how many frames chunks share
    • tile_width and tile_height - the actual solved tile size
    • summary - a STRING like 2x3 tiles of 384x512px over 1088x1920px (16gb; overlap h=128 w=128, chunk 119 frames)

    The wiring is specific and the node description spells it out: connect width and height to the same values feeding your MMH3 Latent Upscale Params, then send the outputs to MMH3 Spatial Split Params in rows_cols mode and to MMH3 Temporal Split Params - both of which come from the separate Comfyui-MMH3-UltimateUpscale pack, not this one. If you don't have that pack installed, the outputs have nowhere to go. That's the one setup trap worth knowing before you start.

    What the presets actually do

    vram_preset is an enum: 8gb, 12gb, 16gb, 24gb, defaulting to 16gb. Each preset is a target tile area in megapixels, a temporal chunk length, and a desired spatial overlap:

    | Preset | Tile target | Chunk length | Overlap | |---|---|---|---| | 8gb | 0.20 MP | 51 frames | 128 px | | 12gb | 0.30 MP | 85 frames | 128 px | | 16gb | 0.43 MP | 119 frames | 128 px | | 24gb | 0.65 MP | 153 frames | 160 px |

    The node then searches grids up to 9×9 for the one whose tiles best match that target area and the frame's aspect ratio - with a deliberate bias, since overshooting the target area costs double. That's the thing that runs out of memory, so the solver is pessimistic about it. Then it solves equal tiles per axis so that count × tile − (count−1) × overlap = total, snapping to the 16px latent token grid and dropping a grid step if a tile would fall under 256px.

    Temporal overlap is fixed at 17 frames, fade at 64px, minimum tile 256px. You don't get to set those; that's the point.

    Two behaviours to know. Sizes must be positive multiples of 32 - anything else raises, so feed it the exact Pass 2 size your upscale params are configured for, not a rounded-off number. And retired presets from older projects (32gb, custom) still resolve down to 24gb, though 2 Pass Advanced is a tool for cards up to 24GB; much bigger cards should skip tiling and use the plain 2-Pass workflow.

    Install

    ComfyUI Manager → search vrgamedev, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
    

    Restart and hard-refresh the browser. This node is pure arithmetic - no models, no torch, no pip dependencies - which is why the pack can also run the same function in its JavaScript Builder and its tests. The pack's requirements.txt is for the Builder's audio/LLM/training tools and you can skip it for this node.

    You will separately need the MMH3 Ultimate Upscale nodes for the outputs to be usable, plus the H3 learned upscaler checkpoint that upscale passes use.

    When the plan is wrong for you

    If you get an OOM mid-upscale, don't start fiddling with the grid by hand - drop the preset by one step. That's what the mapping is for, and the difference between 16gb and 12gb is roughly a third of the tile area.

    If you see seams or brightness banding between tiles, the plan is usually fine and the problem is on the other side: overlap blending mode and anchor strength in the split params, which the pack pins to tested values in its own workflows. Match its settings rather than inventing your own blend.

    And if the frame is small enough that Pass 2 fits unfragmented, tiled upscaling is just slower for no benefit. Tiling trades speed for memory - that trade shows up all over the video upscaling world - and at modest output sizes you can simply not make it.

    CategoryVRGDG/Video/MiniMax H3

    Inputs (3)

    NameTypeDefaultDescription
    widthINT192032–16384Pass 2 (upscaled) frame width in pixels.
    heightINT108832–16384Pass 2 (upscaled) frame height in pixels.
    vram_presetCOMBO16gb4 options: 8gb, 12gb, 16gb, 24gb

    Outputs (12)

    NameTypeDescription
    grid_rowsINT—
    grid_colsINT—
    spatial_w_overlapINT—
    spatial_h_overlapINT—
    fade_widthINT—
    fade_heightINT—
    min_tile_sizeINT—
    chunk_lengthINT—
    temporal_overlapINT—
    tile_widthINT—
    tile_heightINT—
    summarySTRING—