ComfyUI > Nodes > ComfyUI-YCNodes > Text Index Switch (YC)

ComfyUI Node: Text Index Switch (YC)

Class Name

YC Text Index Switch

Category
YCNode/Logic
Author
yichengup (Account age: 473days)
Extension
ComfyUI-YCNodes
Latest Updated
2025-06-03
Github Stars
0.02K

How to Install ComfyUI-YCNodes

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

Text Index Switch (YC) Description

Dynamically select text based on index value for efficient text management in creative workflows.

Text Index Switch (YC):

The YC Text Index Switch node is designed to dynamically select and output a specific text string from a set of predefined text inputs based on an index value. This node is particularly useful in scenarios where you need to manage multiple text options and choose one based on a given condition or index. By allowing you to specify an index, the node efficiently retrieves the corresponding text input, making it a versatile tool for text management in creative workflows. Its primary goal is to streamline the process of selecting text inputs, thereby enhancing the flexibility and efficiency of your text-based operations.

Text Index Switch (YC) Input Parameters:

index

The index parameter is an integer that determines which text input will be selected and output by the node. It is crucial for directing the node to the correct text input among the available options. The parameter accepts values starting from 0 up to a maximum defined by `MAX_FLOW_NUM

  • 1`, with a default value of 0. This means you can select from a range of text inputs, and the node will output the text corresponding to the specified index. Adjusting this parameter allows you to dynamically switch between different text inputs based on your needs.

text0, text1, ..., textN

These parameters represent the optional text inputs that the node can choose from. Each text input is a string that can be connected to the node, and the node will output the text corresponding to the index specified. The number of text inputs available is determined by MAX_FLOW_NUM, and each input must be explicitly connected to be considered by the node. If a text input is not connected, the node will return an empty string for that index. This setup allows for a flexible configuration where you can provide multiple text options and dynamically select one based on the index.

Text Index Switch (YC) Output Parameters:

text

The text output parameter is the string that is selected and output by the node based on the specified index. It represents the text input corresponding to the index value provided. If the index points to a text input that is not connected, the node will output an empty string. This output is essential for passing the selected text to subsequent nodes or processes in your workflow, enabling dynamic text management and selection.

Text Index Switch (YC) Usage Tips:

  • Ensure that all potential text inputs are connected to the node to avoid unexpected empty outputs when switching indices.
  • Use the index parameter to dynamically change the selected text based on conditions or external inputs, allowing for flexible text management in your projects.

Text Index Switch (YC) Common Errors and Solutions:

Index out of range

  • Explanation: This error occurs when the specified index exceeds the number of available text inputs.
  • Solution: Ensure that the index value is within the range of connected text inputs, from 0 to MAX_FLOW_NUM - 1.

Unconnected text input

  • Explanation: This error happens when the index points to a text input that is not connected, resulting in an empty string output.
  • Solution: Verify that all text inputs corresponding to potential index values are properly connected to the node.

Text Index Switch (YC) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-YCNodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.