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 > ComfyUI_SamplingUtils > Switch (Inverse)

ComfyUI Node: Switch (Inverse)

Class Name

ComfySwitchInverseNode

Category
logic
Author
silveroxides (Account age: 2211days)
Extension
ComfyUI_SamplingUtils
Latest Updated
2026-06-03
Github Stars
0.02K

How to Install ComfyUI_SamplingUtils

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

Facilitates decision-making by inverting switch logic for executing alternate paths based on boolean conditions.

Switch (Inverse):

The ComfySwitchInverseNode is a logical node designed to facilitate decision-making processes within a node-based workflow by inverting the typical switch logic. This node is particularly useful when you need to execute one of two possible paths based on a boolean condition, but with the logic inverted. Instead of following the standard "if true, then execute this" logic, the ComfySwitchInverseNode allows you to execute a different path when the condition is false, and vice versa. This inversion can be beneficial in scenarios where the default logic does not align with your workflow requirements, providing greater flexibility and control over the execution flow. The node is marked as experimental, indicating that it may be subject to changes or improvements in future updates.

Switch (Inverse) Input Parameters:

switch

The switch parameter is a boolean input that determines which path the node will take. If the switch is set to true, the node will output the value connected to the on_false input. Conversely, if the switch is set to false, the node will output the value connected to the on_true input. This inversion of logic allows for more complex decision-making processes. The parameter accepts boolean values, with no specific minimum or maximum, and defaults to false if not explicitly set.

on_true

The on_true parameter is an input that accepts a value to be output when the switch is false. This parameter is designed to hold the value or operation that should be executed when the condition is not met, effectively reversing the typical logic flow. The input is lazy, meaning it is only evaluated if needed, which can optimize performance by avoiding unnecessary computations. There are no specific constraints on the type of value this parameter can accept, as it is determined by the context in which the node is used.

on_false

The on_false parameter is an input that accepts a value to be output when the switch is true. This parameter is intended to hold the value or operation that should be executed when the condition is met, again reversing the typical logic flow. Like on_true, this input is lazy and will only be evaluated if required, helping to optimize performance. The type of value this parameter can accept is flexible and context-dependent.

Switch (Inverse) Output Parameters:

output

The output parameter is the result of the node's execution, determined by the state of the switch input. If the switch is true, the node outputs the value connected to the on_false input; if false, it outputs the value connected to the on_true input. This output is crucial for directing the flow of data or operations in a node-based system, allowing for dynamic and conditional execution paths based on the inverted logic provided by the node.

Switch (Inverse) Usage Tips:

  • Use the ComfySwitchInverseNode when you need to reverse the typical logic flow in your workflow, allowing for more flexible decision-making processes.
  • Ensure that at least one of the on_true or on_false inputs is connected to avoid execution errors and ensure the node functions as expected.

Switch (Inverse) 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 inputs are connected, leaving the node without a valid output path.
  • Solution: Connect at least one of the on_true or on_false inputs to ensure the node has a valid output path and can execute correctly.

Switch (Inverse) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_SamplingUtils
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 (Inverse)