Nodes/ComfyUI_Eclipse/Image Resize
ComfyUI Node

Image Resize

One resize node to rule all the ways you resize

By r-vage·Created 10 months ago·Updated a day ago· 31
Image Resize
  • image
  • mask
  • image
  • mask
  • width
  • height
scale_tolongest
size1024
custom_width512
custom_height512
aspect_ratiooriginal
fitresize
crop_positioncenter
pad_color#000000
methodlanczos
divisible_by8
devicecpu

Image Resize is Eclipse's answer to "which resize node do I grab today?" Instead of five nodes for five jobs, it folds them together: constrain by longest side, shortest side, width, height, or total pixel count; override the aspect ratio; pick how to fit (resize, crop, pad, pillarbox-blur, stretch); and snap to a multiple - all in one node. It's the node you reach for when you know what the output should be but don't want to do the arithmetic.

The first decision is scale_to. This is the whole personality of the node:

  • longest / shortest - constrain the big or small side. The classic "make every image fit under 1024 on its long edge" for a batch.
  • width / height - pin one dimension, keep ratio.
  • total_pixels - target a pixel budget, e.g. 1024 here means ~1M pixels (it's in kilo-pixels). Great for normalizing a mixed batch to a consistent cost before a model.
  • custom - exact width × height via custom_width/custom_height; 0 means "keep original" on that axis.

Then size carries the value for the chosen mode (1024 by default), and aspect_ratio overrides the ratio (1:1 through 16:9, or original).

The fit modes - where people get lost

fit decides what happens when the target doesn't match the input ratio:

  • resize - scale proportionally; output may be smaller than target. No distortion, no bars.
  • crop - scale to fill, then crop the excess (with crop_position choosing center/top/bottom/left/right).
  • pad - scale to fit, then pad with pad_color (hex).
  • pad_edge / pad_edge_pixel - pad with the mean color of the nearest edge, or by replicating edge pixels. Better-looking bars than flat color.
  • pillarbox_blur - the modern letterbox: blurred, desaturated, darkened background. This is the one that makes a 16:9 video out of a 1:1 image without hard black bars, and it's worth knowing it exists.
  • stretch - distort to the exact target. Almost never what you want, but it's there.

Rounding out the controls: method (lanczos default), divisible_by (default 8 - round output to a multiple, the VAE-friendly guard), and device (cpu default; GPU is faster for large images but lanczos isn't supported on GPU and falls back to bicubic - that fallback is the kind of silent behavior that confuses people comparing sharpness later).

An optional mask resizes in lockstep, so mask and image stay registered. Outputs: image, mask, and width/height ints for downstream arithmetic.

The honest take

If Eclipse already lives in your workflow, this is the one resize node you need - it replaces half a dozen single-purpose utilities. The pair with Image Rescale is: Rescale when you think in factors ("2x"), Resize when you think in targets ("fit under 1024, pad the rest"). This one's the workhorse.

Installing

ComfyUI_Eclipse, r-vage's pack. Manager → search ComfyUI_Eclipse, or:

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_Eclipse

Restart; under Eclipse → Image → Transforms. Standard deps; Eclipse targets current ComfyUI (frontend 1.51.2+) and v4.0 removed legacy RvTools_v2 nodes (Migration Tool included).

The classic gotcha: total_pixels is in kilo-pixels, so "1024" is a megapixel, not 1024×1024. And if your GPU output looks softer than CPU output, that's the lanczos→bicubic fallback, not your imagination.

Category🌒 Eclipse/ Image/Transforms

Inputs (13)

NameTypeDefaultDescription
imageCOMFY_MATCHTYPE_V3Input image or mask to resize.
scale_toCOMBOlongestWhich dimension to constrain: longest side, shortest side, width, height, total pixels (kilo-pixels), or custom W×H.
sizeINT10241–16384Target size for the chosen scale_to mode. For total_pixels this is in kilo-pixels (e.g. 1024 = ~1M pixels).
custom_widthINT5120–16384Target width when scale_to is 'custom'. 0 = keep original width.
custom_heightINT5120–16384Target height when scale_to is 'custom'. 0 = keep original height.
aspect_ratioCOMBOoriginalOverride aspect ratio. 'original' keeps the input image ratio.
fitCOMBOresizeHow to fit the image into target dimensions: • resize — scale proportionally (output may be smaller than target) • crop — scale to fill then crop excess • pad — scale to fit then pad with solid color • pad_edge — pad with mean color of nearest edge • pad_edge_pixel — pad by replicating edge pixels outward • pillarbox_blur — pad with blurred, desaturated, darkened background • stretch — distort to exact target size
crop_positionCOMBOcenterAnchor point for crop and pad operations.
pad_colorSTRING#000000Background color for pad mode (hex, e.g. #000000).
methodCOMBOlanczosInterpolation method for resampling.
divisible_byINT81–512Round output dimensions to nearest multiple of this value.
deviceCOMBOcpuDevice for resize operations. GPU is faster for large images. Lanczos is not supported on GPU and falls back to bicubic.
maskoptMASKOptional mask — resized together with the image.

Outputs (4)

NameTypeDescription
imageCOMFY_MATCHTYPE_V3Resized image or mask.
maskMASKResized mask (empty if no mask input).
widthINTOutput image width.
heightINTOutput image height.