Image Scale & Resolution (Legacy)
One node that resizes, crops to aspect, and hands you the numbers
- image
- image
- Image
- Width
- Height
- Upscaled Width
- Upscaled Height
The most common real-world ComfyUI chore is "make this image a specific size," and it's usually two chores: resize the pixels and figure out what dimensions to feed the latent. Image Scale & Resolution (Legacy) fuses them. Feed it an image, pick an aspect ratio and a megapixel target, and it crops/resizes the image and emits the resulting Width and Height - plus a separately upscaled version and its dimensions - all from one node.
Mechanically it's a crop-then-resize pipeline. If crop_method is center, it first crops the image to your chosen aspect ratio (center crop, equal amounts off each side), then resizes to the target size computed from megapixels and the ratio. If cropping is off, it just scales the image to hit the megapixel target. All output dimensions are rounded to your multiple (default 16) so they stay latent-friendly.
The inputs that matter
- image - optional. Leave it disconnected and the node acts as a pure dimension calculator, handing back the sizes (and a blank image) without touching any pixels. Connect it and you get the actual resized result.
- aspect_ratio - the shape you want out: 1:1, 16:9, 3:2, etc. This drives both the crop and the output dimensions.
- megapixels - target total resolution. 1.0 ≈ 1024×1024 for a square. The single most useful knob for "I want roughly this much resolution."
- upscale_method -
lanczos,bicubic,bilinear,area,nearest-exact. Lanczos is the safe default; nearest for pixel art. - scale_by - a second factor applied on top, producing the extra
Image(upscaled) output and its dimensions. This is your hi-res-fix multiplier. - multiple - pixel rounding for all dimensions. 16 default.
The outputs
Two IMAGE outputs - the base adjusted/cropped image and the upscaled one - plus Width, Height, Upscaled Width, Upscaled Height as INTs. Wire the base image into an image-to-image sampler or a VAE encode, and the width/height into your Empty Latent so nothing can disagree about size.
Installing it
Part of silveroxides/ComfyUI-UtilsCollection. Install via ComfyUI Manager (search ComfyUI-UtilsCollection) or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
Restart after. Dependencies: opencv-python and typing-extensions only. No models, no downloads. "(Legacy)" marks it as the compat alias for the pack's newer UC_ImageScaleAndResolutionPicker.
Where people get burned
Three things. First, resolution_steps looks important and isn't - the tooltip says it flat out: it doesn't affect output size, and multiple is the single source of alignment. Ignore it. Second, center cropping means you will lose pixels off the sides when your input doesn't match the target ratio; that's the trade for getting an exact ratio out. Third, when image is disconnected, the node still produces an image output - but it's a blank placeholder tensor, so don't wire that into a sampler expecting real pixels. Connect the image or use the INT outputs only.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| upscale_method | COMBO | lanczos | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
| crop_method | COMBO | If cropping is enabled, the image will be cropped to the target aspect ratio before resizing. Center cropping is used, so the center of the image will be preserved and equal amounts will be cropped from either side. | |
| aspect_ratio | COMBO | 1:1 (Square) | The aspect ratio for the output dimensions and cropping. |
| megapixels | FLOAT | 1.000.01–16 | — |
| resolution_steps | INT | 11–256 | Does not affect output size. Use Multiple to align dimensions. |
| scale_by | FLOAT | 1.000.01–10 | Scale used for the larger output resolution. |
| multiple | INT | 164–128 | Round the larger resolution to this pixel multiple. |
| imageopt | IMAGE | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The adjusted/cropped base image |
| Image | IMAGE | The image after applying the scale_by factor |
| Width | INT | — |
| Height | INT | — |
| Upscaled Width | INT | — |
| Upscaled Height | INT | — |