ComfyUI Node

Image Dimensions

Image Dimensions — the one-liner that feeds your whole resolution pipeline

By aesethtics·Created about a year ago·Updated about a year ago· 1
Image Dimensions
  • image
  • width
  • height
  • batch_size

Half of ComfyUI is feeding one node's numbers into another node's fields, and width/height are the numbers that show up everywhere. This node just reads the shape of an image tensor and hands you three clean INTs: width, height, and batch_size. Nothing clever, nothing hidden - it's the kind of glue node you'd otherwise hand-write.

You'll reach for it the moment a workflow needs to react to an image instead of assuming dimensions. Wire your Load Image or VAE-decoded output in, then feed width and height straight into an Empty Latent Image or an upscale node so everything stays locked to whatever you loaded. That's the classic use: img2img or an inpainting pass where the source size is never the same twice. It turns "I hope this matches" into "it can't not match."

How it works

ComfyUI stores images as tensors, and this node just inspects the shape. If the tensor is 4D - [batch, height, width, channels], which is what Load Image and VAE decode give you - it unpacks all three values. A 3D tensor gets a batch of 1. Anything unexpected returns zeros rather than crashing, which is honestly the right failure mode for a utility node.

The output you don't get from the obvious alternatives is batch_size. ComfyUI's built-in Get Image Size gives you width and height, but it stops there. If you're doing animation or video work, or you loaded a folder and want to know how many frames actually came in, batch_size is the number that tells you whether your batch survived the journey. That's the niche this node fills.

The inputs that matter

There's exactly one required input: image, expecting an IMAGE tensor. That's the whole API.

Three outputs:

  • width - INT, pixels across
  • height - INT, pixels down
  • batch_size - INT, how many images are stacked in the tensor

Installing it

This ships in the ComfyUI Utilitools pack, so you install the pack once and get all of its nodes together. Either search "Utilitools" in ComfyUI Manager (listed as "ComfyUI Utilitools Nodes"), or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/aesethtics/ComfyUI-Utilitools

Restart ComfyUI after. There's no requirements.txt and no model downloads - the whole pack runs on Python's standard library, so this is as friction-free as a custom node gets. You'll find it under Utilitools → Image.

Gotchas

The obvious one: the pack author has no requirements.txt and ships zero dependencies, so there's basically nothing to break. The only real trap is conceptual - width and height are the image's pixel dimensions, not a resolution you chose. If you feed a non-multiple-of-8 image into a latent workflow expecting clean latents, the node will happily report a weird number like 513 and your Empty Latent Image will take it. Size readings are honest; what you do with them is on you.

It's a small pack with essentially no community footprint, so don't expect a lively thread of tips - the source is short enough to read in a minute if you ever wonder what it's doing. For the job it does, that's a feature.

CategoryUtilitools/Image

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (3)

NameTypeDescription
widthINT
heightINT
batch_sizeINT