Text Switch:
The Sage_TextSwitch node is designed to control the flow of text data based on a simple boolean condition. Its primary function is to either pass a given text string through or replace it with an empty string, depending on whether a specified condition is met. This node is particularly useful in scenarios where you need to dynamically include or exclude text content based on certain criteria, such as user input or other logical conditions. By providing a straightforward mechanism to toggle text output, Sage_TextSwitch enhances the flexibility and adaptability of text processing workflows, allowing you to create more dynamic and responsive AI art projects.
Text Switch Input Parameters:
str
This parameter represents the text string that you want to conditionally pass through the node. It is a required input and can be multiline, allowing you to input complex or lengthy text data. The content of this parameter will be passed to the output if the active parameter is set to true. There are no specific minimum or maximum values for this parameter, as it is a free-form text input.
active
The active parameter is a boolean input that determines whether the text string provided in the str parameter should be passed through to the output. If active is set to true, the text is passed as is; if false, an empty string is output instead. This parameter defaults to true, meaning that unless specified otherwise, the text will be passed through. This parameter is crucial for controlling the node's behavior and can be used to toggle the inclusion of text based on external conditions or logic.
Text Switch Output Parameters:
str_out
The str_out parameter is the output of the Sage_TextSwitch node. It provides the resulting text string based on the evaluation of the active parameter. If active is true, str_out will contain the text from the str input; if false, it will be an empty string. This output is essential for downstream nodes or processes that rely on the presence or absence of text data, allowing for conditional text processing and dynamic content generation.
Text Switch Usage Tips:
- Use the
activeparameter to control the flow of text dynamically, enabling or disabling text output based on user interactions or other logical conditions in your workflow. - Combine Sage_TextSwitch with other nodes that manipulate or analyze text to create complex conditional logic, enhancing the interactivity and responsiveness of your AI art projects.
Text Switch Common Errors and Solutions:
Missing str Input
- Explanation: The node requires a text input for the
strparameter, but none was provided. - Solution: Ensure that you supply a valid text string to the
strinput parameter. This can be done by connecting a text-generating node or manually entering text.
Invalid active Value
- Explanation: The
activeparameter expects a boolean value, but an invalid type was provided. - Solution: Check that the
activeparameter is set to either true or false. If using a dynamic input, ensure it resolves to a boolean value.
