ComfyUI Node Runs on cloud

NNLatentUpscale

The fastest way to upscale a latent (skip the VAE round-trip)

By Ttl·Created 3 years ago·Updated 2 years ago· 273
NNLatentUpscale
  • latent
  • LATENT
version
upscale1.50

NNLatentUpscale is the node for the hi-res fix pass when you don't want to pay for a VAE decode and re-encode. You generate at native resolution, feed the latent straight into this node, and it grows the latent with a small trained network before you run a second, low-denoise KSampler. No pixels, no VAE, no image upscaler in the middle.

Why that matters: the usual route - VAE decode → upscale pixels → encode → back into the UNet - costs a full round-trip through the VAE on every generation. The author's own numbers (they're in the README, COCO-validated) put this at 20–50x faster than that path depending on resolution, with near-identical quality: on SDXL 2x, PSNR 26.3 vs 26.9 for the VAE route. The third option, plain linear interpolation of the latent (LatentUpscaleBy), is technically instant but produces the big, mushy color blobs you've seen on half the tutorials out there. This is the middle ground that's actually good.

How it works

Under the hood it's a small convolutional resizer, not a diffusion model: 4-channel conv in (latents are 4 channels), ~20 residual blocks at 128 channels with a couple of attention blocks, a bilinear interpolate in the middle, conv back to 4 channels. The upscale factor is fed in as a tiny embedding, so one network handles any 1.0–2.0x you throw at it. It was trained separately for SDXL and SD 1.x - that's why the version input exists, and why it only covers those two families. Weights are the two ~12MB .pt files shipped inside the repo, so there's no external model download to hunt down.

The node loads the right weights lazily on first use, caches them per version, runs in fp16 when your GPU can, and hands the result back as a normal LATENT. The last commit is from August 2023 and it's never been touched since - but it only talks to ComfyUI's stable model_management APIs, so it still loads and runs on current ComfyUI without fuss. Old, not broken.

The inputs that matter

It's a three-input node, which is the whole point. From the info schema:

  • latent (LATENT) - wire this from your first KSampler.
  • version (SDXL or SD 1.x) - must match your checkpoint, or you'll get garbage with a straight face. This is the number one user error.
  • upscale (float, 1.0–2.0, default 1.5) - the resize factor. 1.5–2.0 is the sweet spot for a second pass; keep your denoise strength down around 0.3–0.5 and the second KSampler just adds coherent detail.

Output is a single LATENT; it goes into the latent input of your second KSampler, and that sampler's output flows to the VAE decode you actually keep. That's the entire wiring.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/Ttl/ComfyUi_NNLatentUpscale.git

Restart ComfyUI and it appears under Add Node → latent → NN Latent Upscale. ComfyUI Manager can also find it if you search the pack title. There's no requirements.txt - it uses einops, which ComfyUI already ships, and the weights come with the clone. Nothing else to download.

Where people get burned

  • Red "node not installed" box. You cloned into the wrong folder, or the workflow you grabbed bundles a copy of this node from another pack that wasn't installed. Fix: install this repo properly, then reload.
  • Colors shift between passes. In animation and img2vid pipelines, people report greens turning gray and other color drift after the latent pass. The community fallback is to decode to an image with TAESD, upscale with a pixel upscaler like Lanczos, and re-encode - cheaper than a full VAE. Also double-check your version before blaming the node.
  • The one real limitation: it only knows SDXL and SD 1.x. Flux, SD3, and the video models are out, and nothing else on this pack is coming.

It's a one-trick node, but the trick is a genuinely useful one - an artifact-free latent upscale in tens of milliseconds for the most common hi-res fix setups. Ttl (the author, a veteran of the ComfyUI scene) shipped it, proved the numbers, and it's quietly sat there working ever since.

Categorylatent

Inputs (3)

NameTypeDefaultDescription
latentLATENT
versionCOMBO2 options: SDXL, SD 1.x
upscaleFLOAT1.501–2

Outputs (1)

NameTypeDescription
LATENTLATENT