Max Quick Image Size
Stop Typing Width and Height by Hand
- image
- new_width
- new_height
Every img2img and image-to-video workflow has the same boring chore: look at your source image, figure out its aspect ratio, and type matching numbers into an Empty Latent Image. Max Quick Image Size exists to kill that chore. You feed it the source dimensions (or just the image), it picks a square/landscape/portrait preset, and it hands you back two integers - new_width and new_height - that you wire straight into whatever needs a resolution. That's the whole job, and it does it with zero dependencies and zero model files.
It's a tiny helper from MaximilianWicen's ComfyUI-MaxTools pack, one of those one-file utilities that a sampler-research-adjacent dev (same person behind a node wrapping spectral-feature-forecasting sampling acceleration) ships because they got tired of the manual math. Don't expect anything fancy. Expect to stop hand-typing resolutions.
How it works
The mechanism is deliberately simple, and worth knowing because it explains the edge cases. First it snaps all five preset inputs to the nearest multiple of 32 - type 1000 for square_size and you actually get 992, ties round up. Then it needs to know your source aspect ratio, in this order of precedence:
widthandheightif both are greater than 0- Otherwise, infer them from the connected
imageby reading its tensor shape (no PIL, no decoding, just.shape) - If nothing is available at all, it silently returns the square preset rather than erroring
Aspect ratio is just width / height. If it's within 5% of 1.0 it counts as square; above 1.0 is landscape; below is portrait. That tolerance is the one design decision that might surprise you - a 0.96 aspect ratio is "close enough" and goes square, so a nearly-square landscape image gets the 1024×1024 preset instead of the wide one. It's a reasonable default; just know it's there.
Importantly, this node never touches your pixels. It outputs plain INT values, not an image. In an img2img flow you'd do something like: Load Image → Max Quick Image Size → Empty Latent Image (width/height from the node) → VAE Encode → KSampler. For image-to-video, same idea but the latents feed the video sampler. If you actually want the image resized to the chosen preset, chain an ImageScale node after it using the same two outputs.
The inputs that matter
Only two things to think about as a beginner:
- The five presets -
square_size(default 1024),landscape_width/landscape_height(1280×720),portrait_width/portrait_height(720×1280). These are your target resolutions; change them once to match the models you run, then forget them. - One source - either
width+heightorimage. Thewidth/heightinputs areforceInput-wired, so you can chain them from another size node; theimageroute is the lazy-friendly one and usually what you want.
Outputs: new_width and new_height, both INT, both multiples of 32.
Installing it
No dependencies, no model downloads - the whole pack is one small Python file. Install it like any custom node:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/maximilianwicen/ComfyUI-MaxTools.git
Restart ComfyUI, or use ComfyUI Manager and search "ComfyUI-MaxTools". You'll find the node under the MaxTools category, or just search "Max Quick Image Size" in the node menu.
Where people get burned
Two gotchas are worth knowing before they bite. First, the multiple-of-32 snapping: it's safe for SDXL and Illustrious (they want multiples of 8), but Flux wants multiples of 64. The default presets are mostly fine - 1024 and 1280 are divisible by 64 - but 720 is not, so a portrait run at 720×1280 on Flux can throw the divisibility error. If you use custom values on Flux, keep them multiples of 64 (704 or 768 for portrait height). Second, because a degenerate input quietly returns the square preset, an unplugged image won't error - you'll just get square output and wonder why. If you get unexpected 1024×1024 results, check that your source actually reached the node.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| square_size | INT | 10240–16384 | — |
| landscape_width | INT | 12800–16384 | — |
| landscape_height | INT | 7200–16384 | — |
| portrait_width | INT | 7200–16384 | — |
| portrait_height | INT | 12800–16384 | — |
| widthopt | INT | 00–16384 | — |
| heightopt | INT | 00–16384 | — |
| imageopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| new_width | INT | — |
| new_height | INT | — |