πͺ Get resolution
Get Resolution (Crystools)
- image
- width
- height
Feed it an image, get its width and height back as two separate INT values. There's no options, no fuss - this is a single-purpose lookup node.
Why you'd reach for it
You need the actual pixel dimensions of an image as numbers you can wire elsewhere: matching an Empty Latent Image's size to an input image before an img2img pass, branching logic based on aspect ratio, or just displaying the resolution somewhere with Show any instead of cracking open file properties outside ComfyUI. Any time a downstream node needs width/height as plain integers rather than something baked into the image tensor itself, this is the bridge.
A common pattern: load a reference image, run it through this node, and feed width/height straight into an Empty Latent Image so your generation matches the reference's aspect ratio without you doing the arithmetic by hand. It's a small node, but it removes a whole category of "I forgot to update the latent size to match" mistakes.
How it works
It reads the dimensions straight off whatever image tensor is connected - nothing more elaborate than that. The node is flagged as an output node, which in practice means it renders the width/height values directly on the node face as a convenience even if you never wire the outputs anywhere else - useful when you just want a quick readout while you're building a graph.
Inputs and outputs
One required input: image. Two outputs: width and height, both INT.
Installing it
Through ComfyUI Manager, search crystools. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/crystian/ComfyUI-Crystools.git
cd ComfyUI-Crystools
pip install -r requirements.txt
Restart ComfyUI. No models or extra dependencies for this node.
Common issues
The one thing to keep straight: it reports the resolution of whatever's actually connected at that point in the graph - if you resized or upscaled the image earlier in the pipeline, this reports the post-resize dimensions, not the original file's size. If you specifically need the original, unprocessed resolution of a loaded file, that's a job for Load image with metadata's file info output (via Metadata extractor), not this node - this one only ever sees what's currently in the wire.
It's also worth remembering this node has no batch-awareness beyond reporting the frame size - if you're passing a batch of images through, you get the per-image width and height, not anything about how many images are in the batch. If you need the batch count too, that's a separate lookup elsewhere in your graph.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | β |
| height | INT | β |