Image Dimensions Info
Read an image's width, height and batch size right off the tensor
- image
- width
- height
- batch_size
ComfyUI hides basic facts about your images in plain sight. The width, the height, how many images are in the batch - all sitting in the tensor's shape, but with no built-in node that just tells you. Image Info reads those three numbers off the tensor and hands them to you as plain INT outputs you can wire anywhere. It's the difference between hardcoding a resolution and letting your workflow adapt to whatever image showed up.
It's part of DebugPadawan's ComfyUI Essentials, a small MIT-licensed utility pack. In the wider ecosystem it plays the same role as a dozen similar "image size" nodes, but it's about the simplest version of that idea.
How it works
Nothing clever - and that's the point. The code reads the tensor's shape. ComfyUI images are stored as [B, H, W, C], so:
- width comes from the third dimension,
- height from the second,
- batch_size from the first - i.e., how many images are stacked in this tensor.
Because it's shape introspection, it costs almost nothing and works on any IMAGE tensor, from a single preview to a 64-frame batch.
The inputs and outputs that matter
One input: image. Three outputs:
- width (INT) - pixels across.
- height (INT) - pixels down.
- batch_size (INT) - the number of images in the batch.
The batch_size output is the one beginners usually overlook. If you've got a stack of frames and you're not sure how many there are, this answers it - and you can feed it straight into a comparison or the count side of a list node.
Install
Standard custom-node fare:
cd ComfyUI/custom_nodes
git clone https://github.com/DebugPadawan/DebugPadawans-ComfyUI-Essentials.git
Restart ComfyUI, or install via ComfyUI Manager by searching "DebugPadawan". requirements.txt lists numpy, torch, and opencv-python - numpy and torch already ship with ComfyUI and the shipped code never imports cv2, so no heavy downloads, no model files, no API keys.
Where it earns its keep
- Dynamic latent sizing. Feed
width/heightinto an Empty Latent (or a size-math chain) so you upscale or crop to match a reference image exactly, without retyping numbers. - Aspect-ratio logic. Compare width and height with a compare node to branch on landscape vs portrait.
- Batch awareness.
batch_sizetells you if a "single" image is secretly a 12-frame batch before you route it somewhere that assumed otherwise.
The honest limitation: it only reads dimensions - it doesn't resize, crop, or analyze content. It's the sensor, not the machine.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| batch_size | INT | — |