ComfyUI  >  Nodes  >  WAS Node Suite >  Text Concatenate

ComfyUI Node: Text Concatenate

Class Name

Text Concatenate

Category
WAS Suite/Text
Author
WASasquatch (Account age: 4688 days)
Extension
WAS Node Suite
Latest Updated
8/25/2024
Github Stars
1.1K

How to Install WAS Node Suite

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

Merge multiple text inputs with specified delimiter, clean up whitespace for neat output.

Text Concatenate:

The Text Concatenate node is designed to merge multiple text inputs into a single cohesive string. This node is particularly useful when you need to combine various pieces of text data, such as prompts, descriptions, or any other textual content, into one unified output. By specifying a delimiter, you can control how the individual text segments are joined together, whether it's with a space, comma, newline, or any other character. Additionally, the node offers an option to clean up whitespace from the inputs, ensuring that the final concatenated text is neat and free from unnecessary spaces. This functionality is essential for creating well-structured and readable text outputs, making it a valuable tool for AI artists who need to manage and manipulate text data efficiently.

Text Concatenate Input Parameters:

delimiter

The delimiter parameter specifies the character or string that will be used to separate each text input when they are concatenated. For example, if you set the delimiter to a comma, each piece of text will be joined with a comma in between. Special handling is provided for newline characters, where both \n and \\n will be interpreted as actual newlines. This parameter allows you to customize the format of the final output string to suit your needs.

clean_whitespace

The clean_whitespace parameter determines whether leading and trailing whitespace should be removed from each text input before concatenation. When set to "true", any extra spaces at the beginning or end of each input will be stripped away, resulting in a cleaner and more polished final output. This is particularly useful when dealing with text inputs that may have inconsistent spacing, ensuring that the concatenated result is tidy and professional.

kwargs

The kwargs parameter represents a collection of additional text inputs that will be concatenated. These inputs are processed in sorted order based on their keys. Each input should be a string, and only non-empty strings will be included in the final concatenated output. This flexible parameter allows you to pass multiple text inputs dynamically, making the node adaptable to various use cases.

Text Concatenate Output Parameters:

merged_text

The merged_text output parameter is the final concatenated string that results from combining all the provided text inputs using the specified delimiter. This output will always be generated, even if the input texts are empty, ensuring that you have a consistent output to work with. The merged_text is the primary result of the node's operation, providing a single, unified text string that can be used in subsequent processes or outputs.

Text Concatenate Usage Tips:

  • Use a comma or space as the delimiter to create a list-like concatenation of text inputs.
  • Enable the clean_whitespace option to ensure that the final output is free from unnecessary spaces, making it more readable and professional.
  • Pass multiple text inputs through kwargs to dynamically concatenate varying numbers of text segments, allowing for flexible and adaptable text processing.

Text Concatenate Common Errors and Solutions:

No text inputs provided

  • Explanation: This error occurs when no text inputs are passed to the node.
  • Solution: Ensure that you provide at least one non-empty text input through the kwargs parameter.

Invalid delimiter

  • Explanation: This error occurs when the delimiter is not a valid string or character.
  • Solution: Verify that the delimiter is a valid string or character, and avoid using unsupported or special characters that may cause issues.

Whitespace cleanup not working

  • Explanation: This error occurs when the clean_whitespace option is not functioning as expected.
  • Solution: Ensure that the clean_whitespace parameter is set to "true" and that the text inputs contain leading or trailing whitespace that can be cleaned.

Text Concatenate Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
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.