Image Resize Pixaroma
One compact node for every resize shape you actually use
- image
- mask
- image
- mask
- width
- height
- longest_side
Image Resize Pixaroma is the mid-workflow resizer that covers every resize shape you actually hit in practice, in one compact node - and it resizes the mask alongside the image, which is the bit that quietly breaks most hand-rolled resize chains. Load an image at 1536×2048, need it at 1024×1024 for a latent, or up to 2048 for an upscale pass, or padded for an inpaint - this is the node that does it without a tangle of scale/crop/pad nodes.
Pick a mode from the dropdown: Off, Max megapixels, Longest side, Scale by ×, Fit inside, Crop to fill, Match aspect ratio, or Pad. A live Input → Output card on the node shows the exact dimensions you'll get and only turns orange when the size actually changes, so you can see at a glance whether a setting is even doing anything. The few controls worth knowing before you start:
- Pad adds a colored border, and here's the trick: in Pad mode the added border becomes the mask region - the node hands you a mask where white is the new pad area, which is exactly what you feed an outpainting/inpainting model. It's the prep step for "extend the image," built into a resize node.
- Crop to fill has a 9-point anchor (keep the top, a corner, the center…) so when you crop the overflow you keep the part you care about, plus a Fill/Crop toggle for scale-and-crop vs. cutting at original pixels.
- Snap (to /8/16/32/64) and Resample (Auto/Nearest/Bilinear/Bicubic/Lanczos) apply on top, with an Allow upscaling toggle so small images don't silently blow up.
The inputs that make it different
Most resize nodes are a wall of number fields. This one is designed to be driven by other nodes instead:
width/height- optional INT inputs, e.g. from Resolution Pixaroma. Wire just one and it scales while keeping the aspect ratio; wire both for an exact size. While wired, the matching field locks so you can't fight the wire.longest_side- wire one number (say, from Number Pixaroma) and the image scales so its longer edge hits that value, portrait or landscape, no choosing an axis. This takes priority over width/height when connected, so it's the "I just want to fit under N pixels" input.mask- resized alongside the image with crisp (nearest) edges so the mask stays sharp; in Pad mode the border comes out white (the inpaint region).
The outputs
image and mask (resized in lockstep), width / height (the final dimensions, for feeding an empty latent), and longest_side (the longer edge whatever the resize produced - handy when you don't care about orientation). If you only remember one thing, remember this: image and mask travel together, so your inpaint mask and your latent size can't drift out of sync.
Installing it
It ships in the ComfyUI-Pixaroma pack. ComfyUI Manager search Pixaroma, Install, restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/pixaroma/ComfyUI-Pixaroma
No extra dependencies. And the standing house rule after any update: hard-refresh your browser tab (Ctrl+Shift+R / Cmd+Shift+R) so cached JS doesn't make the node look broken.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The image to resize. | |
| maskopt | MASK | Optional mask. Resized alongside the image with crisp (nearest) edges. In Pad mode the added border becomes white (the inpaint region). | |
| widthopt | INT | Optional target width (e.g. from Resolution Pixaroma). Wire only width OR only height to scale keeping aspect ratio; wire both for an exact size. While wired, the matching field is locked. | |
| heightopt | INT | Optional target height (e.g. from Resolution Pixaroma). Wire only width OR only height to scale keeping aspect ratio; wire both for an exact size. While wired, the matching field is locked. | |
| longest_sideopt | INT | Optional single target for the LONGER side. Wire one number (e.g. from Number Pixaroma) and the image scales so its longest side equals this value, aspect ratio kept - works for portrait or landscape without choosing width or height. Takes priority over width/height when connected. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The resized image. |
| mask | MASK | The resized mask (white = the padded / inpaint area when using Pad). If you leave the mask input empty and the picture carries its own transparency, that transparency comes out here, resized to match - wire it with the image into Join Image with Alpha to get the transparent picture back. |
| width | INT | Final output width in pixels. |
| height | INT | Final output height in pixels. |
| longest_side | INT | The longer of the output's width and height, whatever the resize produced. Use it when you want the longest dimension without caring about orientation. |