Nodes/Derfuu_ComfyUI_ModdedNodes/Image scale by ratio
ComfyUI Node Runs on cloud

Image scale by ratio

DF_Image_scale_by_ratio – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Image scale by ratio
  • image
  • IMAGE
upscale_by1.00
upscale_method
crop

DF_Image_scale_by_ratio resizes an image by a multiplier instead of to a fixed pixel size. Set upscale_by to 1.5 and whatever image goes in comes out 50% bigger in both dimensions, aspect ratio intact. That sounds like a minor convenience until you're building a workflow where the input image's size isn't known ahead of time - a ratio scales proportionally no matter what came in, where a fixed-size resize node would either distort the image or need the source dimensions calculated separately first.

It's part of Derfuu_ComfyUI_ModdedNodes, a math-and-utility pack from ComfyUI's early days (2023), and this is one of its "modded" nodes - Derfuu's term for a node that wraps ComfyUI's own resize logic with an extra convenience layer rather than a pure math operation. Note this is squarely a pixel-space resize: it works on decoded images. If you're scaling inside the diffusion pipeline before decoding, you want its sibling, DF_Latent_Scale_by_ratio, instead - running the resize as a latent operation skips a VAE decode/encode round trip you'd otherwise pay for.

Inputs and output

Four required inputs:

  • image - the IMAGE to resize
  • upscale_by - the multiplier (1.0 = no change, 2.0 = double the size in each dimension)
  • upscale_method - the resampling algorithm: nearest-exact, bilinear, bicubic, bislerp, area, or lanczos
  • crop - disabled or center

One output: IMAGE.

For a straightforward upscale, lanczos and bicubic are the two most commonly reached-for methods for pixel-space images - they're the standard choices used across the wider ComfyUI/Stable Diffusion ecosystem for decent-quality resampling without heavy softening. bislerp exists in this list mainly because it's one of ComfyUI's native resize methods, but it was built specifically for interpolating latent tensors, not pixels - you'll get more mileage out of it on DF_Latent_Scale_by_ratio than here. crop only matters if the ratio you're applying would change the aspect ratio somewhere else in your pipeline; for a plain proportional scale, leave it disabled.

Where it fits

This is the go-to when you want "make this image X% bigger or smaller" without first calculating a target pixel size - feeding upscale_by from a fixed number, or from a ratio computed by DF_Divide against another size read with DF_Get_image_size, gives you a scale step that adapts to whatever's actually flowing through the graph.

Installing

The whole pack installs together - there's no way to grab a single node from it. 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 to download, no unusual dependencies.

Troubleshooting

If it doesn't appear in the node menu right after installing, restart the server and hard-refresh your browser - that resolves the large majority of "installed but not visible" cases and is a generic ComfyUI frontend quirk, not specific to this pack.

If the resized output looks softer or blockier than you expected, it's almost always the upscale_method choice - try switching between lanczos, bicubic and bilinear before assuming anything's actually broken; each trades sharpness for smoothness differently and there's no universally "correct" one.

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 a pack update, that maintenance history is worth checking before assuming your ComfyUI install itself is broken.

CategoryDerfuu_Nodes/Modded nodes/Image

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
upscale_byFLOAT1.00
upscale_methodCOMBO6 options: nearest-exact, bilinear, bicubic, bislerp, area, lanczos
cropCOMBO2 options: disabled, center

Outputs (1)

NameTypeDescription
IMAGEIMAGE