D2 Get Image Size
Read an image's dimensions without guessing
- images
- width
- height
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:
widthandheightas 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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| displayopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |