Nodes/Jovimetrix/OP UNARY (JOV) 🎲
ComfyUI Node

OP UNARY (JOV) 🎲

Every one-input math operation, in one node

By AmoranoΒ·Created 3 years agoΒ·Updated 12 months agoΒ· 397
OP UNARY (JOV) 🎲
  • πŸ…°οΈ
  • ❔
β—„βš’οΈABSβ–Ί

You've got a number, a vector, or a batch of either, and you need it flipped, squashed, normalized, or reduced to a single scalar. Instead of hunting down five different math nodes from five different packs, Jovimetrix's OP UNARY gives you 31 operations on one input, in one node. For a CALC category node it's quietly one of the most-used things in the pack, because animation math lives on these.

The name is the honest description: it's unary, meaning one operand. Feed it πŸ…°οΈ (any numeric type - boolean, int, float, vec2/3/4, or a 2D/3D coordinate) and pick the βš’οΈ Function. The menu has the obvious ones - ABS, FLOOR, CEIL, SQRT, SQUARE, LOG, LOG10, SIN, COS, TAN, NEGATE, RECIPROCAL - and about twenty more. The less obvious half is where it gets useful: MEAN, MEDIAN, MODE, MAGNITUDE, NORMALIZE, MAXIMUM, MINIMUM. Those don't map 1:1 across a vector; they collapse the whole vector to one value. MAGNITUDE, for instance, is sqrt(xΒ²+yΒ²+zΒ²), which is exactly the "length of this motion vector" math you want when driving an animation. NORMALIZE scales the vector to length 1 while keeping its direction - hand that to anything expecting a direction rather than a magnitude.

How it actually runs matters here, because Jovimetrix is batch-friendly. Every input is treated as a list even if you pass a single value, so a whole animation's worth of frames flows through in one pass and you get a matching list out. The output (❔) type follows the input type, and the tooltip says exactly that: "Output type will match the input type." One gotcha: apply SQRt to a negative and you'll get a 0 plus an error in the console rather than a crash - the pack catches the exception and keeps going. Not elegant, but it won't kill your queue.

Where people actually reach for this: feeding an easing curve through SIN to make it oscillate, taking MEAN of a batch of coordinates to find a center point, or normalizing values before they hit a LERP or a TICK-driven animation. If you're doing anything procedural, you'll trip over it eventually.

It ships with Jovimetrix, Alexander G. Morano's "procedural masking, live composition and video manipulation" pack - one install gets you all the JOV nodes, so if you already have the pack, it's in the JOVIMETRIX πŸ”ΊπŸŸ©πŸ”΅/CALC menu. If you don't, grab it via ComfyUI Manager (search "Jovimetrix") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Amorano/Jovimetrix.git
pip install -r Jovimetrix/requirements.txt

Then restart ComfyUI. The dependencies are the pack-wide set: numpy, Pillow, opencv-contrib-python, matplotlib, plus two cozy-comfyui helper libraries installed from GitHub. No model files, no weights - this is pure math on values. The usual Jovimetrix warnings apply: keep ComfyUI current (the pack targets 0.1.3+ and a recent frontend), and don't update past 1.7.48 if you depend on the old GLSL/streaming nodes - they moved to separate Jovi_* packs in v2.0. OP UNARY wasn't among them, so you're safe here.

If your value isn't quite the shape you need, feed it through a VALUE or SWIZZLE node first, then into OP UNARY. Getting the type right up front beats fixing it downstream.

CategoryJOVIMETRIX πŸ”ΊπŸŸ©πŸ”΅/CALC

Inputs (2)

NameTypeDefaultDescription
πŸ…°οΈoptBOOLEAN,FLOAT,INT,VEC2,VEC3,VEC4,VEC2INT,VEC3INT,VEC4INT,COORD2D,COORD3DInput A
βš’οΈoptCOMBOABSFunction

Outputs (1)

NameTypeDescription
❔*O