ComfyUI > Nodes > ComfyUI-LogicUtils > Bitwise And

ComfyUI Node: Bitwise And

Class Name

LogicGateBitwiseAnd

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 And Description

Performs a bitwise AND on two integers, returning a new integer with bits set to 1 if both inputs' bits are 1.

Bitwise And:

The LogicGateBitwiseAnd node is designed to perform a bitwise AND operation on two integer inputs. This operation is fundamental in digital logic and computing, where it is used to compare corresponding bits of two numbers and return a new integer where each bit is set to 1 only if both corresponding bits of the input numbers are also 1. This node is particularly useful in scenarios where you need to mask certain bits of a number, perform bit-level data manipulation, or implement logical operations in a computational workflow. By leveraging the bitwise AND operation, you can efficiently manage and manipulate binary data, making this node a valuable tool for tasks that require precise control over individual bits.

Bitwise And Input Parameters:

input1

input1 is the first integer input for the bitwise AND operation. It serves as one of the two numbers whose bits will be compared. The default value for input1 is 0, and it must be an integer. This parameter directly influences the result of the operation, as each bit of input1 is compared with the corresponding bit of input2.

input2

input2 is the second integer input for the bitwise AND operation. Like input1, it is an integer and has a default value of 0. The bits of input2 are compared with those of input1, and the result is determined by the logical AND of each pair of corresponding bits. This parameter is crucial for defining the second operand in the bitwise operation.

Bitwise And Output Parameters:

INT

The output of the LogicGateBitwiseAnd node is an integer, which is the result of the bitwise AND operation between input1 and input2. Each bit in the output integer is set to 1 only if the corresponding bits in both input1 and input2 are also 1. This output is essential for applications that require bit-level data processing, as it allows you to isolate specific bits or perform logical operations on binary data.

Bitwise And Usage Tips:

  • Use the LogicGateBitwiseAnd node to mask specific bits in a number by setting input2 to a value where only the bits you want to keep are set to 1. - Combine this node with other bitwise operations like OR and XOR to perform complex bit manipulations and logical operations in your workflow.

Bitwise And Common Errors and Solutions:

Invalid Input Type

  • Explanation: The inputs provided are not integers, which is required for the bitwise AND operation.
  • Solution: Ensure that both input1 and input2 are integers before passing them to the node.

Unexpected Output

  • Explanation: The output is not as expected due to incorrect input values or misunderstanding of the bitwise AND operation.
  • Solution: Double-check the input values and ensure you understand how the bitwise AND operation works. Each bit in the output is set to 1 only if both corresponding bits in the inputs are 1.

Bitwise And 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.