Nodes/ComfyUI-UtilsCollection/Image Scale & Resolution
ComfyUI Node

Image Scale & Resolution

Think in megapixels, not magic numbers

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Image Scale & Resolution
  • image
  • image
  • Image
  • Width
  • Height
  • Upscaled Width
  • Upscaled Height
upscale_methodlanczos
crop_method
aspect_ratio1:1 (Square)
megapixels1.00
resolution_steps1
scale_by1.00
multiple16

ComfyUI workflows keep asking you for width and height, but what you usually have is a budget - "I want a 1MP image in landscape," not "I specifically want 1152×896." UC_ImageScaleAndResolutionPicker lets you think in megapixels: give it a target resolution and an aspect ratio, and it computes the matching dimensions, resizes your image to them, and also hands you a second, upscaled dimension set for the classic base-image + upscale-pick pipeline.

The reason this class of node exists is that video and image models are picky about total pixel count, and hand-rolling "what's the biggest size that's still ~1MP at 16:9" every time you build a workflow is exactly the kind of arithmetic you should never type twice. Wire the output dimensions into your latent or your Empty Latent and the megapixel math disappears.

How it works

Pick an aspect_ratio (default 1:1 (Square)), a megapixels target (default 1), and optionally feed an image - the node resizes/crops it to fit. crop_method (disabled/center) controls whether an off-ratio input gets center-cropped to the target aspect before resizing. Then:

  • resolution_steps doesn't change output size; it exists for workflows that want to run several progressive resolutions, and it aligns dimensions when set to Multiple.
  • scale_by (default 1) is the upscale factor for the second output pair - set 2 and you get both the 1MP base and its 2MP upscaled dimensions.
  • multiple (default 16) rounds the upscaled resolution to a pixel multiple, keeping numbers VAE- and model-friendly.

Outputs

  • image - the adjusted/cropped base image.
  • Image - the image after scale_by is applied.
  • Width / Height - the base dimensions.
  • Upscaled Width / Upscaled Height - the scaled pair.

So the Width/Height pair feeds your base sampling, and the upscaled pair feeds the detail pass - the two are guaranteed consistent, which is the whole point of picking them together.

Installing it

ComfyUI Manager → search "ComfyUI-UtilsCollection", or:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Restart. Deps are opencv-python and typing-extensions, no models. Newer-extension-API pack - keep ComfyUI updated.

The honest note: if you just need a static resolution, a PrimitiveInt/Empty Latent is simpler. This node earns its keep when the workflow's resolution is a parameter you change - batch runs, video models with megapixel ceilings, or workflows you share where the recipient shouldn't have to do the arithmetic. If that's not you, it's a convenience you can skip.

Categoryutils

Inputs (8)

NameTypeDefaultDescription
upscale_methodCOMBOlanczos5 options: nearest-exact, bilinear, area, bicubic, lanczos
crop_methodCOMBOIf 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_ratioCOMBO1:1 (Square)The aspect ratio for the output dimensions and cropping.
megapixelsFLOAT1.000.01–16
resolution_stepsINT11–256Does not affect output size. Use Multiple to align dimensions.
scale_byFLOAT1.000.01–10Scale used for the larger output resolution.
multipleINT164–128Round the larger resolution to this pixel multiple.
imageoptIMAGE

Outputs (6)

NameTypeDescription
imageIMAGEThe adjusted/cropped base image
ImageIMAGEThe image after applying the scale_by factor
WidthINT
HeightINT
Upscaled WidthINT
Upscaled HeightINT