Nodes/zhangp365/ComfyUI-utils-nodes/get Image Size And Count by utils
ComfyUI Node

get Image Size And Count by utils

Get Image Size And Count by Utils

By zhangp365·Created 2 years ago·Updated 5 months ago· 135
get Image Size And Count by utils
  • image
  • width
  • height
  • count

This one does exactly what the name says and nothing more, which is precisely why it's useful. You plug in an IMAGE, and it hands back width, height, and count as three separate INT outputs you can wire wherever a number is expected. No hidden logic, no side effects - it's a read, not a transform.

The reason a node this small earns a place in a "utils" pack is that ComfyUI treats an image batch as a single tensor, and plenty of downstream nodes need to know its dimensions or how many frames are in it before they can do their job - think conditional resizing, batching logic, or deciding whether you're looking at a single still or a video clip loaded as a frame stack. Without a node like this you'd be eyeballing it or digging through a preview node's metadata. count in particular is the one people forget they need until they're building something that behaves differently for a single image versus a batch of 81 video frames.

Inputs and outputs: there's exactly one required input, image, and three outputs - width, height, count, all plain integers. That's the entire interface. Feed width/height into an EmptyLatentImage, a resize node, or a math node further down the chain to keep everything proportional to whatever actually got loaded, instead of hardcoding numbers that break the moment someone swaps the input image for something a different size. Feed count into a conditional node (this pack's own BooleanControlOutput pairs naturally here) to branch your graph based on whether you're handling one image or a batch.

Installing it: it ships as part of the same pack as everything else here - search "ComfyUI-utils-nodes" in ComfyUI Manager, or from the command line:

cd ComfyUI/custom_nodes
git clone https://github.com/zhangp365/ComfyUI-utils-nodes

Restart ComfyUI afterward. There's nothing this specific node needs beyond the pack's base install - no model downloads, no API keys, no heavy dependencies. If you've already got any other node from this pack working, this one is already working too.

Troubleshooting: honestly, there isn't much to troubleshoot here. It's a pure metadata read with no external calls and no configuration. If it's not showing up in the node search after install, that's a symptom of the pack failing to load entirely - check ComfyUI's startup console for an import error rather than assuming this specific node is broken. Custom-node packs in general are prone to Python dependency conflicts between packs sharing one environment, so if the whole ComfyUI-utils-nodes set is missing from your node list, look there first rather than at this node in isolation.

Categoryutils/image

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (3)

NameTypeDescription
widthINT
heightINT
countINT