Get Image Width Height
Reading image dimensions as live values in Avatar Graph
- image
- width
- height
This one's not a Blender node despite living in the blender category of Avatar Graph - it's a small, generic utility, and it earns its place in this pack because of one specific problem: the pack turns a flat character image into 3D mesh planes, and those planes need to be scaled to match the source image's aspect ratio or your character comes out stretched. The README even calls this out as its own step in the mesh pipeline ("Match Texture Aspect Ratio... a re-scale is needed at the end of the operation"). GetImageWidthHeight is how you get the numbers to drive that rescale.
How it works
There's no cleverness here, which is the point - it reads an IMAGE tensor and reports its pixel width and height as numeric outputs instead of leaving them baked into the tensor's shape where only Python code could see them. That matters in a node graph, because a lot of downstream nodes (a mesh scale, a plane's dimensions, a crop) want a plain number input, not something you have to infer from an image. Rather than typing in a hardcoded width and height and hoping it matches whatever image ends up flowing through the graph, you wire the actual image in and let this node report its real dimensions - so if you swap the source image later, the scale updates automatically instead of silently going stale.
The inputs and outputs that matter
image- the image tensor to measure. This is the only input that matters; wire in whatever character portrait or texture you need dimensions for.scale- a float, defaults to1. Multiplies both outputs, so if you need half-resolution values, or you're converting to some other unit downstream, this saves you an extra multiply node.
Outputs are width and height, both FLOAT - note they come out as floats, not integers, so if a downstream node insists on an integer count you may need to round.
How to install it
Standard for the whole pack: ComfyUI Manager, search "Avatar Graph", install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
then pip install -r requirements.txt and restart. This particular node doesn't touch Blender's bpy module at all, so it has none of the pack's heavier install requirements - but it still lives inside the same custom_nodes folder as the ones that do, so the pack's overall Python-3.10 pin (for bpy) still applies to your environment even if this one node wouldn't need it on its own.
Common issues & troubleshooting
If the pack fails to load entirely, this node disappears along with everything else - that's an environment problem, not something specific to width/height reading. Check ComfyUI's console at startup for an import failure on avatar-graph-comfyui, and make sure pip install -r requirements.txt completed without errors in whatever Python 3.10 environment you're running.
The other place people trip up is expecting integers where floats come out - if you're feeding width/height into a widget or node that wants a whole number, add a round/convert step, since this node reports exactly what it says: a float, scaled by whatever you set scale to.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| imageopt | IMAGE | — | |
| scaleopt | FLOAT | 1.00 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | FLOAT | — |
| height | FLOAT | — |