Mpi Latent Upscale
Upscale a latent in pixels, not latent cells — and don't crash on H3
- samples
- LATENT
Core ComfyUI's Upscale Latent has two bugs, and both are silent until they bite. It converts your target to latent cells with a hardcoded /8 - the SD VAE's factor - so on a video model whose VAE downscales by 16, you type 1344×768 and get double that, with no error at all. And it hands the latent straight to a reshape that dies on the packed audio+video latents some models (MiniMax H3) produce. Mpi Latent Upscale fixes both, and it's worth having even if you never touch video.
The headline fix is the stride input. That's "pixels per latent cell for THIS model's VAE," and the tooltip gives you the numbers: 16 for MiniMax H3 and Krea2, 8 for the SD/SDXL family. You type width and height in real pixels and the node divides by the stride to get the right latent dimensions - so the number you type is the number you actually get, which is exactly the trap core's node springs on you. Defaults are 1344×768 with stride 16; flip to 8 and re-type your resolution when you switch back to SDXL.
The second fix is the H3 handling. A MiniMax H3 latent is a NestedTensor pairing a video latent with an audio half of shape [B, 32, 2, T] - time, no spatial dims. Core's common_upscale reshapes it and explodes with AttributeError: 'NestedTensor' object has no attribute 'reshape'. This node unbinds the pair, upscales only the half that has spatial dims (picked by dim() >= 5, not by index), and passes the audio half through untouched, keeping the pair aligned for the next sampler.
The rest of the interface is familiar: samples in, upscale_method out of nearest-exact / bilinear / area / bicubic / bislerp (nearest-exact is the default and the right one for latent upscaling - you don't want smoothing between cells), one LATENT out. If you're on plain SD/SDXL and never touch H3, the only thing you need is the stride mental model: set it to 8, type real pixels, done.
And this node exists to serve the hi-res fix, which the README spells out: sample stage 1 on a small canvas, upscale the latent here, then let stage 2's low sigmas finish at the target resolution. That way only the second half of the denoise pays for the extra pixels - you get the resolution without paying for it twice. The community upscaling wisdom backs this shape: generative detail is added where it belongs, not wasted re-sampling the whole canvas.
Install is the pack's standard no-drama affair: ComfyUI Manager, search "ComfyUi-MpiNodes", install, restart - or
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
No pip dependencies, no model files. From the Mad Pony Interactive pack (engine behind Cubric Vision), and clearly written by someone who got bitten by H3's packed latents enough times to ship a proper fix. If you've ever watched an "upscaled" H3 render come out twice the size you asked for, you'll appreciate why this node exists.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | — | |
| upscale_method | COMBO | nearest-exact | 5 options: nearest-exact, bilinear, area, bicubic, bislerp |
| width | INT | 134416–16384 | Target width in PIXELS, not latent cells. Unlike core's node this is the number you actually want. |
| height | INT | 76816–16384 | Target height in PIXELS. |
| stride | INT | 161–64 | Pixels per latent cell for THIS model's VAE. 16 for MiniMax H3 and Krea2; 8 for the SD/SDXL family. Core hardcodes 8, which is why its node doubles an H3 target. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |