Nodes/ComfyUI-bleh/BlehLatentScaleBy
ComfyUI Node

BlehLatentScaleBy

Latent resizing with independent axes and way more scaling types

By blepping·Created 3 years ago·Updated 2 months ago· 142
BlehLatentScaleBy
  • samples
  • LATENT
method_horizontal
method_vertical
scale_width1.50
scale_height1.50
antialias_size0

Quick clarification up front, because it trips people up: this resizes the latent tensor, not the final image. That puts it in a different world from ESRGAN/SeedVR2-style pixel upscalers - those add or invent detail on an already-decoded image, this one just changes the spatial size of the compressed representation the sampler is working on, mid-workflow. Think Deep Shrink-style tricks, manual hires-fix style passes, or just resizing a latent before piping it into a second sampling stage.

ComfyUI ships a built-in LatentUpscaleBy node that does the basic version of this. BlehLatentScaleBy is the same idea with the guardrails removed: independent horizontal and vertical scale factors and methods, an antialiasing knob, and a scaling-method dropdown so long it makes the built-in node's handful of options look quaint.

How the scaling actually works

Under the hood this uses the same interpolation/blend library as the rest of the pack (the one BlehLatentBlend draws its blend modes from), just applied as a resize instead of a two-input mix. The README's own guidance on which method to pick, verbatim in spirit: bicubic is "generally the safe option," bilinear is similar but "slightly not as good," and bislerp (normalized interpolation) is the one ComfyUI's own built-in latent scaling defaults to - it's a real, respected technique in this specific niche, not just another exotic option in a long list. Beyond those, you're into territory the pack itself is more experimental about: colorize, hslerp, cosinterp, cuberp, and combos like random/randomaa that pick a scaling function on the fly specifically to avoid a single scaling artifact getting reinforced every step (mostly useful for Deep Shrink-style repeated scaling, not a one-shot resize).

Inputs and outputs

  • samples - the LATENT to resize.
  • method_horizontal / method_vertical - separate scaling-method dropdowns for each axis. method_vertical includes a same option (matching whatever horizontal is set to) so you don't have to pick twice for a normal isotropic resize - you only diverge them if you specifically want, say, a different vertical treatment for an aspect-ratio change.
  • scale_width / scale_height - floats, default 1.5, range 0.018, step 0.01. These are multipliers on the current latent size, same convention as the built-in LatentUpscaleBy.
  • antialias_size - an integer, default 0 (off). Turning it up smooths the harder edges that scaling methods like bicubic/bilinear can leave behind, particularly noticeable when you're scaling down.

Output is one LATENT, sized scale_width × scale_height relative to the input, ready for another sampling pass or a VAEDecode.

Installing it

One repo, all the Bleh nodes come with it:

  • ComfyUI Manager - search "ComfyUI-bleh", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/blepping/ComfyUI-bleh, restart ComfyUI.

No extra dependencies or model downloads for this node specifically.

Common issues

You don't know which of the hundreds of methods to pick. Don't overthink it - bicubic is the documented safe default, and bislerp is worth trying if you want the same behavior ComfyUI's own latent upscaler leans on. The long tail of exotic modes (anything with random in the name especially) is explicitly experimental; the pack's own README warns those "may be modified or removed" in future versions, so don't build a production workflow around one of the obscure ones.

Output looks blocky or artifact-y after scaling down then back up. That's the antialiasing knob's job - try bumping antialias_size above 0, especially if you're chaining multiple scale passes (the classic Deep Shrink pattern), where a single scaling method's quirks compound with every repetition.

Comparing this to a real upscaler and being disappointed. Wrong tool for that job by design - this changes the latent's dimensions, it doesn't add detail the way a dedicated upscale model does. If what you actually want is more detail on a finished image, that's a pixel-space upscaler's job, not this node's.

Categorylatent

Inputs (6)

NameTypeDefaultDescription
samplesLATENT
method_horizontalCOMBO530 options: bicubic, nearest-exact, bilinear, area, adaptive_avg_pool2d, adaptive_max_pool2d, +524
method_verticalCOMBO531 options: same, bicubic, nearest-exact, bilinear, area, adaptive_avg_pool2d, +525
scale_widthFLOAT1.500.01–8
scale_heightFLOAT1.500.01–8
antialias_sizeINT0

Outputs (1)

NameTypeDescription
LATENTLATENT