ComfyUI > Nodes > ComfyUI-YCNodes_Toolkit > YCSwitch(any)

ComfyUI Node: YCSwitch(any)

Class Name

YCSwitch

Category
YCNode/Logic
Author
yichengup (Account age: 774days)
Extension
ComfyUI-YCNodes_Toolkit
Latest Updated
2026-03-23
Github Stars
0.05K

How to Install ComfyUI-YCNodes_Toolkit

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

YCSwitch(any) Description

YCSwitch dynamically selects and outputs one input from multiple options based on an index.

YCSwitch(any):

YCSwitch is a versatile node designed to dynamically select and output one of several input values based on a specified index. This node is particularly useful in scenarios where you need to switch between different data streams or configurations during execution. By allowing you to choose which input to output, YCSwitch provides flexibility and control over the data flow within your AI art projects. It supports dynamic input management, meaning you can add or remove inputs as needed, making it adaptable to various use cases. The node is designed to work seamlessly with ComfyUI, ensuring compatibility and ease of use for artists who want to integrate complex logic into their workflows without delving into technical complexities.

YCSwitch(any) Input Parameters:

select

The select parameter is an integer that determines which input value will be output by the YCSwitch node. It allows you to specify the index of the input you wish to select, with a default value of 1. The parameter accepts values ranging from 1 to 999999, providing a wide range of options for selecting inputs. This parameter is crucial for directing the node to output the desired input, and its value directly impacts the node's execution by determining which input is passed through.

sel_mode

The sel_mode parameter is a boolean that controls the selection mode of the YCSwitch node. It has two options: select_on_execution and select_on_prompt. The default setting is select_on_execution, which dynamically selects the input during execution. The select_on_prompt option is compatible with older versions of ComfyUI and allows you to determine the input selection before execution. This parameter provides flexibility in how and when the input selection is made, catering to different workflow requirements.

YCSwitch(any) Output Parameters:

selected_value

The selected_value output parameter provides the content of the input specified by the select parameter. It outputs the actual data or value from the chosen input, allowing you to use it in subsequent nodes or processes. This output is essential for accessing the desired input data based on your selection criteria.

selected_label

The selected_label output parameter returns the label of the selected input slot. This label helps identify the chosen input, providing context and clarity about which input was selected. It is particularly useful for debugging or when you need to verify the input selection.

selected_index

The selected_index output parameter outputs the index of the selected input, which corresponds to the value specified in the select parameter. This output confirms the index used for selection, ensuring that the correct input was chosen and providing a reference for further processing.

YCSwitch(any) Usage Tips:

  • Use the select parameter to dynamically switch between different inputs during execution, allowing for flexible data flow management in your projects.
  • Leverage the sel_mode parameter to choose between dynamic selection during execution or pre-selection before execution, depending on your workflow needs.
  • Ensure that the select parameter is set within the valid range to avoid errors and ensure the correct input is selected.

YCSwitch(any) Common Errors and Solutions:

Invalid select index

  • Explanation: This error occurs when the select parameter is set to an index that does not correspond to any available input.
  • Solution: Verify that the select parameter is within the valid range and corresponds to an existing input. Adjust the index as necessary to match the available inputs.

Missing input label

  • Explanation: This error may arise if the node is unable to retrieve the label for the selected input slot.
  • Solution: Ensure that all input slots have labels assigned. If operating in API mode, be aware that label retrieval may not be guaranteed, and consider alternative methods for identifying inputs.

YCSwitch(any) Related Nodes

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

YCSwitch(any)