Nodes/ComfyUI/Upscale Image
ComfyUI Node Runs on cloud

Upscale Image

The exact-size resize that's still here for a reason

By Comfy-Org·Created 4 years ago·Updated about 3 hours ago· 129,870
Upscale Image
  • image
  • IMAGE
upscale_method
width512
height512
crop

"Upscale Image" is a lie and everyone knows it: this node also downscales, distorts, and - if you use the trick below - preserves aspect ratio while doing either. It's the original of the family, sitting in ComfyUI core since the very beginning, and despite being the least searched of the four scale nodes, it's still the only one that sets an exact width and height. When you need a specific canvas, this is the tool.

What it is and where it fits

ImageScale, ImageScaleBy, ImageScaleToMaxDimension and ImageScaleToTotalPixels all live in image/upscaling and all do the same non-generative job: change pixel count without inventing content. The wider "upscaling" world runs on three different jobs - more pixels, more detail, and more pixels over time - and this category handles only the first. Fast, deterministic, no hallucination, and exactly right whenever the source already has the detail you want. This particular node is the absolute-resize one: you say 1024×1024, it gives you 1024×1024.

How it works

The mechanism is what separates it from its siblings. You give it explicit width and height, and it resamples to those exact dimensions. The numbers that make it useful are the zeroes: set width to 0 and it computes width from the height while keeping aspect; set height to 0 and it does the reverse. Set both to 0 and it returns the image untouched. That single-dimension trick is genuinely underrated - the community has noticed that "UpscaleImage ironically lets you downscale by giving it a single dimension like 2304."

if width == 0:
    width = round(orig_w * height / orig_h)
elif height == 0:
    height = round(orig_h * width / orig_w)

Then there's the crop input, which is where people actually get hurt.

The inputs

  • width and height - exact target dimensions, 0 to 16384, default 512. Zero means "compute me from the other one."
  • upscale_method - lanczos for enlarging, area for shrinking.
  • crop - disabled or center. Center is not a free lunch: it crops the source to the target's aspect ratio before resampling, so part of your image is gone.

Single IMAGE output, into whatever wants an image.

When you'd reach for it

The exact-resize cases: matching a fixed canvas for outpainting, hitting a specific size before a second sampling pass, or making one reference conform to a model's native resolution. The zero-dimension trick makes it the cleanest aspect-preserving resize in the whole family, and you can't do that with ImageScaleBy unless the math happens to line up.

Where people get burned

Two classic traps. First, crop = center: set it with a different aspect ratio than your source and you'll wonder why the edges vanished - it's cropping, not squeezing, and it happens before the resize. Disabled plus a zero dimension is the setting for almost everything. Second, the name: people expect "upscale" to add quality. It doesn't - it resamples, and no amount of 2x fixes a soft source. That's a job for ImageUpscaleWithModel with an ESRGAN model or a generative upscaler. If your goal is "make it bigger" rather than "make it exactly this size," ImageScaleBy is the friendlier node; if it's "normalize to a pixel budget," that's ImageScaleToTotalPixels. All four ship with core, all four cost nothing to install, and knowing which one you're standing in front of is half the battle.

Categoryimage/upscaling

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
upscale_methodCOMBO5 options: nearest-exact, bilinear, area, bicubic, lanczos
widthINT5120–16384
heightINT5120–16384
cropCOMBO2 options: disabled, center

Outputs (1)

NameTypeDescription
IMAGEIMAGE