🪠️ WWAA Image Dimension Calculator
Get your upscale dimensions right before you commit a single step
- image
- width
- height
The WWAA Image Dimension Calculator is the node for the recurring problem of "what resolution should this be, rounded to something the model won't choke on?" You hand it an image, a scale factor, and a multiple_of constraint, and it returns the width and height you should target - rounded to the nearest multiple of 16, 32, or 64, without actually resizing anything. It's a math node wearing an image node's clothes, from the WWAA-CustomNodes pack by WeirdWonderfulAI.Art.
The use cases are real and specific: pre-computing dimensions for an upscale pass (feed the numbers into an ImageScale node), sizing latent-friendly targets for video generation models, or just getting predictable multiples before you commit VRAM. Diffusion models are famously happy when dimensions are multiples of 64 - it keeps the latent grid aligned - and this node exists so you stop guessing.
How it works
It reads the input image's size (single image only - a batch throws an error), multiplies by scale_factor (0.1–10.0, default 1.5), and rounds the width to the nearest multiple_of. Then it derives height from the original aspect ratio and rounds that too. The clever bit is the guard: if the aspect ratio drift from rounding exceeds 5%, it recalculates starting from the height instead, so you don't end up with a noticeably squashed target. It also enforces a minimum dimension of at least one multiple_of.
Everything is logged to the console - original size, scale, computed vs. final dimensions, and whether the aspect ratio survived. width and height come out as INTs, ready to feed a resize node. There's no upscaling here, only numbers, which is exactly the point.
Inputs that matter
image- the source (batch size 1).scale_factor- the multiplier you'd apply.multiple_of- 16, 32, or 64; 64 is the safest for latent-friendly sizes.
Installing it
It's in the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/hgabha/WWAA-CustomNodes
Restart ComfyUI. Or ComfyUI Manager → search "WWAA Custom Nodes" → install → restart. It's under 🪠️ WWAA/image. No models, no declared dependencies.
Gotchas
The honest caveat: rounding to a multiple of 64 can still drift a few pixels from a perfect aspect ratio - that's the trade-off baked into the node, and the 5% guard only kicks in when it's really off. For a 720×480 source at 1.5× with multiple_of 64 you get a slightly non-standard result (the README's own example shows 1088×704-ish territory rather than a clean 1080×720), so don't expect pixel-perfect ratios when you pick 64; choose 16 or 32 when exactness matters more than the divisible factor. And remember it takes a single image - wire it after a Load Image, not into the middle of a batch pipeline. Then send those INTs to your resize and upscale with a clear conscience.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| scale_factor | FLOAT | 1.50.1–10 | — |
| multiple_of | COMBO | 64 | 3 options: 16, 32, 64 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |