π Image Get Size
Ask an image how big it is, and wire the answer into the graph
- image
- WIDTH
- HEIGHT
Every "does this resolution match?" moment in ComfyUI is you staring at an image and hoping. π Image Get Size removes the hoping: it takes an image, reads its width and height, and hands both back as typed integers you can wire straight into other nodes. It's a two-line read under the hood, and it quietly unlocks the whole class of "make the rest of the workflow adapt to whatever image arrived."
How it works
The single required input is image (IMAGE). Internally ComfyUI images are stored as (batch, height, width, channels) tensors, and the node just reads the height from index 1 and the width from index 2 of the batch's shape. Out come two integers, named helpfully: WIDTH and HEIGHT. No resizing, no decoding drama - the image passes through untouched (this is a pure read, not a converter).
Inputs and outputs
- image -
IMAGE, required. - Outputs: WIDTH (
INT), HEIGHT (INT).
Where it shines
The classic move is wiring these into an EmptyLatentImage so your output resolution matches your input resolution automatically - change the input, and the latent follows. Same trick works for keeping a resize node in lockstep with whatever a preprocessor spat out. Because the outputs are typed integers, they plug into any INT port: latent dims, resize targets, or the pack's own π
Text To Resolution reverse (which goes text β numbers; this goes image β numbers).
Install
Ships in hay86/ComfyUI_AceNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/hay86/ComfyUI_AceNodes
cd ComfyUI_AceNodes
pip install -r requirements.txt
Restart ComfyUI and find π
Image Get Size under Ace Nodes. Manager users search ComfyUI_AceNodes.
Gotchas
A couple of honest notes. First, the size it reports is the size of the tensor, which for most workflows is the actual pixel size - but if something upstream has resized the image in a latent or via a preview, the tensor may not match what you see on screen. Second, this reads the first image of a batch's dimensions; a mixed-size batch isn't really a thing in ComfyUI anyway, so that's fine in practice. And the pack's heavy requirements.txt (rembg, transformers, boto3β¦) installs even for a node this small. For adaptive workflows, it's one of those tiny nodes that punches well above its weight.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| WIDTH | INT | β |
| HEIGHT | INT | β |