Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!

ComfyUI Node: Switch

Class Name

Switch

Category
Rebalance-Pack/foundational
Author
nova452 (Account age: 1390days)
Extension
Rebalance-Pack
Latest Updated
2026-07-30
Github Stars
0.47K

How to Install Rebalance-Pack

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

Switch Description

Versatile logic utility for conditional branching in AI art workflows, enabling dynamic input selection based on boolean conditions.

Switch:

The Switch node is a versatile logic utility designed to facilitate conditional branching within your AI art workflows. It allows you to dynamically choose between two different inputs based on a boolean condition, effectively enabling "if-else" logic in your node-based environment. This node is particularly useful for scenarios where you need to toggle between two options or paths depending on a specific condition, enhancing the flexibility and adaptability of your creative processes. By integrating this node, you can streamline decision-making processes within your workflow, ensuring that the appropriate input is selected based on the given condition, thus optimizing the flow and outcome of your AI-generated art.

Switch Input Parameters:

on_true

This parameter represents the input that will be selected if the switch condition is evaluated as true. It can accept any type of input, making it highly flexible for various use cases. The value of on_true is passed through when the switch is set to true, allowing you to define the desired outcome for this condition. There are no specific minimum or maximum values, as it is designed to handle any type of data.

on_false

This parameter represents the input that will be selected if the switch condition is evaluated as false. Similar to on_true, it can accept any type of input, providing flexibility in defining the alternative path or outcome when the condition is not met. The value of on_false is passed through when the switch is set to false. There are no specific minimum or maximum values, as it is designed to handle any type of data.

switch

This is a boolean parameter that determines which input will be selected. When set to true, the node outputs the on_true input; when set to false, it outputs the on_false input. The default value is true, meaning that by default, the on_true input will be selected unless specified otherwise. This parameter is crucial for controlling the flow of data through the node, acting as the decision-making element in the conditional logic.

Switch Output Parameters:

OUT

The output parameter, labeled as OUT, represents the result of the conditional logic executed by the Switch node. It outputs the value of either on_true or on_false based on the evaluation of the switch parameter. This output is crucial as it determines the subsequent path or data flow in your workflow, allowing for dynamic and adaptable processing based on the specified condition.

Switch Usage Tips:

  • Use the Switch node to create dynamic workflows where the output needs to change based on specific conditions, such as toggling between different styles or effects in your AI art projects.
  • Ensure that both on_true and on_false inputs are properly configured to handle the expected data types, as this will prevent unexpected behavior and ensure smooth operation.
  • Consider using the Switch node in conjunction with other logic nodes, such as the Invert Boolean node, to create more complex conditional structures and enhance the decision-making capabilities of your workflow.

Switch Common Errors and Solutions:

"At least one of on_false or on_true must be connected to Switch node"

  • Explanation: This error occurs when neither the on_true nor the on_false input is connected, leaving the node without a valid output path.
  • Solution: Ensure that at least one of the inputs (on_true or on_false) is connected to a valid data source to provide a meaningful output based on the switch condition.

Switch Related Nodes

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

Switch