Image Dimensions
Get an image's width and height as real INT values, instantly
- image
- width
- height
"You loaded an image - what size is it?" is a question ComfyUI asks constantly, and the stock answer involves squinting at a metadata tab. Utility Image Dimensions just answers it: feed an image in, get width and height out as proper INT sockets. Then wire those into an Empty Latent, a resize node, a text template, whatever needs to know.
It's from ComfyUI Extended, the dependency-free utility pack, and it's the sort of node that's so simple you forget it's there - until you're building a workflow that has to adapt to whatever image it's handed.
How it works
One required input, image (IMAGE). The implementation is exactly two lines: width = image.shape[2], height = image.shape[1]. ComfyUI stores images as tensors in B, H, W, C order, so those two indices are the pixel dimensions, period.
Outputs are two INTs, named width and height. No batch handling to worry about - a batched tensor still has the same per-image H, W, so you get the resolution regardless of how many images are stacked.
Where it earns its keep: feeding an Empty Latent that has to match an input image exactly, driving a resize to a multiple of the source, or just logging dimensions into a text preview so you stop guessing. It's the plumbing node that makes adaptive workflows possible.
Install
Shared with the rest of this zero-dependency pack:
cd /path/to/your/ComfyUI/custom_nodes
git clone https://github.com/rookiepsi/comfyui-extended.git
Restart ComfyUI; it lives under comfyui-extended/utility. Or ComfyUI Manager → search "ComfyUI Extended" → install → restart. No models, no pip packages.
Common issues
- It only reads, it doesn't resize. Obvious, but worth stating - this node reports dimensions; it won't change them. Pair it with a resize/upscale node for that.
- Requires an actual IMAGE tensor. If you feed it something that isn't an image type, the shape indexes won't line up. Keep it fed with an image output.
- Returns raw pixels. ComfyUI latents are stored differently (often 8x downsampled). If you're after latent dimensions for an Empty Latent, that's a different number - this node gives you the pixel resolution of an actual image.
The dry verdict: it's a two-line utility that costs you nothing and removes a whole category of "wait, how big is this again?" moments. The kind of node that's boring on purpose, and that's a compliment.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |