Int Image Size
Need an image's width and height as integers? Here's the two-wire answer
- image
- width
- height
The simplest node in this batch, and one of the more genuinely useful ones. It takes an image and outputs its width and height as two separate INTs. That's it. No dropdowns, no modes, no hidden settings.
You'd think stock ComfyUI hands you this for free, but it doesn't - dimensions live inside the tensor, not as an exposed value, and the moment a downstream node wants a real number (a resize target, a coordinate for pasting, a math check like "is width even"), you're stuck reaching for workaround plumbing. This node is the plumbing, reduced to its minimum.
How it works
It reads the first frame of the input image tensor - height from the H axis, width from the W axis - and returns both as INTs, plus a text readout ("1024x1024") so you can see the size right on the node without following the wires. If the input is missing or malformed it returns 0 and 0 instead of throwing, which is the kind of defensive behavior that keeps a broken graph from hard-crashing.
Wire width and height into whatever needs them. Common patterns: feeding a resize node's size inputs so you can upscale by a factor (width × 2), or comparing width to height with a logic node to branch on orientation ("if taller than wide, use portrait crop"). Combined with the pack's Int Image Side Length (which gives you one side at a time via a mode dropdown), you've got all the dimension access you'd reasonably want.
Installing it
Part of 1hewNodes. ComfyUI Manager → search "ComfyUI 1hewNodes" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes
Restart ComfyUI. Nothing special needed - torch only, no model downloads.
Common issues
There's almost nothing to break here, which is why it's the one you'll stop thinking about after five minutes. The only real caveat is the same as its sibling nodes: it reports the first frame of the batch, so a batch of mixed-size images will give you the head's dimensions. And 0×0 for a bad input is silent - if your downstream math suddenly goes weird, verify the image actually reached the node. Otherwise, plug in, read out, move on.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |