ComfyUI Node: EZ Switch

Class Name

EZ_Switch

Category
EZ NODES
Author
ez-af (Account age: 599days)
Extension
ComfyUI-EZ-AF-Nodes
Latest Updated
2025-09-23
Github Stars
0.03K

How to Install ComfyUI-EZ-AF-Nodes

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

EZ Switch Description

EZ_Switch dynamically selects inputs based on criteria, enhancing workflow efficiency for AI artists.

EZ Switch:

The EZ_Switch node is a versatile tool designed to dynamically select and switch between multiple inputs based on user-defined criteria. It allows you to choose from a variety of selection modes, such as selecting by index, randomly, or automatically, to determine which input is passed through to the output. This node is particularly beneficial for scenarios where you need to manage multiple data streams or options and want to automate the decision-making process. By providing a flexible and automated way to handle input selection, EZ_Switch enhances workflow efficiency and adaptability, making it an essential component for AI artists looking to streamline their creative processes.

EZ Switch Input Parameters:

number_of_inputs

This parameter specifies the total number of inputs available for selection. It allows you to dynamically adjust the number of inputs, with a minimum of 2 and a maximum of 50. The default value is set to 2. Changing this value affects only the last of the current inputs, enabling you to scale the node's capacity according to your needs.

selected_index

The selected_index parameter determines which input is passed to the output when the selection mode is set to "by index." It ranges from 1 to 50, with a default value of 1. This parameter is crucial for precise control over input selection, allowing you to specify exactly which input should be active.

selection_mode

This parameter defines the method used to select the input. It offers three options: "by index," "by random," and "automatic." The default mode is "by index." In "by index" mode, the input specified by selected_index is chosen. "By random" mode selects an input randomly each time, while "automatic" mode outputs the first input that is not None. This flexibility allows you to tailor the node's behavior to suit different scenarios.

opt_seed

The opt_seed parameter is used exclusively in "by random" selection mode to control the randomness of input selection. It accepts integer values from 0 to 0xffffffffffffffff, with a default of 0. When connected, it ensures consistent random selections across executions, while an unconnected state causes the node to re-execute on each prompt, providing varied results.

EZ Switch Output Parameters:

any

The output parameter, labeled as any, represents the unprocessed value of the selected input. This output is crucial as it carries forward the chosen input data, allowing subsequent nodes to utilize it in the workflow. The flexibility of this output type ensures compatibility with a wide range of data types, making it a powerful component in dynamic data processing.

EZ Switch Usage Tips:

  • Use the "by index" mode for precise control when you know exactly which input you want to select, ensuring consistent output.
  • Leverage the "by random" mode with a specified opt_seed for controlled randomness, which is useful for generating varied outputs while maintaining reproducibility.

EZ 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_false nor on_true inputs are connected, which is required for the node to function correctly.
  • Solution: Ensure that at least one of the on_false or on_true inputs is connected to provide a valid input for the node to process.

"Invalid selected_index value"

  • Explanation: This error arises when the selected_index is set to a value outside the range of available inputs.
  • Solution: Adjust the selected_index to a valid number within the range of 1 to the current number_of_inputs to ensure proper input selection.

EZ Switch Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-EZ-AF-Nodes
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.

EZ Switch