TK 字符串路由器:
The TK String Router is a versatile node designed to manage and manipulate multiple string inputs, allowing you to route up to six strings into a single cohesive output. This node is particularly useful for AI artists who need to dynamically control and organize text data within their workflows. By offering both single and multi-selection modes, the TK String Router provides flexibility in how strings are combined, enabling you to customize the output order and selectively enable or disable specific inputs. This functionality is enhanced by the ability to choose from various separators, such as commas, spaces, or line breaks, to format the final output string according to your needs. The node's intuitive design ensures that even those without a technical background can easily configure and utilize its features to streamline text processing tasks.
TK 字符串路由器 Input Parameters:
separator
The separator parameter allows you to define how the selected strings will be joined together in the output. You can choose from options like "逗号 ," (comma), "空格" (space), "换行" (newline), and "无" (none), with the default being "逗号 ,". This parameter impacts the readability and formatting of the final output string, making it crucial for ensuring the text meets your specific presentation requirements.
string_1
This parameter represents the first string input. It is optional and can be left empty if not needed. The string_1 input, like the other string inputs, can be multiline and is forced to be an input, ensuring flexibility in the type of text data you can provide.
string_2
Similar to string_1, this parameter is the second string input. It is optional and can be left empty if not needed. It allows for multiline text and is designed to be a flexible input for various text data.
string_3
This parameter serves as the third string input. It is optional and can be left empty if not needed. Like the other string inputs, it supports multiline text and is a flexible input option.
string_4
The string_4 parameter is the fourth string input. It is optional and can be left empty if not needed. It supports multiline text, providing flexibility in the type of text data you can input.
string_5
This parameter is the fifth string input. It is optional and can be left empty if not needed. It supports multiline text, allowing for a wide range of text data to be input.
string_6
The string_6 parameter is the sixth and final string input. It is optional and can be left empty if not needed. Like the other string inputs, it supports multiline text, offering flexibility in the type of text data you can provide.
router_settings
The router_settings parameter is a hidden input that allows you to configure the node's behavior. It is a JSON string that defines settings such as the mode (single or multi-selection), which inputs are enabled, the selected input for single mode, and the order of inputs for multi-selection. This parameter is crucial for customizing how the node processes and outputs the string data.
TK 字符串路由器 Output Parameters:
text
The text output parameter is the final string result after processing the inputs according to the specified settings. It represents the concatenated and formatted string based on the enabled inputs and chosen separator. This output is essential for integrating the processed text into subsequent nodes or workflows, providing a streamlined and organized text output.
TK 字符串路由器 Usage Tips:
- To ensure the desired strings are included in the output, make sure they are enabled in the
router_settingsand properly configured in the order you want them to appear. - Experiment with different
separatoroptions to achieve the best formatting for your output text, especially when preparing text for specific presentation or data processing needs.
TK 字符串路由器 Common Errors and Solutions:
Invalid JSON in router_settings
- Explanation: This error occurs when the JSON string provided in the
router_settingsparameter is malformed or contains syntax errors. - Solution: Double-check the JSON syntax in the
router_settingsparameter, ensuring all brackets, commas, and colons are correctly placed and that the string is properly formatted.
Missing or Empty String Inputs
- Explanation: If expected string inputs are missing or empty, the output may not include all desired text components.
- Solution: Verify that all necessary string inputs are provided and not left empty, especially those that are enabled in the
router_settings.
