πΌ Image Size
Width and height as numbers a workflow can use
- image
- Width
- Height
Dimensions belong in the graph, not in your head
Image Size takes an IMAGE and emits two INTs: Width and Height. That's the entire node. It exists because ComfyUI's resolution is scattered across the graph - an Empty Latent has a width widget, an upscaler has a scale factor, a save node's filename might want the dimensions in it - and none of them know about each other. Reading the numbers off an image and turning them into sockets is how you stop hand-copying 1024 into three different fields.
Where this earns its place: upscale chains. You load an image, and you want the second pass at exactly 1.5Γ the input rather than at a fixed 1536 that only looks right for one aspect ratio. Image Size gives you the source dimensions as INTs, and any node that takes a width/height input (or a scale calculation through the pack's text/number plumbing and a switch) can derive from them. Same trick for tiling, for crop-to-aspect, and for putting %width%x%height%-style info into a filename when the numbers came from a file rather than a latent.
How it works, including the part to watch
The image tensor in ComfyUI is [batch, height, width, channels], and the node reads shape[1] and shape[2], casts to int, and outputs them. No metadata read, no EXIF, no file inspection - it's asking the tensor.
Which means: it reports the first image in the batch. A batch of four differently-sized images can't exist as one tensor anyway (tensors are rectangular), so this is fine, but it does mean the answer describes the batch, not "the image you're thinking of". It also means you can't point this node at a file path - if the image isn't loaded into the graph yet, Image Size has nothing to measure. Load first, then measure.
The other zero-cost detail: the outputs are plain INTs, which means they plugin anywhere an integer widget can be converted to an input. Right-click a width field β Convert widget to input β wire Image Size's Width in. That's the mechanism that makes this node useful, and it's core ComfyUI plumbing rather than anything the pack invented.
Inputs and outputs
Image is the only input, an IMAGE socket - the standard torch tensor that goes from loaders and samplers to previews. Nothing else to configure, which is why the node's UI is a title bar and two dots.
Outputs are Width and Height, both INT. Wire them into a scale-by-pixel node, an Empty Latent's width/height, a crop or pad node, a math node that computes half the width, or a text concatenation for filenames. For an upscale-by-factor workflow, the common shape is Width/Height β multiply β target dimensions for the second sampler; if you'd rather not do arithmetic in nodes, feeding them into a "resize to these exact pixels" node is the same idea with fewer pieces.
Install
Manager: Extensions β Node Pack β search "Honda Nodes" β Install β restart. Or:
cd ComfyUI/custom_nodes
git clone --depth 1 https://github.com/Avaray/honda-nodes.git
cd honda-nodes
python install.py # ComfyUI's python; portable Windows: ..\..\..\python_embeded\python.exe install.py
Nothing to download for this node - it's a few lines over a tensor. The pack's installer fetches jq and ime for the JSON and metadata nodes. As with the whole pack, ComfyUI 0.38.0+ is required: it's V3-schema only.
Common issues
It says 1024Γ1024 and the image isn't. Something upstream resized - a loader with a size widget, an upscale node, a "fit to" node. Image Size reports what it was handed, not what was on disk. If you need the file's original dimensions, measure before the resize.
The numbers are stale after a re-run. Cache. The tensor didn't change, so nothing upstream of the preview re-executed and the node's outputs are what they were. Editing a widget upstream is what forces recompute.
"Convert widget to input" isn't showing on the node I want to feed. Some inputs can't become sockets in the current frontend, and the Nodes 2.0 UI moved where that menu item lives. The concept is stable; the gesture has shifted more than once, so if the right-click menu looks different from a tutorial, that's the reason and not you.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Width | INT | β |
| Height | INT | β |