Nodes/D2 Nodes ComfyUI/D2 Get Image Size
ComfyUI Node

D2 Get Image Size

Read an image's dimensions without guessing

By da2el-ai·Created 2 years ago·Updated about a month ago· 66
D2 Get Image Size
  • images
  • width
  • height
display

This one's exactly what it sounds like: feed it an image, get back its width and height as integers you can wire into anything else. D2 Get Image Size is a two-output utility node for when a downstream node needs to know the dimensions of an image it hasn't seen yet - like feeding a load-with-resize chain, an upscale loop, or a latent builder that has to match an arbitrary input's resolution.

It's an output node too, so it doubles as a plain inspector: drop one at the end of a chain and it'll display the size right on the node while it runs. That alone is worth having when you're debugging why an image got crushed to some unexpected resolution mid-pipeline.

The inputs and outputs

  • images - any IMAGE. That's the whole job.
  • display - an optional text field. It doesn't drive anything; it's a display surface, so you can leave it empty.
  • Outputs: width and height as INTs.

That's it. No modes, no settings to fight. It reads width and height straight off the image tensor.

Installing it

It ships with the D2 pack. ComfyUI Manager → search "D2-nodes-ComfyUI" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/da2el-ai/D2-nodes-ComfyUI

Restart ComfyUI. No models, no extra deps beyond piexif and charset-normalizer. Post-v32.0.0 the pack assumes a recent ComfyUI (V3 schema); older installs should pin before 32.0.0.

The honest take

For what it is, this is hard to get wrong. The one thing worth remembering: it gives you the dimensions of whatever image arrives, not a target size - so if you're using it to drive a resize, make sure the wiring is right or you'll end up scaling to the same size you started from. If your use case is "give me a blank latent at this image's size," the pack's D2 Size Selector does that in one hop; this node is the general-purpose measurement.

CategoryD2

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
displayoptSTRING

Outputs (2)

NameTypeDescription
widthINT
heightINT