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 V2

Class Name

ComfySwitchNodeV2

Category
utilities/logic
Author
FX-FeiHou (Account age: 2109days)
Extension
ComfyUI-FeiHou-Toolbox
Latest Updated
2026-08-25
Github Stars
0.13K

How to Install ComfyUI-FeiHou-Toolbox

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

Streamline decision-making in node-based workflows with a conditional switch for directing data flow based on boolean conditions.

Switch V2:

ComfySwitchNodeV2 is a versatile logic node designed to streamline decision-making processes within your node-based workflows. This node acts as a conditional switch, allowing you to direct the flow of data based on a boolean condition. Its primary advantage is that it only requires the branch corresponding to the selected condition to be connected, which simplifies the setup and reduces unnecessary computations. This feature makes it particularly useful in scenarios where you want to execute different operations based on dynamic conditions, enhancing the efficiency and flexibility of your workflow. By leveraging ComfySwitchNodeV2, you can create more responsive and adaptable systems that react intelligently to varying inputs.

Switch V2 Input Parameters:

switch

The switch parameter is a boolean input that determines which branch of the node will be executed. If the value is true, the node will execute the on_true branch; if false, it will execute the on_false branch. This parameter is crucial as it controls the flow of data and dictates which set of operations will be performed. There are no specific minimum or maximum values since it is a boolean, but it defaults to either true or false based on the logic you implement.

on_false

The on_false parameter is an optional input that represents the operations or data to be used when the switch is set to false. It is designed to be lazy, meaning it will only be evaluated if the switch condition is false. This input allows you to define a specific path or set of actions that should occur when the condition is not met, providing a clear alternative to the on_true path.

on_true

The on_true parameter is an optional input that represents the operations or data to be used when the switch is set to true. Similar to on_false, it is also lazy and will only be evaluated if the switch condition is true. This input is essential for defining the primary path or actions that should be executed when the condition is satisfied, ensuring that the desired operations are performed under the specified circumstances.

Switch V2 Output Parameters:

output

The output parameter is the result of the node's execution, determined by the switch condition. It outputs the data or result from either the on_true or on_false branch, depending on the boolean value of the switch. This output is crucial as it represents the final outcome of the conditional logic applied by the node, allowing subsequent nodes in the workflow to utilize the processed data accordingly.

Switch V2 Usage Tips:

  • Ensure that at least one of the on_true or on_false inputs is connected to avoid execution errors. This will help maintain a smooth workflow and prevent interruptions.
  • Use the switch parameter to dynamically control the flow of your workflow based on real-time conditions or inputs, enhancing the adaptability of your system.

Switch V2 Common Errors and Solutions:

请在true接口接上相关节点。

  • Explanation: This error occurs when the switch is set to true, but no node is connected to the on_true input.
  • Solution: Connect a valid node or data source to the on_true input to ensure the node can execute the desired operations when the condition is true.

请在false接口接上相关节点。

  • Explanation: This error occurs when the switch is set to false, but no node is connected to the on_false input.
  • Solution: Connect a valid node or data source to the on_false input to ensure the node can execute the desired operations when the condition is false.

Switch V2 Related Nodes

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