Get Image Size & Count
Read width, height, and batch size mid-graph
- image
- image
- width
- height
- count
A small, quietly essential utility. Get Image Size & Count tells you the dimensions and batch size of an image flowing through your graph, and - this is the clever part - passes the image straight through unchanged while it's at it. Its description: "Returns width, height and batch size of the image, and passes it through unchanged." So you drop it inline anywhere, read the numbers, and your workflow keeps flowing. No branching, no dead-end.
It earns its keep in two ways. First, as a debugger: when something downstream is complaining about a size mismatch, splice this in and you can see the actual dimensions instead of assuming them. Second, as a wiring source: those width and height outputs are real INTs you can feed into the next node, so your graph adapts to whatever size the image actually is instead of you hardcoding numbers that break the moment the input changes.
How it works
It inspects the incoming image tensor and reads off its shape - width, height, and how many images are in the batch. Because it returns the image untouched alongside the numbers, it's a pass-through probe, not a fork. That "pass it through unchanged" behavior is what lets you insert it in the middle of a chain rather than tapping off to the side.
Inputs and outputs
One input: image. Four outputs:
- image - the same image, passed through, so the node sits inline.
- width and height - the dimensions, as INTs.
- count - the batch size, as an INT. On a single image this is 1; on a video or a folder-load it's your frame count.
Where it wires in
Wherever a downstream node needs to know the size. Feed width and height into an empty-latent node, an upscaler's target size, or a resize node, and everything scales to match the real input. Use count to drive loop logic or to sanity-check that a batch loaded the number of frames you expected. And when you're staring at a "tensor size mismatch" error with no idea which node is wrong, drop this in to read the truth - that's the fastest way to find the offender.
Installing it
Part of kijai's KJNodes pack.
- ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, thenpip install -r requirements.txt, and restart.
Nothing to download; it's pure inspection.
Common issues
There's not much to break here, which is probably why nobody clicks the search result - it does one obvious thing correctly. The one thing worth internalizing is width vs height order and the difference between an image's pixel dimensions and a latent's dimensions. This node reports the image's pixel size; a latent is 8× smaller per side, so don't feed a pixel width straight into something expecting latent dimensions without accounting for the factor. Beyond that: if count reads something you didn't expect, that's usually the node upstream doing something to your batch you didn't notice - which is exactly the kind of surprise this probe exists to surface.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |
| count | INT | — |