Image Resize
One resize node to rule all the ways you resize
- image
- mask
- image
- mask
- width
- height
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_positionchoosing 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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMFY_MATCHTYPE_V3 | Input image or mask to resize. | |
| scale_to | COMBO | longest | Which dimension to constrain: longest side, shortest side, width, height, total pixels (kilo-pixels), or custom W×H. |
| size | INT | 10241–16384 | Target size for the chosen scale_to mode. For total_pixels this is in kilo-pixels (e.g. 1024 = ~1M pixels). |
| custom_width | INT | 5120–16384 | Target width when scale_to is 'custom'. 0 = keep original width. |
| custom_height | INT | 5120–16384 | Target height when scale_to is 'custom'. 0 = keep original height. |
| aspect_ratio | COMBO | original | Override aspect ratio. 'original' keeps the input image ratio. |
| fit | COMBO | resize | How 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_position | COMBO | center | Anchor point for crop and pad operations. |
| pad_color | STRING | #000000 | Background color for pad mode (hex, e.g. #000000). |
| method | COMBO | lanczos | Interpolation method for resampling. |
| divisible_by | INT | 81–512 | Round output dimensions to nearest multiple of this value. |
| device | COMBO | cpu | Device for resize operations. GPU is faster for large images. Lanczos is not supported on GPU and falls back to bicubic. |
| maskopt | MASK | Optional mask — resized together with the image. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | COMFY_MATCHTYPE_V3 | Resized image or mask. |
| mask | MASK | Resized mask (empty if no mask input). |
| width | INT | Output image width. |
| height | INT | Output image height. |