Normalize Image Dimensions
Auto-Resize Your Input Image to the Model's Native Resolution
- image
- IMAGE
SD 1.5 likes images around 512px on a side; SDXL wants 1024. Feed either one a 3840x2160 screenshot or an odd 700x900 crop and you're asking the model to do img2img at a resolution it wasn't trained at - which is how you get weird anatomy, tiling, or a subject that quietly ignores half the prompt. This node rescales an input image to a sensible size for the platform you picked, so your img2img starts from the right place.
Why you'd reach for it
Any time your input image isn't already at a friendly resolution. Img2img, inpainting, ControlNet source images, reference images - all of them do better when the pixels you feed in are near the model's native range. This node automates the "resize to roughly 512 or 1024" step that people otherwise do by hand or forget entirely. It's the kind of node you drop in front of an img2img sampler and stop thinking about.
How it works
It picks a target based on platform, then scales so one edge hits the target:
- SD1.5 - clamps to 512 on one edge.
- XL - clamps to 1024 on one edge.
- FLUX - aims for roughly 1024px total area, snapped to the standard Flux bucket sizes (896/832/768/640 short side, capped around 1152–1536 long side).
attention decides which edge gets clamped: minimize clamps the longest edge down to the target, maximize clamps the shortest edge up to it. orientation can force a portrait or landscape swap if your input came in the wrong way. The resize method is chosen for quality and speed: area-based downscaling when shrinking, bicubic when expanding. The output is an IMAGE at the new size, ready to VAE-encode.
Inputs and outputs
- image - the input image.
- platform -
SD1.5,XL, orFLUX. - orientation -
original,portrait, orlandscape. - attention -
minimize(clamp the longest edge) ormaximize(clamp the shortest edge).
Output: IMAGE, resized.
Installing it
Part of "quadmoon's ComfyUI nodes". ComfyUI Manager: search the pack title or Install via GIT URL with https://github.com/traugdor/ComfyUI-quadMoons-nodes.git. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/traugdor/ComfyUI-quadMoons-nodes.git
Restart ComfyUI. No models or dependencies.
Common issues
Two things to keep in mind. First, "normalize" here means fits the model, not preserves your aspect ratio perfectly - with minimize attention the other edge scales proportionally, so very wide or tall images can still end up with one very small dimension; that's the correct behavior for most models but worth knowing if your source is an ultrawide screenshot. Second, remember this resizes pixels, not latents - use it before VAE-encoding, and if your target is a hires upscale you still want the sampler-level upscale path for the second pass rather than feeding a huge image in here.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| platform | COMBO | 3 options: SD1.5, XL, FLUX | |
| orientation | COMBO | 3 options: original, portrait, landscape | |
| attention | COMBO | 2 options: minimize, maximize |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |