Nodes/PlagueKind-Nodes/πŸ“ H3 Upscale Size - LD
ComfyUI Node

πŸ“ H3 Upscale Size - LD

Stop typing the upscale size into three nodes β€” let this one decide

By PlagueKindΒ·Created 4 months agoΒ·Updated about 20 hours agoΒ· 145
πŸ“ H3 Upscale Size - LD
    • width
    • height
    • scale
    • report
    β—„width480β–Ί
    β—„height608β–Ί
    β—„modemegapixelsβ–Ί
    β—„megapixels2.00β–Ί
    β—„multiple2.00β–Ί
    β—„long_edge1440β–Ί
    β—„align32β–Ί

    πŸ“ H3 Upscale Size - LD exists because MiniMax H3's ultimate upscale rig asks for the target size in two separate nodes: the one that renders the latent upscale and the one that solves the tiling grid. Nothing checks that they match. When they drift apart you don't get an error - you get tiling you can see, because the tiles were cut for a different picture than the one being cut. This node is the fix: one place decides how big the upscale is, so the number can't disagree with itself.

    It's a pure size calculator, and honestly that's the whole appeal. Feed it the generation size, pick how much bigger you want, and it hands back a single width and height - aspect held, snapped to the model grid. Wire those two outputs into every field that asks. No models, no VRAM, no hidden gotchas in the install.

    How it works

    The source ratio is measured from the width/height you feed in, not assumed. It computes an ideal pair from your target, then snaps both edges to align (32 by default - H3's latent token is 16px and the upscaler works on a 2x2 patch grid on top of that, so 32 is the safe snap). Snapping two numbers independently would bend the ratio, so it searches the nine snapped candidates around the ideal and keeps the one whose ratio sits closest to your source, breaking ties on area. Clever little bit of math, and it's the whole reason the node exists.

    One convention worth internalizing: megapixels here is AREA, not a multiplier. 1 MP = 1024Γ—1024 = 1,048,576 px, the same convention the H3 upscaler's own megapixels mode uses. So 2 MP at 1:1 is 1440Γ—1440, not 2048Γ—2048 - that's 4 MP. If you think in "twice as wide," use multiple mode instead: 2.0 doubles both edges, which is 4x the area.

    Inputs and outputs that matter

    • width / height - the size the video was generated at. Wire these from UnpackLD's outputs so they follow the Studio panel and you never type them twice; that's the intended setup.
    • mode - megapixels, multiple, or long_edge, plus the target field for whichever you pick.
    • align - the snap grid. Keep it at 32 for H3 unless you know the model tolerates less.

    Outputs are the point: width and height (INT) go into every node that asks for the upscale size, scale (FLOAT) is the true linear factor, and report (STRING) prints what you actually got - real megapixel count, linear scale, ratio drift, even "snapping landed on X" - because a target and a snapped result are not the same number, and this is the rare node that tells you both.

    Install

    ComfyUI Manager, search "PlagueKind-Nodes", or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/PlagueKind/ComfyUI-PlagueKind-Nodes.git
    

    Restart ComfyUI. No dependencies beyond stock ComfyUI - this node is pure math. The H3 latent upscaler checkpoints it feeds live in ComfyUI/models/latent_upscale_models and belong to the bigger MMH3 Ultimate Upscale rig in the same pack, not this node.

    Common issues

    • It warns on downscale. The report prints WARNING: this is a DOWNSCALE if you ask for less than you started with, because the H3 latent upscaler only runs at scale >= 1.0 and will raise. The node deliberately doesn't clamp - the upscaler's own refusal is more useful than this node quietly deciding it knew better.
    • Typing the target by hand into the two downstream nodes instead of wiring the outputs is exactly the drift this node exists to remove. If your tiles ever stop matching your frame, check that you're actually wired, not just matching.
    CategoryPlagueKind/upscaling

    Inputs (7)

    NameTypeDefaultDescription
    widthINT48016–16384Source WIDTH - the size the video was generated at. Wire this from UnpackLD's 'width' so it follows the Studio panel and you never type it twice.
    heightINT60816–16384Source HEIGHT - the size the video was generated at. Wire this from UnpackLD's 'height'.
    modeCOMBOmegapixelsHow the target is expressed. megapixels = absolute area (1 MP = 1024x1024 = 1,048,576 px). multiple = linear factor; 2.0 doubles BOTH edges, which is 4x the area. long_edge = pin the longer side in pixels.
    megapixelsFLOAT2.000.05–16[megapixels mode] Target area. Note this is AREA, not a multiplier: 2 MP at 1:1 is 1440x1440, not 2048x2048 - 2048x2048 is 4 MP. Use 'multiple' if you want to think in 'twice as wide'.
    multipleFLOAT2.000.25–8[multiple mode] Linear scale. 2.0 = both edges doubled (4x area). 1.5 = 1.5x each edge (2.25x area).
    long_edgeINT144064–16384[long_edge mode] Pixel length of the LONGER side. The short side follows the source ratio.
    alignINT321–256Both output edges are snapped to a multiple of this. 32 for MiniMax H3 - its latent token is 16px and the upscaler works on a 2x2 patch grid on top of that. Do not lower it unless you know the model tolerates it.

    Outputs (4)

    NameTypeDescription
    widthINTβ€”
    heightINTβ€”
    scaleFLOATβ€”
    reportSTRINGβ€”