Nodes/Jovimetrix/OP BINARY (JOV) 🌟
ComfyUI Node

OP BINARY (JOV) 🌟

Add, multiply, XOR and friends across types

By AmoranoΒ·Created 3 years agoΒ·Updated 12 months agoΒ· 397
OP BINARY (JOV) 🌟
  • πŸ…°οΈ
  • πŸ…±οΈ
  • πŸ…°οΈπŸ…°οΈ
  • πŸ…±οΈπŸ…±οΈ
  • ❔
β—„βš’οΈADDβ–Ί
◄❓INTβ–Ί
β—„πŸ™ƒfalseβ–Ί

OP BINARY (JOV) 🌟 is the generic "do math with two things" node. Where normal ComfyUI math nodes are typed - this one adds ints, that one multiplies vectors - OP BINARY takes two operands of almost any kind and applies the operation you pick: add, subtract, multiply, divide, modulo, or bitwise ops like AND/OR/XOR. You get one node that covers every binary operation the pack supports, on floats, ints, vectors, or whatever else you throw at it. It's the workhorse for parameter math in procedural workflows, and it's current - still shipping in Jovimetrix 2.x.

The philosophy is worth understanding before you use it: Jovimetrix is built around typed inputs that auto-convert, so OP BINARY feels like a calculator that happens to know about vectors. You don't pick an integer node and a float node and hope; you pick an operation and let the types flow.

How it works

Plug two values into πŸ…°οΈ and πŸ…±οΈ, choose what you want done in βš’οΈ (the operation), and it returns the result as ❔ (any type, list-shaped like all Jovi outputs). The remaining inputs are the usual Jovimetrix conveniences:

  • ❓ (TYPE) - the output type you want, so the result comes back as FLOAT, INT, VEC2/3/4, and so on. This is where you decide whether integer division truncates or returns a float.
  • πŸ…°οΈπŸ…°οΈ / πŸ…±οΈπŸ…±οΈ (defaults) - fallback values used when an operand port isn't connected. Keep A at (0,0,0,0) and B at (1,1,1,1) and you get the familiar default behavior.
  • πŸ™ƒ - swaps A and B. Handy when you've wired something backwards and don't want to re-run the cable.

Because inputs accept single values or vectors (and the pack even added tensor support in 2.1.20), you can scale a whole batch of parameters in one shot: multiply a wave generator's output by 0.5, or XOR two integer seeds to make a pseudo-random third. For animation pipelines this is the node between your TICK/WAVE GEN and your target parameter.

Where people get burned: division by zero and integer division surprises. Watch the TYPE - if you're dividing ints and expecting 0.5, you'll get 0. Pick FLOAT for anything fractional. And if a result suddenly zeroes out, the node's overflow handling has kicked in, usually because you asked INT for something huge.

Installing it

It's part of the Jovimetrix pack:

# ComfyUI Manager: search "Jovimetrix" and install
cd ComfyUI/custom_nodes
git clone https://github.com/Amorano/Jovimetrix.git
cd Jovimetrix
pip install -r requirements.txt

Restart ComfyUI. Pure calculation - no models, no downloads, nothing beyond the pack's shared dependencies (cozy_comfyui, numpy, etc.).

Troubleshooting

  • Wrong result at the edges of a range - your TYPE is probably truncating. Switch to FLOAT or VEC and convert at the boundary.
  • Bitwise ops behave oddly on non-integers - bitwise needs integers; feed them or cast with TYPE.
  • Result is a list when you wanted a single value - that's normal Jovimetrix behavior; unwrap with a Jovi VALUE node or take [0] downstream.

It's not glamorous, but OP BINARY is one of those nodes that quietly replaces three others. Once you get used to one node doing all the binary math, the dedicated per-type nodes start to feel like clutter.

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

Inputs (7)

NameTypeDefaultDescription
πŸ…°οΈoptBOOLEAN,FLOAT,INT,VEC2,VEC3,VEC4,VEC2INT,VEC3INT,VEC4INT,COORD2D,COORD3DPasses a raw value directly, or supplies defaults for any value inputs without connections
πŸ…±οΈoptBOOLEAN,FLOAT,INT,VEC2,VEC3,VEC4,VEC2INT,VEC3INT,VEC4INT,COORD2D,COORD3DPasses a raw value directly, or supplies defaults for any value inputs without connections
βš’οΈoptCOMBOADDArithmetic operation to perform
❓optCOMBOINTOutput type desired from resultant operation
πŸ™ƒoptBOOLEANfalseFlip Input A and Input B with each other
πŸ…°οΈπŸ…°οΈoptVEC40,0,0,0value vector
πŸ…±οΈπŸ…±οΈoptVEC40,0,0,0value vector

Outputs (1)

NameTypeDescription
❔*O