Nodes/ComfyUI-Orientation_Mate/Orientation Mate πŸ“
ComfyUI Node

Orientation Mate πŸ“

The dimension calculator that doesn't resize your image

By dugdiamond6-afkΒ·Created 3 months agoΒ·Updated 3 months agoΒ· 0
Orientation Mate πŸ“
  • image
  • Original Width
  • Original Height
  • Aspect Ratio
  • Resized Scale
  • Resized Width
  • Resized Height
β—„New Longest Edge512β–Ί

The first thing to know about Orientation Mate is that the name is doing some heavy lifting. "Scaling node" suggests it resizes your image, and it does not. Drop this in and you get zero pixels back - you get six numbers. It's a pocket calculator for image dimensions, and once you know that, it's actually kind of handy.

What it does: you feed it any image (or a frame from a video tensor - same thing as far as ComfyUI is concerned), tell it how long you want the longest edge to be, and it figures out the new dimensions, the scale factor, and the aspect ratio for you. Then it hands those numbers to the rest of your graph. The trick, and the whole point of the pack, is that it snaps everything to multiples of 16 so the result is "tensor friendly" - friendly to latent spaces, which like their resolutions divisible by 16 (or 8 if you're running a video model with that latent).

Why you'd reach for it

ComfyUI's built-in scale nodes will happily resize an image to whatever dimensions you type in. The problem this solves is the mental math: "I want the long edge at 1024, image is 1200Γ—900, so the short edge is..." You can do that in your head, but if you're building a workflow that rescales arbitrary inputs - a batch of images of wildly different sizes, or a video where every clip differs - doing it by hand gets old fast. Orientation Mate computes it for you on the fly, and the outputs are plain INT/FLOAT values, so you can also wire them into whatever you like: a node that branches on the aspect ratio, a text label, a math node. It's the kind of utility you install once, use in one clever workflow, and forget exists otherwise.

How it works

Straightforward and fully local - no API, no key, no model download. It reads the image tensor's shape (height and width), computes width / height as the aspect ratio, then rounds your target edge up to the nearest multiple of 16. The other edge is scaled by the same factor and snapped up to a multiple of 16 as well. The source is ~40 lines of Python; the real logic is that ceiling operation.

One honest gotcha baked into the math: because the short edge snaps up to the next multiple of 16, the output isn't a pixel-perfect aspect ratio match. Ask for a longest edge of 1024 on a 1200Γ—900 image and the short edge lands on 768 rather than the exact 768-something, so your ratio shifts by a hair. Usually irrelevant. Worth knowing if you're being precious about framing.

The inputs and outputs that matter

Only two inputs:

  • image (IMAGE) - feed it anything with dimensions, and it reads them.
  • New Longest Edge (INT) - your target. Default 512, min 16, max 8192, stepped in 16s, and the node's front-end JS even live-snaps whatever you type to the nearest higher multiple of 16.

Six outputs: Original Width, Original Height, Aspect Ratio, Resized Scale, Resized Width, Resized Height. The two you actually care about are Resized Width and Resized Height - wire those into a real resize node downstream. It doesn't produce an image, so if you expected one, that's the mental adjustment.

Installing it

The easy way: ComfyUI Manager, search "Orientation Mate", install, restart. The manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/dugdiamond6-afk/ComfyUI-Orientation_Mate

Then restart ComfyUI. The requirements.txt only lists torch>=2.1.0, which you already have - this node adds no new dependencies and downloads nothing. It's the rare custom node that's genuinely zero-friction.

Where people get burned

There are no known bugs, and there's little to break. The two traps are conceptual: first, expecting it to actually resize (it doesn't - the numbers go into whatever node does the resizing), and second, assuming "multiple of 16" means you're locked out of weird aspect ratios. You're not; the snapping just nudges you toward latent-friendly values. One thing worth flagging: the license is source-available but explicitly not standard open-source - you can use and experiment freely, but redistributing or rebranding the code is prohibited. The author (dugdiamond) also labels the pack experimental, so treat it as a small utility with an irregular update schedule. For a ~40-line dimension calculator, that's a fair trade.

Categoryimage/transform

Inputs (2)

NameTypeDefaultDescription
imageIMAGEβ€”
New Longest EdgeINT51216–8192β€”

Outputs (6)

NameTypeDescription
Original WidthINTβ€”
Original HeightINTβ€”
Aspect RatioFLOATβ€”
Resized ScaleFLOATβ€”
Resized WidthINTβ€”
Resized HeightINTβ€”