Image Dimensions
Image dimensions that remember their aspect ratio
- width
- height
- aspect ratio
- orientation
HelperNodes_WidthHeight takes a width and a height and does the arithmetic you always meant to do in your head: it works out the aspect ratio and the orientation, and hands you all four values on wires. That's the whole trick, and it's more useful than it sounds.
You set width and height, each an INT from 8 up to ComfyUI's MAX_RESOLUTION (16384 in practice), stepping in multiples of 8 - the same 8-multiple discipline KSampler and Empty Latent expect. Out come four outputs: width, height, aspect ratio as a string like 16:9, and orientation as landscape, portrait, or square. The aspect ratio is computed by the whratio package, which is why it's in the pack's requirements.
Inputs and outputs
width,height- required INTs, 8–16384, default 1024, step 8.width,height- INT outputs, wire into Empty Latent'swidth/height.aspect ratio- STRING output, e.g.16:9.orientation- STRING output:landscape,portrait, orsquare.
The honest take
The width and height outputs are the obvious win - one slider pair feeding Empty Latent, exactly the same numbers you'd type there. The sleeper is aspect ratio and orientation: they exist primarily to feed HelperNodes_SaveImage, which stamps them into your file's metadata. Next time you're sorting 300 outputs and need the square ones, you can find them by metadata instead of eyeballing thumbnails.
The 8-multiple constraint is the one opinion this node holds, and it's the right one - SD 1.5 and SDXL both want dimensions divisible by 8, and silently rounding for you would just confuse things. If you need the native SDXL presets instead of typing numbers, check the sibling HelperNodes_SDXLCommonResolutions; if you're on SD 1.5, this node is the one you want.
Install
ComfyUI Manager → search ComfyUI-Helper-Nodes, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/teward/ComfyUI-Helper-Nodes
Restart after. whratio is the interesting dependency here - the pack installs it for you (via Manager or pip install -r requirements.txt), and without it the aspect-ratio output stops working. No models involved.
Troubleshooting
If you try to enter a width like 1000, the slider snaps to the nearest step of 8 - that's intended, not a bug. If aspect ratio looks wrong, double-check you're on a recent install of the pack, since it relies on whratio being present.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 10248–16384 | — |
| height | INT | 10248–16384 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| aspect ratio | STRING | — |
| orientation | STRING | — |