ComfyUI > Nodes > ComfyUI-RvTools_v2 > IF A Else B

ComfyUI Node: IF A Else B

Class Name

IF A Else B [RvTools]

Category
🫦 RvTools II/ Switches
Author
r-vage (Account age: 317days)
Extension
ComfyUI-RvTools_v2
Latest Updated
2026-03-27
Github Stars
0.02K

How to Install ComfyUI-RvTools_v2

Install this extension via the ComfyUI Manager by searching for ComfyUI-RvTools_v2
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-RvTools_v2 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

IF A Else B Description

The node enables conditional input selection in AI art workflows based on boolean logic.

IF A Else B [RvTools]:

The IF A Else B [RvTools] node is designed to facilitate decision-making processes within your AI art workflows by allowing you to choose between two different inputs based on a boolean condition. This node acts as a switch, directing the flow of data depending on whether a specified condition is true or false. By integrating this node into your workflow, you can dynamically alter the path of execution, enabling more complex and responsive designs. This capability is particularly useful in scenarios where you need to toggle between different models, settings, or data streams based on specific criteria, thus enhancing the flexibility and adaptability of your creative processes.

IF A Else B [RvTools] Input Parameters:

on_true

The on_true parameter represents the input that will be selected and returned by the node if the boolean condition is evaluated as true. This parameter can accept any type of data, allowing you to pass through various forms of input such as models, settings, or other data structures. There are no specific minimum, maximum, or default values for this parameter, as it is designed to be flexible and accommodate a wide range of input types.

on_false

The on_false parameter is the counterpart to on_true and represents the input that will be selected and returned by the node if the boolean condition is evaluated as false. Similar to on_true, this parameter can accept any type of data, providing the flexibility to handle different forms of input. There are no specific constraints on the values for this parameter, ensuring it can be tailored to suit various needs within your workflow.

boolean

The boolean parameter is a critical input that determines which of the two inputs (on_true or on_false) will be returned by the node. It is a boolean type, meaning it can only be true or false. This parameter is required and must be explicitly provided to guide the node's decision-making process. The default value is true, but it can be set to false to switch the output to the on_false input.

IF A Else B [RvTools] Output Parameters:

any

The output of the IF A Else B [RvTools] node is a single parameter that can be of any type, reflecting the input that was selected based on the boolean condition. This output is crucial as it determines the subsequent flow of data in your workflow, allowing you to dynamically adjust the execution path based on the specified condition. The flexibility of this output type ensures that it can seamlessly integrate with various components of your AI art projects.

IF A Else B [RvTools] Usage Tips:

  • Use the boolean parameter to dynamically control the flow of your workflow, allowing for real-time adjustments based on changing conditions or inputs.
  • Ensure that both on_true and on_false inputs are correctly configured to prevent unexpected results, especially when dealing with complex data types or models.

IF A Else B [RvTools] Common Errors and Solutions:

Missing boolean input

  • Explanation: The node requires a boolean input to determine which path to take, and if this input is not provided, the node cannot execute properly.
  • Solution: Ensure that the boolean parameter is explicitly set to either true or false before executing the node.

Incompatible input types

  • Explanation: If the types of on_true and on_false inputs are not compatible with the rest of your workflow, it may lead to errors or unexpected behavior.
  • Solution: Verify that the data types of both inputs are compatible with the subsequent nodes in your workflow to ensure smooth execution.

IF A Else B Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-RvTools_v2
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.

IF A Else B