ComfyUI Node

Bitwise Or

Combining integer flags without leaving the graph

By aria1th·Created 3 years ago·Updated 7 months ago· 119
Bitwise Or
    • INT
    input10
    input20

    The counterpart to Bitwise And: instead of masking bits down, this one combines them - Python's | operator on two integers, as a node.

    What it does

    Two required INT inputs, input1 and input2, both defaulting to 0. The node ORs them together bit by bit and returns the result as a single INT. Where Bitwise And is for isolating specific bits out of a packed value, Bitwise Or is for the opposite move: setting specific bits in. If you're building up a packed-flag integer where different bit positions mean different things (a common trick for cramming several boolean settings into one number), OR is how you turn a flag on without disturbing the others.

    Same honest framing as the rest of the bitwise nodes in this pack: this is a niche tool. Most ComfyUI workflows never need to think about integers as bit patterns at all. It's here because the pack's whole premise, from author aria1th, is exposing real Python operators as graph nodes rather than picking and choosing only the ones that come up in typical image workflows - so the low-level bit operations are included right alongside the more commonly useful list and comparison nodes, even though far fewer people will end up wiring this particular one into anything.

    The inputs and outputs that matter

    • input1 (required INT, default 0) - the first value.
    • input2 (required INT, default 0) - the second value.
    • Output: INT - input1 | input2, bit by bit.

    Installing it

    Same install path as every node in this pack: ComfyUI Manager, search ComfyUI-LogicUtils, install, restart - or clone it yourself with cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils and restart ComfyUI afterward. Nothing model-related to fetch, and effectively no dependency footprint - a thread on r/StableDiffusion comparing lightweight logic-node options landed on this pack specifically because it doesn't drag anything else in behind it. There's an opt-in install hook, COMFYUI_LOGICUTILS_AUTO_INSTALL=1, and an explicit off switch, COMFYUI_LOGICUTILS_SKIP_INSTALL=1 - with nothing heavy in the repo to begin with, most people will never touch either.

    Where people get burned

    The recurring trap with all the bitwise gates in this pack: don't reach for this one expecting logical OR. If you want "is either of these conditions true," that's a boolean question and you want a node whose output is actually typed BOOLEAN - the Or gate elsewhere in this pack (the one working on arbitrary wildcard inputs) is built for that. This node ORs raw integer bit patterns and gives you back a number; treating a nonzero result as "true" happens to work in a lot of simple cases but isn't what the node is actually doing, and it'll surprise you the moment you're combining values where the bit-level result doesn't map cleanly to your intended boolean logic.

    Type strictness applies here too: both ports are INT, not wildcard, so floats and strings get rejected at connection time rather than silently coerced. And as with everything in this pack, the README's own admission that documentation hasn't caught up with the number of nodes means the source is the most reliable place to double-check exact behavior if anything here seems off.

    CategoryLogic Gates

    Inputs (2)

    NameTypeDefaultDescription
    input1INT0
    input2INT0

    Outputs (1)

    NameTypeDescription
    INTINT