H3 Latent Upscale (video only, audio kept) [experimental]
Upscale the video latent, keep the audio bit-exact, skip the VAE round trip
- samples
- samples
- report
Stock ComfyUI's LatentUpscale can't touch an H3 latent at all. H3's samples are a nested tensor - video (B,24,T,h,w) plus audio (B,32,2,aT) - and a 2D interpolate on either member is meaningless. H3 LatentUpscale is the fix: it resizes only the video half's height and width on the legal grid, and passes the audio through untouched and bit-exact. It's experimental, but it's what lets an upscale-and-refine pass stay latent-resident instead of doing the decode → pixel resize → re-encode dance between passes.
How it works
Mechanically it's straightforward: interpolate the video channels spatially, leave everything else alone. The time axis is never touched - token count, the 17k+5 grid, and the audio clock all stay exactly as they were. Two things to know before you reach for it:
- Sizes snap to the legal grid. One latent cell is 16 image pixels and legal frames are multiples of 32 px, so targets round to an even number of cells.
scale(default 2, 0.25–4) is used unlesswidthorheightis nonzero, and a nonzero value overrides that axis (both snap to the /32 grid). - The trade is real. The VAE round trip the pixel path pays for also re-derives detail. A latent upscale can come back softer, because resizing in latent space is just interpolation - nobody is re-inventing texture. The node's own description says it straight: measure before adopting it, A/B against the pixel path on your content.
The one mode decision is mode: bilinear (default, smoother) or nearest-exact (keeps latent cell values verbatim).
Where it fits
The pack's upscale de-rope graph renders pass 1 at 0.4 MP, resamples the smeared frames up, and regenerates at the target size - that's the pixel path. This node is the latent-resident alternative for when you want the de-rope and the spatial upscale in the same second pass without a VAE decode in the middle. Just remember the sharpness caveat: the pixel path's round trip is expensive but it buys back detail, so on content where texture matters you may prefer to pay it.
Install
It's in the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/matlowai/ComfyUI-MAINodes
or search ComfyUI-MAINodes in ComfyUI Manager and restart. Category: latent/minimax/motion. No dependencies beyond the pack itself.
Common gotchas
People tend to get burned by the snapping first: you ask for 640×384 and get something slightly different, because it has to land on the cell grid - check the report output (a text wire, same report output you'll see on the oracle) for what actually happened. And if you feed it a plain video latent from VAEEncode (no audio), that's fine - it stays plain; the audio path just has nothing to pass. The softer-than-pixel-path result isn't a bug; it's the documented cost of skipping the VAE round trip.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | H3 nested AV latent, or a plain video latent from VAEEncode | |
| scale | FLOAT | 2.000.25–4 | spatial scale factor; snapped to the /32-pixel (/2-cell) grid |
| mode | COMBO | bilinear | bilinear (default) is smoother; nearest-exact keeps latent cell values verbatim |
| widthopt | INT | 00–8192 | 0 = use scale. Nonzero: target IMAGE width, snapped to /32 |
| heightopt | INT | 00–8192 | 0 = use scale. Nonzero: target IMAGE height, snapped to /32 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| samples | LATENT | — |
| report | STRING | — |