Popo Image Size
The long side of your image, as a number — that's the whole job
- image
- long_side
- short_side
You've got an image in your graph and you need its dimensions as numbers you can do something with. Popo Image Size is the smallest possible answer: one IMAGE in, two INTs out - long_side and short_side. No dropdowns, no settings, nothing to tune. It exists to turn a picture into two integers you can wire into anything that wants an INT.
It's one of the four nodes in the tiny ComfyUI Popo Utility pack, and honestly it's the "lite" version of its sibling. If you want width and height as well as long/short, skip this and grab Popo Image Dimensions instead - it returns all four. Size is for when you only care about "biggest side" and "smallest side" and want the wire clutter minimized.
How it works
ComfyUI hands every node an IMAGE as a tensor, and a tensor already knows its shape. Popo Image Size just reads shape - for a [batch, height, width, channels] tensor it pulls height and width, then sets long_side = max(h, w) and short_side = min(h, w). That's the whole mechanism. The README brags about "zero-copy" and "constant time" performance, and for once the marketing is literally true: reading a tensor's shape moves zero pixels and takes a fraction of a microsecond no matter the image size.
What you wire it into
Both outputs are plain INTs, so they feed anything that takes an integer - a scale node's target dimension, a condition, or the a/b/c inputs of a math node. In this pack the natural pairing is Popo Math Expression: feed long_side into a and use a * 0.5 to get half the image's longest edge, no manual arithmetic on your part. That "dimensions feeding math feeding the next node" chain is the classic use - e.g. scaling an image to 75% of its long side.
Install
Standard custom node install, no model downloads, no extra Python packages - the pack's dependencies (torch, numpy, Pillow) are already inside every ComfyUI install.
cd ComfyUI/custom_nodes
git clone https://github.com/popoimm/comfyui-popo-utility
Restart ComfyUI, then find it under Add Node → popo-utility → Popo Image Size, or search "popo" / "image size".
Common issues and gotchas
If the node doesn't show up after install, you didn't restart - that's the #1 cause with this pack. When it loads, the console prints Popo Utility v1.0.1 - Simple version loaded!; no line, no node. If you ever see 0 coming out, the input wasn't a normal 3D/4D image tensor - the node only understands [batch, h, w, c] and [h, w, c] shapes and returns zeros on anything else. It's a dumb, fast, predictable utility. That's exactly what you want it to be.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| long_side | INT | — |
| short_side | INT | — |