Nodes/Derfuu_ComfyUI_ModdedNodes/Latent Scale by ratio
ComfyUI Node Runs on cloud

Latent Scale by ratio

DF_Latent_Scale_by_ratio – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Latent Scale by ratio
  • latent
  • LATENT
modifier1.00
scale_method
crop

DF_Latent_Scale_by_ratio does the same job as DF_Image_scale_by_ratio - resize by a multiplier instead of a fixed target size - but it operates directly on a LATENT instead of a decoded IMAGE. That distinction matters more than it looks. A latent is what the diffusion model actually works in: the VAE compresses a real image down by a factor of 8 in each dimension into this compact representation, and staying in that space for a resize means you never pay for a decode-to-pixels-then-re-encode round trip. That's the classic move in a two-stage hires-style workflow: sample at a base resolution, scale the latent up while it's still a latent, then run a second, lighter sampling pass on the bigger version - all without ever converting to a full image in between.

It's a "modded" node from Derfuu_ComfyUI_ModdedNodes, a math-and-utility pack that's been around since ComfyUI's early 2023 days, and it's one of the more genuinely useful ones in the set precisely because ratio-based latent scaling is a real, common workflow step - not just a math-chain building block.

Inputs and output

Four required inputs:

  • latent - the LATENT to resize
  • modifier - the scale multiplier (minimum 0; 1.0 = no change, values above 1 grow it, below 1 shrink it)
  • scale_method - nearest-exact, bilinear, bicubic, bislerp, area, or lanczos
  • crop - disabled or center

One output: LATENT.

For scale_method, bislerp is worth calling out specifically: it's ComfyUI's own interpolation method, and it was built for exactly this - smoothly resizing latent tensors rather than pixel images. Latents aren't visual data in the way an image is, so a straightforward bicubic or lanczos blend (both designed for pixels) can behave a little differently than intended when applied to a latent's channels. A lot of people default to bislerp specifically for latent scaling for that reason; it's a reasonable starting point if you're not sure which to pick.

Where it fits

This sits between two sampling passes in a multi-stage workflow, or anywhere you want to grow or shrink the working resolution mid-pipeline without leaving latent space. Pair it with DF_Get_latent_size and DF_Divide if you want the ratio computed dynamically (say, "scale to 1.5x whatever size we're currently at") instead of a fixed number typed into modifier.

Installing

The whole pack installs together - there's no single-node install. Through ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart ComfyUI. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes

then restart. No models, no unusual dependencies.

Troubleshooting

If it doesn't show up in the node menu right after installing, restart the server and hard-refresh your browser tab - that clears up the large majority of "installed but not visible" cases and isn't specific to this pack.

If a scaled latent produces odd artifacts after the next sampling pass, try switching scale_method to bislerp before assuming the workflow itself is broken - it's the method most people settle on for latent-space resizing specifically, and a pixel-oriented method like lanczos can behave less predictably here than it does on real images.

Worth knowing about the pack generally: its maintainer has, in the past, removed deprecated nodes outright on updates rather than keeping a legacy-labeled copy around, which has broken workflows for people who relied on the pack over the long term. This node has been a stable fixture and isn't among the ones historically pruned, but if an old workflow throws a missing-node error elsewhere after an update, that maintenance history is worth checking first.

CategoryDerfuu_Nodes/Modded nodes/Latent

Inputs (4)

NameTypeDefaultDescription
latentLATENT
modifierFLOAT1.00
scale_methodCOMBO6 options: nearest-exact, bilinear, bicubic, bislerp, area, lanczos
cropCOMBO2 options: disabled, center

Outputs (1)

NameTypeDescription
LATENTLATENT