GetImageInfo PM
The node that just reads width and height — sometimes that's all you need
- image
- width
- height
GetImageInfo PM is the most unglamorous node in the Portrait-Maker pack, and that's exactly why it's worth knowing. It takes one image, reads its width and height, and hands both back as integers. No model, no VRAM, no downloads - it's a two-line read of the tensor shape. You'd never build a workflow around it, but you'll be glad it's there the first time a workflow needs to adapt to whatever image lands on the input.
When you'd reach for it
Dynamic workflows. If you're resizing to keep an aspect ratio, checking that an upscaler actually produced the size you asked for, or passing a measured dimension into a downstream node, hardcoding 512x768 means a change upstream silently breaks everything downstream. GetImageInfo turns that into a real value in the graph: feed the width and height outputs into ImageResizeTarget PM, ImageScaleShort, or any INT parameter, and the workflow tracks whatever the sampler actually produced. It's also a handy debugging tool - drop it on a wire and look at its values to see what an image's true dimensions are at that point.
How it works
Nothing fancy: the node reads the image tensor's shape - width from the third dimension, height from the second - and returns them. Instant, deterministic, works offline. There's genuinely nothing to tune and nothing to break.
Outputs
Two integers, both straightforward:
- width
- height
Wire them wherever a workflow needs a number. Combined with a math node you can compute aspect ratios, and from there do things like pad or crop to a target shape without ever typing a resolution by hand.
The small print
The values reflect the image as it exists in the graph at that moment, after any earlier resize, crop, or upscale - not the original file's metadata. ComfyUI images are all float32 RGB tensors internally, so there are no channel or color surprises hiding in there. The only mild annoyance is the same one that hits every node in this pack: installing it means installing the whole pack, which pulls in heavy dependencies (modelscope, insightface, tensorflow, onnxruntime, diffusers==0.18.2) and runs a multi-gigabyte first-startup model download you don't need for this node at all. If you only want image dimensions, a lighter standalone utility exists - but if you're already running Portrait-Maker for its face tools, this is the native, dependency-free way to get them.
Installing it
ComfyUI Manager (search "ComfyUI-Portrait-Maker") or:
cd ComfyUI/custom_nodes
git clone https://github.com/THtianhao/ComfyUI-Portrait-Maker.git
Restart ComfyUI after cloning. The pack downloads its model set on first startup with no hash verification - don't interrupt it, and if it breaks, delete the half-downloaded files and start again. Windows users should be on Python 3.11 because the pack installs insightface from a prebuilt wheel for that version.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |