ImageSize (Side)
Get an image's longest or shortest side, your pick
- image
- resolution
This is easy imageSizeByLongerSide with one more dropdown: instead of always returning the long edge, you tell it which side you want - Longest or Shortest - and it gives you that dimension. Same job, more flexible, and honestly the node you should default to unless you specifically want the simpler, single-purpose sibling.
Why you'd want this over the "LongerSide" version
Because sometimes the number you need is the short side, not the long one. A common case: you're building a resize step that caps the smaller dimension so an image never gets too small in either axis while letting the longer axis grow freely (or vice versa - capping the longer side so nothing exceeds your model's comfortable max resolution while letting the short side follow the aspect ratio down). Both directions come up constantly, and this node covers both from one place instead of forcing you to pick a node based on which side you happen to need this time.
How it works
It reads the image's width and height, compares them, and returns whichever one matches the side you selected. No rounding or snapping - the raw pixel count of that dimension.
The inputs and outputs that matter
image- the image to measure.side- Longest or Shortest. This is the whole point of the node; pick the dimension you actually need.resolution(INT, output) - the pixel length of whichever side you selected. This node is also an output node, so the value shows on the canvas directly, same as its LongerSide sibling.
Installing it
Ships with the base pack, no separate install. ComfyUI Manager: search ComfyUI Easy Use, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use
then install.bat on Windows or pip install -r requirements.txt, restart. No models involved.
Common issues & troubleshooting
Grabbed the wrong side by habit. If you're used to easy imageSizeByLongerSide (which only ever gives you the long edge) and you switch to this node, it's easy to forget you now have to actually set side - leaving it on the wrong choice silently gives you the opposite number from what you expect, and nothing errors, it just quietly feeds the wrong value downstream. Double-check the dropdown whenever you copy-paste this node between workflows.
Using it to detect orientation. A reasonable pattern: run this node twice with different side settings (or once each with easy imageSize for both dimensions) and compare width against the "shortest" result to figure out whether an image is portrait or landscape. There's no dedicated orientation output here, so if that's what you need, build it from a comparison node rather than expecting this node to hand you an answer directly.
Feeding the result straight into a latent size without rounding. Diffusion models generally want dimensions that are multiples of 8 (sometimes more, depending on architecture). This node reports the image's actual pixel size as-is - if that number isn't already a clean multiple, snap it with a math node before you use it to size an empty latent, or you'll hit a shape-mismatch error at sampling time.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| side | COMBO | 2 options: Longest, Shortest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| resolution | INT | — |