Scale Image to Multilple Pixels
Scale Image to Multilple Pixels doesn't scale anything — it crops, and that's the point
- image
- IMAGE
The display name says "Scale Image to Multilple Pixels" (yes, with the typo - that's the author's, not mine). But this node doesn't scale, stretch, or resize a thing. What it does is crop your image so both dimensions land on exact multiples of a base number. If that sounds disappointingly small, read the README example and it clicks: a 533×433 image with base_pixels set to 100 comes out 500×400. You lose the odd 33 and 33 pixels and get a cleanly aligned canvas.
Why you'd bother
Because image models are picky about dimensions. SD-family autoencoders want latent sizes that divide by 8, tiling pipelines want tiles that land on a grid, and upscale workflows (the tiled-diffusion kind) run much happier when input dimensions are clean multiples. A 1021×1021 image is a classic troublemaker; knocking it to 1016×1016 (multiple of 8) avoids the size-mismatch errors that haunt tiled upscaling and ControlNet tile pipelines. This node is the cheap pre-flight check: snap your canvas to the grid before it hits something that cares.
The inputs that matter
- image - what you're fixing.
- base_pixels - the multiple to snap to. Default 8, which is exactly the latent alignment ComfyUI wants. The README's example uses 100, but for most pipelines 8 is the number you'll leave alone.
- position - where the crop is anchored, from nine options (
top-left,top-center,top-right,right-center,bottom-right,bottom-center,bottom-left,left-center,center). Defaultcenter.
That last one is the whole decision: since you're losing pixels from the edges, position decides which edge you're willing to lose. A face off-center in the frame? Anchor the crop so the face's side survives.
How it actually works
It floor-divides the width and height by base_pixels, then slices the image to that rectangle at the chosen anchor. No interpolation, no resampling, no upscaling - pure crop. That's also the "gotcha" spelled out: if you wanted to make a 533px image bigger to hit a multiple, this isn't your node. It only ever shrinks (by up to base_pixels−1 on each axis) and it trims the edges rather than squeezing the content. If you actually want to resize, the core Upscale Image node is the tool; this one is strictly about alignment.
Install
Same as every node in this pack - ComfyUI Manager, search comfyui-missed-tool, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ifmylove2011/comfyui-missed-tool.git
Restart, and it's under missed-tool as "Scale Image to Multilple Pixels". No dependencies, no model files - it's a few lines of torch slicing, which is exactly why it's worth having around.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| position | COMBO | center | 9 options: top-left, top-center, top-right, right-center, bottom-right, bottom-center, +3 |
| base_pixels | INT | 8 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |