HT Dimension Analyzer
Long edge, short edge, no math required
- image
- long_edge
- short_edge
A portrait is 832 wide and 1216 tall. A landscape is the reverse. If your workflow has to react to orientation - "resize the long edge to 1024" or "pad to square based on the shorter side" - you need to know which edge is which as a number. HT Dimension Analyzer, from HommageTools, is the two-output node that answers that: feed it an image, get long_edge and short_edge as INTs.
What it does
One input, image (an IMAGE tensor). Two outputs:
- long_edge - the larger of width and height.
- short_edge - the smaller.
That's the entire node. It extracts the dimensions from the tensor - it handles both standard BHWC (batch, height, width, channels) and bare HWC tensors, which is the "proper tensor handling" the pack brags about - then sorts the two values and hands them out. No aspect ratio math, no rounding, no side effects.
Where it earns its keep
It's a plumbing node, and its value is that it classifies dimensions so other nodes can branch on them. Practical patterns:
- Orientation-conditional workflows. Feed
long_edge == heightinto a switch and you can route portrait images one way and landscape another, automatically. - Feeding a downscaler. The pack's HT Downsample wants a
target_long_edge; wire this node's output in and you've got a self-consistent resize chain where the target always applies to the right dimension. - Padding/upscaling decisions. Before a generative upscale, knowing the short edge tells you how much room you have before VRAM becomes the constraint - the upscaling rabbit hole is deep (see the modidex upscaling notes on tiled diffusion), but knowing your source size is where it starts.
Since it's a pure function of the input, you can also drop it into a batch workflow without worrying about state - every image in the batch gets its own long/short values, and nodes downstream see per-image numbers.
Installing it
Ships with HommageTools. ComfyUI Manager → search HommageTools, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ArtHommage/HommageTools.git
cd HommageTools && pip install -r requirements.txt
Restart ComfyUI, find it in the HommageTools menu.
The honest take
If you resize to fixed dimensions by hand, this is overkill - you know your sizes. But the moment your workflow accepts arbitrary user images (drag-any-photo-in pipelines), this becomes the small piece that makes everything else conditional work. It returns (0, 0) on a failed parse rather than raising, which is merciful, though it does mean a silent zero if you feed it garbage - check the values before trusting downstream math.
It's boring, it's correct, and it's exactly what the name says. Sometimes that's the best thing a node can be.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| long_edge | INT | — |
| short_edge | INT | — |