ComfyUI > Nodes > ComfyUI Easy Use > Text Switch

ComfyUI Node: Text Switch

Class Name

easy textSwitch

Category
EasyUse/Logic/Switch
Author
yolain (Account age: 1341days)
Extension
ComfyUI Easy Use
Latest Updated
2024-06-25
Github Stars
0.51K

How to Install ComfyUI Easy Use

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

Text Switch Description

Facilitates dynamic text selection based on conditions for AI art projects, enhancing flexibility and control.

Text Switch:

The easy textSwitch node is designed to facilitate the dynamic selection between two text inputs based on a specified condition. This node is particularly useful when you need to switch between different text strings in your AI art projects, depending on certain criteria or conditions. By providing a simple yet effective mechanism to toggle between two text options, the easy textSwitch node enhances the flexibility and control you have over your text-based inputs, allowing for more dynamic and responsive workflows. This can be especially beneficial in scenarios where the text content needs to adapt based on user input or other variables, ensuring that your creative process remains fluid and adaptable.

Text Switch Input Parameters:

input

This parameter determines which text input will be selected. It accepts an integer value with a minimum of 1 and a maximum of 2. The default value is 1. When set to 1, the node will output the text provided in text1; when set to 2, it will output the text provided in text2. This parameter is crucial for controlling the switch mechanism and deciding which text string to use based on your specific needs.

text1

This is the first text input option. It accepts a string value and is required if input is set to 1. This parameter allows you to specify the first text string that can be selected by the switch. It is important to ensure that this text is provided if you intend to use it as one of the selectable options.

text2

This is the second text input option. It accepts a string value and is required if input is set to 2. This parameter allows you to specify the second text string that can be selected by the switch. Similar to text1, it is important to provide this text if you intend to use it as one of the selectable options.

Text Switch Output Parameters:

STRING

The output of the easy textSwitch node is a single string value. This output will be either the text from text1 or text2, depending on the value of the input parameter. The selected text string is then available for use in subsequent nodes or processes, allowing for dynamic text manipulation based on the specified condition.

Text Switch Usage Tips:

  • Ensure that both text1 and text2 are provided if you plan to switch between them, as missing text inputs can lead to unexpected results.
  • Use the input parameter to dynamically control which text string is selected, allowing for flexible and responsive text-based workflows.
  • Consider using this node in conjunction with other logic nodes to create more complex conditional text selection mechanisms.

Text Switch Common Errors and Solutions:

Missing text input

  • Explanation: One of the required text inputs (text1 or text2) is not provided.
  • Solution: Ensure that both text1 and text2 are specified if you intend to switch between them. Check your node configuration to confirm that all necessary inputs are included.

Invalid input value

  • Explanation: The input parameter is set to a value outside the allowed range (1 or 2).
  • Solution: Adjust the input parameter to be either 1 or 2, as these are the only valid values for this parameter. Verify that the value is correctly set in your node configuration.

Text Switch Related Nodes

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