ComfyUI > Nodes > ComfyUI-LogicUtils > Bitwise Or

ComfyUI Node: Bitwise Or

Class Name

LogicGateBitwiseOr

Category
Logic Gates
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

Install this extension via the ComfyUI Manager by searching for ComfyUI-LogicUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-LogicUtils in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Bitwise Or Description

Performs a bitwise OR on two integers, merging binary data by setting bits to 1 if either input bit is 1.

Bitwise Or:

The LogicGateBitwiseOr node is designed to perform a bitwise OR operation on two integer inputs. This operation is fundamental in digital logic and computing, where it is used to combine binary values. The bitwise OR operation compares each bit of the input integers and returns a new integer where each bit is set to 1 if at least one of the corresponding bits of the inputs is 1. This node is particularly useful in scenarios where you need to merge or combine flags, settings, or other binary data representations. By leveraging this node, you can efficiently execute logical operations that are essential in various computational tasks, ensuring that your data processing is both accurate and efficient.

Bitwise Or Input Parameters:

input1

input1 is the first integer input for the bitwise OR operation. It serves as one of the two operands whose bits will be compared and combined. The default value for input1 is 0, meaning that if no other value is provided, the operation will consider this input as zero. This parameter is crucial as it directly influences the result of the bitwise OR operation, with each bit of input1 being compared to the corresponding bit of input2.

input2

input2 is the second integer input for the bitwise OR operation. Like input1, it acts as an operand in the operation, and its bits are compared with those of input1. The default value for input2 is also 0. The outcome of the bitwise OR operation depends on the bits of input2, as each bit is evaluated alongside the corresponding bit of input1 to determine the resulting integer.

Bitwise Or Output Parameters:

INT

The output of the LogicGateBitwiseOr node is an integer, denoted as INT. This integer represents the result of the bitwise OR operation performed on input1 and input2. Each bit in this output integer is set to 1 if at least one of the corresponding bits in the input integers is 1. This output is essential for applications that require the combination of binary data, as it provides a straightforward way to merge or evaluate multiple binary conditions.

Bitwise Or Usage Tips:

  • Ensure that both input1 and input2 are integers, as the node is specifically designed to work with integer values. Using non-integer values may lead to unexpected results or errors.
  • Utilize the default values of 0 for both inputs if you want to perform a bitwise OR operation with a single operand, effectively returning the operand itself as the result.

Bitwise Or Common Errors and Solutions:

TypeError: unsupported operand type(s) for |: 'int' and 'str'

  • Explanation: This error occurs when one or both of the inputs are not integers. The bitwise OR operation requires both operands to be integers.
  • Solution: Ensure that both input1 and input2 are integers before passing them to the node. Convert any non-integer inputs to integers using appropriate conversion methods.

ValueError: invalid literal for int() with base 10

  • Explanation: This error might occur if a non-integer value is being implicitly converted to an integer, and the conversion fails.
  • Solution: Double-check the inputs to ensure they are valid integers. If necessary, explicitly convert inputs to integers using the int() function, ensuring they are in a format that can be converted.

Bitwise Or Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-LogicUtils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.