Nodes/bsz-cui-extras/BSZ Principled Scale
ComfyUI Node

BSZ Principled Scale

One node for every way to scale a latent

By Beinsezii·Created 3 years ago·Updated 2 years ago· 27
BSZ Principled Scale
  • vae
  • latent
  • LATENT
method
width1024
height1024

There are three families of upscaling in ComfyUI - resize the latent directly, resize the decoded pixels, or run a trained upscale model - and normally you need three different node setups to switch between them. BSZ Principled Scale is one node that does all three from a dropdown, and it's the scale step the pack's principled workflow is built around.

Why you'd reach for it

You're doing a two-pass workflow and you want to try "latent bilinear" one run and "pixel lanczos" the next, or you want to drop a real ESRGAN upscale model in as the intermediate step, without rebuilding the graph each time. This node is the swap-friendly middle of any hires pipeline: in, out, and a method dropdown.

Inputs

  • vae - required, because the pixel and model methods decode to pixels and re-encode.
  • latent - what you're scaling.
  • method - the dropdown, in three groups:
    • latent … - nearest-exact, bilinear, area, bicubic, bislerp. Stays in latent space, fast, no VAE round-trip.
    • pixel … - nearest-exact, bilinear, area, bicubic, lanczos. Decodes, scales, re-encodes.
    • model … - every upscale model you have in models/upscale_models, e.g. a 4x-UltraSharp. Runs the model, then bicubic-fits to your exact target.
  • width / height - target size (multiples of 8).

Output is a LATENT at your target size. If the latent is already that size, it just passes through.

How it works

The code is honest about what each group costs: latent methods are a direct tensor resize; pixel and model methods decode through the vae first, resize in pixel space, and re-encode. That round-trip is why the README frames the denoise guidance around scale type - the pack recommends denoise 0.3 for a pixel-scale stage and 0.6 for a latent-scale stage, because the decode/encode cycle loses a bit of fidelity that a slightly heavier second-pass denoise recovers.

Install & gotchas

cd ComfyUI/custom_nodes
git clone https://github.com/Beinsezii/bsz-cui-extras

restart, or use ComfyUI Manager. No dependencies, but note the model methods only show up if you actually have upscale models installed - the list is built from your upscale_models folder at startup. And because the pixel/model paths decode to a full-res image and re-encode, they eat VRAM in a way latent scaling doesn't; for a 4k target on a small card, keep model for the big final pass, not the intermediate one.

Categorybeinsezii/image

Inputs (5)

NameTypeDefaultDescription
vaeVAE
latentLATENT
methodCOMBO10 options: latent nearest-exact, latent bilinear, latent area, latent bicubic, latent bislerp, pixel nearest-exact, +4
widthINT102464–16384
heightINT102464–16384

Outputs (1)

NameTypeDescription
LATENTLATENT