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 > Nodes > Sage Utils > Logical Switch

ComfyUI Node: Logical Switch

Class Name

Sage_LogicalSwitch

Category
Sage Utils/util
Author
arcum42 (Account age: 6442days)
Extension
Sage Utils
Latest Updated
2026-05-17
Github Stars
0.03K

How to Install Sage Utils

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

Logical Switch Description

Facilitates AI art workflow decisions by selecting inputs based on specified conditions.

Logical Switch:

The Sage_LogicalSwitch node is designed to facilitate decision-making processes within your AI art workflows by allowing you to select between two different inputs based on a specified condition. This node is particularly useful when you want to dynamically choose which path to follow in your workflow, ensuring that only the necessary branch is evaluated, which can optimize performance and resource usage. By leveraging this node, you can create more flexible and efficient workflows that adapt to varying conditions, enhancing the overall functionality and responsiveness of your AI art projects.

Logical Switch Input Parameters:

condition

The condition parameter is a boolean input that determines which of the two provided values will be selected and passed through the node. If the condition is true, the node will evaluate and return the true_value; if false, it will evaluate and return the false_value. This parameter is crucial as it dictates the logical flow of your workflow. The default value is true, and it does not have a specified minimum or maximum value since it is a boolean.

true_value

The true_value parameter represents the input that will be selected if the condition is true. This input is evaluated lazily, meaning it is only processed if the condition requires it, which can save computational resources. It is optional, and if not provided, the node will rely on the false_value when the condition is true.

false_value

The false_value parameter is the input that will be selected if the condition is false. Similar to true_value, this input is also evaluated lazily and is optional. If not provided, the node will default to using the true_value when the condition is false.

Logical Switch Output Parameters:

result

The result parameter is the output of the node, representing the value selected based on the condition. It will be either the true_value or the false_value, depending on the evaluation of the condition. This output is crucial for directing the flow of your workflow, allowing you to dynamically adapt to different scenarios and conditions.

Logical Switch Usage Tips:

  • Use the Sage_LogicalSwitch node to create conditional logic in your workflows, enabling dynamic decision-making based on real-time conditions.
  • Ensure that at least one of the true_value or false_value inputs is connected to avoid errors and ensure the node functions correctly.

Logical Switch Common Errors and Solutions:

At least one of true_value or false_value must be connected.

  • Explanation: This error occurs when neither the true_value nor the false_value inputs are connected, leaving the node without a valid output to select.
  • Solution: Connect at least one of the true_value or false_value inputs to ensure the node has a valid output to process based on the condition.

Logical Switch Related Nodes

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

Logical Switch