ComfyUI > Nodes > ComfyUI-LogicUtils > ReturnAorBValue

ComfyUI Node: ReturnAorBValue

Class Name

LogicGateEither

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

ReturnAorBValue Description

Selects between two inputs based on a condition, aiding dynamic decision-making in logic flows.

ReturnAorBValue:

The LogicGateEither node is designed to provide a conditional selection mechanism within your logic flow. It allows you to choose between two inputs based on a specified condition, effectively acting as a simple decision-making tool. This node is particularly useful when you need to dynamically select between two options depending on a boolean or truthy condition. By leveraging this node, you can streamline your logic processes, ensuring that the appropriate input is selected and passed forward based on the given condition. This capability is essential for creating flexible and adaptive logic structures in your AI art projects.

ReturnAorBValue Input Parameters:

condition

The condition parameter determines which of the two inputs will be selected and returned by the node. It evaluates to a boolean-like value, where a truthy value will result in input1 being chosen, and a falsy value will lead to input2 being selected. This parameter is crucial as it dictates the flow of logic and the outcome of the node's operation. The default value is 0, which is considered falsy.

input1

The input1 parameter represents the first potential output of the node. If the condition evaluates to true, this input will be returned. It can be of any type, allowing for flexibility in the kind of data you wish to pass through the node. The default value is an empty string "".

input2

The input2 parameter serves as the alternative output to input1. If the condition evaluates to false, this input will be returned instead. Like input1, it can be of any type, providing versatility in handling different data types. The default value is also an empty string "".

ReturnAorBValue Output Parameters:

anytype

The output of the LogicGateEither node is determined by the condition parameter. It will return input1 if the condition is true, or input2 if the condition is false. This output can be of any type, reflecting the type of the selected input. The flexibility in output type allows this node to be integrated seamlessly into various logic flows, adapting to the specific needs of your project.

ReturnAorBValue Usage Tips:

  • Use the LogicGateEither node to simplify decision-making processes in your logic flow by dynamically selecting between two inputs based on a condition.
  • Ensure that the condition parameter is set correctly to reflect the desired logic, as it directly influences which input is returned.

ReturnAorBValue Common Errors and Solutions:

Incorrect input type

  • Explanation: The node may not function as expected if the inputs are not compatible with the expected types.
  • Solution: Ensure that input1 and input2 are of compatible types and that the condition is a boolean or can be evaluated as such.

Unexpected output

  • Explanation: The output may not be what you expect if the condition is not correctly set.
  • Solution: Double-check the logic of your condition to ensure it accurately reflects the decision criteria you intend to implement.

ReturnAorBValue 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.