ImageStandardResizeProcessor
Force any image onto a standard canvas without stretching it
- image
- IMAGE
Some jobs insist every image arrive on the exact same canvas. IC-Light passes, batch compositing, training crops, or just keeping a queue of varied-size photos consistent - they all want "everything is 512×768 now," not "everything is kind of a similar size." ImageStandardResizeProcessor is the "make it this exact size" node, and the trick is that it gets there without stretching your image into a funhouse mirror.
It's one of the eight utilities in the ComfyUI-Image-Tools pack, and it's about as opinionated as a node gets: three preset sizes, nothing else. That limitation is the feature - you can't wander off into weird dimensions.
How it works
For every image in the batch it does the same thing. First it scales so the image's height exactly matches the target (512 or 768), preserving aspect ratio with area interpolation. Then it reconciles the width: if the scaled image is too wide, it center-crops down to the target width; if it's too narrow, it pads both sides with transparent pixels. Result: exactly the preset canvas, subject centered, no distortion.
One thing the code doesn't do is check which direction it's scaling. It forces the height to the target whether your source is 4K or 256px - a small image gets blown up to fill the canvas just as eagerly as a big one gets shrunk. This is a "force to this size" node, not a polite "shrink big ones" node, so feed it a reasonable starting resolution.
Inputs and outputs
image(IMAGE) - your source, single image or batch.size- a dropdown with exactly three choices:512*768,512*512,768*768. That's the full range; no custom dimensions.- Output:
IMAGE- same batch length, every frame on the chosen canvas.
Note the presets skew portrait (512×768) and square. There's no landscape option - if you need 1024×576 or anything else, this isn't the node, and a proper resize/letterbox node will give you more control anyway.
Install
It ships in a pack, so install the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/knuknX/ComfyUI-Image-Tools
Restart ComfyUI, or install Image Tools via ComfyUI Manager. It needs OpenCV and the usual torch/numpy stack - nothing special.
Where people get burned
- The padding branch produces a 4-channel result. When an image is narrower than the target and gets letterboxed, the node builds an RGBA canvas with transparent margins - so the tensor it hands you is 4-channel, while a cropped image stays 3-channel. Downstream nodes that assume 3-channel RGB can misbehave depending on which path your input took. Keep an eye on the console, which prints each image's shape as it processes.
- Small sources get upscaled. Because height is always forced to the target, a 256px thumb becomes a 512px-tall blur rather than being left alone. Normalize, sure - but upscale first if quality matters.
- The presets are fixed. No way to request 768×512 or a custom aspect without editing the node source. If your workflow needs landscape, this isn't the tool.
Used as intended - normalize a batch of portraits to a common canvas before a consistent downstream pass - it's a handy little workhorse. Just don't ask it to be a general-purpose resize node, because it isn't.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size | COMBO | 3 options: 512*768, 512*512, 768*768 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |