ComfyUI  >  Nodes  >  Comfyroll Studio >  ⚙️ CR Set Switch From String

ComfyUI Node: ⚙️ CR Set Switch From String

Class Name

CR Set Switch From String

Category
🧩 Comfyroll Studio/🛠️ Utils/🔀 Conditional
Author
Suzie1 (Account age: 2158 days)
Extension
Comfyroll Studio
Latest Updated
6/5/2024
Github Stars
0.5K

How to Install Comfyroll Studio

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

⚙️ CR Set Switch From String Description

Facilitates conditional logic based on string inputs for AI art workflows, enabling dynamic workflow alterations.

⚙️ CR Set Switch From String:

The CR Set Switch From String node is designed to facilitate conditional logic based on string inputs within your AI art workflows. This node allows you to compare a given text string against up to four predefined switch strings and returns an integer value corresponding to the matched switch. This functionality is particularly useful for dynamically altering the flow of your workflow based on textual conditions, enabling more complex and responsive AI art generation processes. By leveraging this node, you can create more adaptable and intelligent workflows that respond to specific string inputs, enhancing the overall flexibility and control of your AI art projects.

⚙️ CR Set Switch From String Input Parameters:

text

This is the primary input string that will be compared against the predefined switch strings. It is a required parameter and must be provided for the node to function. The comparison is case-sensitive, and the text should be a single-line string. There is no default value for this parameter, and it must be explicitly set.

switch_1

This is an optional string parameter that represents the first switch condition. If the text input matches this string, the node will return a switch value of 1. The default value is an empty string.

switch_2

This is an optional string parameter that represents the second switch condition. If the text input matches this string, the node will return a switch value of 2. The default value is an empty string.

switch_3

This is an optional string parameter that represents the third switch condition. If the text input matches this string, the node will return a switch value of 3. The default value is an empty string.

switch_4

This is an optional string parameter that represents the fourth switch condition. If the text input matches this string, the node will return a switch value of 4. The default value is an empty string.

⚙️ CR Set Switch From String Output Parameters:

switch

This output parameter is an integer that indicates which switch condition was met by the text input. The value ranges from 1 to 4, corresponding to switch_1 to switch_4. If no match is found, the output will be undefined.

show_help

This output parameter is a string containing a URL to the help documentation for this node. It provides additional information and usage examples to assist you in effectively utilizing the node.

⚙️ CR Set Switch From String Usage Tips:

  • Ensure that the text input is exactly matched with one of the switch strings, as the comparison is case-sensitive.
  • Use this node to create conditional branches in your workflow, allowing for more dynamic and responsive AI art generation.
  • Utilize the show_help URL to access detailed documentation and examples to better understand the node's capabilities and potential applications.

⚙️ CR Set Switch From String Common Errors and Solutions:

No match found for the input text

  • Explanation: The text input did not match any of the provided switch strings.
  • Solution: Verify that the text input exactly matches one of the switch strings, considering case sensitivity and any leading or trailing spaces.

Missing required input: text

  • Explanation: The text input parameter was not provided, which is necessary for the node to function.
  • Solution: Ensure that the text input parameter is set and contains a valid string.

Invalid switch value returned

  • Explanation: The node returned an undefined switch value because none of the switch strings matched the text input.
  • Solution: Double-check the switch strings and the text input for any discrepancies or typos. Ensure that at least one switch string is correctly set to match the text input.

⚙️ CR Set Switch From String Related Nodes

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