ComfyUI  >  Nodes  >  ControlFlowUtils >  💠 Universal Switch

ComfyUI Node: 💠 Universal Switch

Class Name

UniversalSwitch

Category
🐺 VykosX-ControlFlowUtils
Author
VykosX (Account age: 2024 days)
Extension
ControlFlowUtils
Latest Updated
10/1/2024
Github Stars
0.1K

How to Install ControlFlowUtils

Install this extension via the ComfyUI Manager by searching for  ControlFlowUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ControlFlowUtils 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

💠 Universal Switch Description

Versatile data routing tool with SWITCH, PASSTHROUGH, CYCLE, SORT, and REVERSE modes for dynamic workflow management.

💠 Universal Switch:

The UniversalSwitch node is a versatile tool designed to manage and route data dynamically within your workflow. It allows you to control the flow of data through various modes such as SWITCH, PASSTHROUGH, CYCLE, SORT, and REVERSE, making it highly adaptable to different scenarios. This node is particularly useful when you need to conditionally forward data to different parts of your workflow based on specific criteria or when you want to cycle through multiple data inputs. By providing a flexible mechanism to handle multiple inputs and outputs, the UniversalSwitch node helps streamline complex workflows and ensures that data is processed efficiently and effectively.

💠 Universal Switch Input Parameters:

input1

This is the primary input slot for the UniversalSwitch node. It accepts any type of data and is used to forward data through the UniversalSwitch. The data type is flexible, allowing you to connect various types of nodes to this input.

mode

This parameter determines the mode of operation for the UniversalSwitch. The available options are SWITCH, PASSTHROUGH, CYCLE, SORT, and REVERSE. Each mode defines a different way of selecting and forwarding inputs to outputs. For example, SWITCH mode allows you to select a specific input to forward, while CYCLE mode cycles through the inputs sequentially.

selection_in

This parameter specifies which input slot to select from. It accepts an integer value with a default of 1. The minimum value is -1, and the maximum value is determined by the maximum number of slots. A value of 0 means auto-selection, and -1 means all inputs are selected.

selection_out

This parameter specifies which output slot to transmit data to. Similar to selection_in, it accepts an integer value with a default of 1. The minimum value is -1, and the maximum value is determined by the maximum number of slots. A value of 0 means auto-selection, and -1 means all outputs are selected.

validate_typing

This boolean parameter, currently unimplemented, is intended to match input types to their relative outputs. It has a default value of False and is used to ensure type validation between inputs and outputs.

input2, input3, ..., inputN

These are additional optional input slots that can be used to forward data through the UniversalSwitch. Each slot accepts any type of data and is dynamically added based on the maximum number of slots configured.

💠 Universal Switch Output Parameters:

output1, output2, ..., outputN

These are the output slots of the UniversalSwitch node. Each slot corresponds to an input slot and forwards the data based on the selected mode and input/output selection parameters. The outputs are dynamically named and can handle any type of data, making them highly flexible for various workflow requirements.

💠 Universal Switch Usage Tips:

  • Use the SWITCH mode when you need to conditionally forward data from a specific input to a specific output based on certain criteria.
  • Utilize the CYCLE mode to sequentially cycle through multiple inputs, which can be useful for tasks that require iterative processing.
  • The PASSTHROUGH mode is ideal for scenarios where you want to forward data without any modifications or conditions.
  • Experiment with the SORT and REVERSE modes to manage and manipulate the order of data inputs and outputs effectively.

💠 Universal Switch Common Errors and Solutions:

"Invalid input selection"

  • Explanation: This error occurs when the selection_in parameter is set to a value outside the valid range of input slots.
  • Solution: Ensure that the selection_in parameter is set to a value within the range of available input slots, considering the minimum and maximum values.

"Invalid output selection"

  • Explanation: This error occurs when the selection_out parameter is set to a value outside the valid range of output slots.
  • Solution: Ensure that the selection_out parameter is set to a value within the range of available output slots, considering the minimum and maximum values.

"Type validation failed"

  • Explanation: This error occurs when the validate_typing parameter is enabled, and there is a mismatch between input and output types.
  • Solution: Disable the validate_typing parameter or ensure that the input and output types match correctly.

"Mode not supported"

  • Explanation: This error occurs when an unsupported mode is selected for the UniversalSwitch.
  • Solution: Ensure that the mode parameter is set to one of the supported modes: SWITCH, PASSTHROUGH, CYCLE, SORT, or REVERSE.

💠 Universal Switch Related Nodes

Go back to the extension to check out more related nodes.
ControlFlowUtils
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.