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_seedfor 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_falsenoron_trueinputs are connected, which is required for the node to function correctly. - Solution: Ensure that at least one of the
on_falseoron_trueinputs is connected to provide a valid input for the node to process.
"Invalid selected_index value"
- Explanation: This error arises when the
selected_indexis set to a value outside the range of available inputs. - Solution: Adjust the
selected_indexto a valid number within the range of 1 to the currentnumber_of_inputsto ensure proper input selection.
