Soze Image Size With Maximum (Soze)
The math for a capped resize, no resize included
- image
- width
- height
- status
This one's easy to misread from the name - it doesn't resize anything. It's a calculator: feed it an image and a maximum long-edge size, and it hands back the width and height you'd get if you resized to that cap while keeping aspect ratio. No image comes out the other side, just two numbers.
How it works
Whichever of the image's width or height is larger gets capped at max_long_edge; the other dimension scales down proportionally to preserve the original aspect ratio. That's it - the entire node is that one calculation, deliberately separated from actually performing the resize.
The inputs and outputs that matter
- image - the reference image you're measuring.
- max_long_edge - the ceiling for whichever dimension is larger, default 1280, adjustable from 64 to 8192.
Outputs are width, height, and status - no image. That's the whole point: this decouples "figure out the target resolution" from "actually resize something," which matters because plenty of workflows need the numbers before any resizing happens. The obvious example is sizing an Empty Latent Image to match a reference photo's aspect ratio without exceeding a resolution ceiling - you don't need to resize the reference itself, you just need its proportions translated into a generation size.
Contrast this directly with this pack's own Shrink Image: that node takes an image in and gives a resized image out. This one takes an image in and gives you two numbers out, full stop. Use Shrink Image when you want the pixels changed; use this one when you want the math without touching the image at all.
The real reason this split matters: an img2img or a reference-driven workflow often needs its Empty Latent Image sized to match the aspect ratio of a reference photo, but capped so an unusually large upload doesn't blow past what the model or your VRAM can handle. You don't need the reference image itself resized - the sampler works from the reference's pixels at whatever size they already are, or from a separately-resized copy. What it needs is a target generation size with the right proportions. That's a pure numbers problem, and keeping it separate from any actual image resize means you can reuse the same width/height calculation for multiple downstream purposes without recomputing it or accidentally resizing an image you didn't mean to touch.
Installing it
ComfyUI Manager: search ComfyUI_Soze. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/SozeInc/ComfyUI_Soze.git, pip install -r ComfyUI_Soze/requirements.txt, restart. Pure arithmetic - no models, no dependencies.
Common issues
If you plug this in expecting an image output and can't find one, that's not a bug - there isn't one, by design. Grab width and height and wire them into whatever resize or latent node you're actually using to do the work. And remember the default 1280 is a reasonable general ceiling, but if you're targeting a specific model's ideal resolution, set max_long_edge to match that model rather than leaving the default in place.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| max_long_edge | INT | 128064–8192 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| status | STRING | — |