Nodes/ComfyUI_PRNodes/ImageScaleTo
ComfyUI Node

ImageScaleTo

The boring resize node that makes your metadata honest

By pikenrover·Created 2 years ago·Updated about a year ago· 2
ImageScaleTo
  • image
  • width
  • height
  • IMAGE
upscale_method
crop

If you already know the core Upscale Image node, you know 90% of this one. ImageScaleTo resizes an image tensor to a target width and height using the same five methods, and it's about as glamorous as it sounds. The part that's actually interesting is its relationship with the rest of this pack: it's the node that snaps the finished image to exactly the size the pack's metadata claims it is.

Quick distinction first, because the category says "upscaling" and people assume fancy things. This is not a model-based upscaler. It won't invent detail - there's no ESRGAN network or hallucination happening. In the upscaling taxonomy it's squarely the "more pixels" camp: fast, deterministic, adds nothing. The pack's example workflows use a real upscaler (UpscaleModelLoader + ImageUpscaleWithModel, typically 4x-UltraSharp) to add detail, and this node comes at the end just to pin the image to the exact dimensions the random generator already reported. If you're chasing detail, this isn't your node - reach for a proper upscale model. If you need a final exact-size resize, this is the cleanest way to do it inside this pack.

How it works

It calls comfy.utils.common_upscale under the hood - literally the same function the core node uses. The useful quirk is the zero-handling:

  • width 0 and height 0 → the image passes through unchanged.
  • Either one is 0 → the other is computed to preserve the source aspect ratio.

That's a genuine convenience: wire in only a height and get a correctly-proportioned result, no mental math. The crop option (disabled or center) matches the core node too - center will crop the resized image to exactly hit your dimensions, disabled will squeeze it if the aspect doesn't line up.

Inputs and outputs

  • image - any IMAGE tensor (VAE-decoded output, upscaler output, whatever).
  • upscale_method - nearest-exact, bilinear, area, bicubic, lanczos. For plain resizing of a finished photo, lanczos and bicubic look best; nearest-exact is the blocky pixel one.
  • width and height - these are the pack's custom WIDTH/HEIGHT types, which is the clever bit: RandomPrompt and RandomPromptMixed output WIDTH and HEIGHT, so you can wire the "target size" straight from the generator instead of typing it.
  • crop - disabled or center.

One output: IMAGE.

Install and gotchas

ComfyUI Manager, search "ComfyUI_PRNodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/pikenrover/ComfyUI_PRNodes

Restart after. No pip dependencies, no models to download.

The trap to dodge: if you wire WIDTH/HEIGHT in from the random nodes, remember those are doubled numbers (the random nodes report the final posted size, not the latent size). That's fine when the whole pipeline is the pack's - resize to the reported size and the metadata matches. But grab this node alone, feed it a random node's WIDTH, and you'll silently upscale your image 2× for no reason. It's a team player; it does its best work inside the pack.

Categoryimage/upscaling

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
upscale_methodCOMBO5 options: nearest-exact, bilinear, area, bicubic, lanczos
widthWIDTH
heightHEIGHT
cropCOMBO2 options: disabled, center

Outputs (1)

NameTypeDescription
IMAGEIMAGE