Visit ComfyUI Online for ready-to-use ComfyUI environment
Truncate text strings to specified length with flexibility in truncation options for various text processing tasks.
The Text String Truncate node is designed to help you manage and manipulate text by truncating it to a specified length. This node is particularly useful when you need to shorten text strings for various applications, such as fitting text into a limited space or ensuring consistency in text length. It offers flexibility by allowing you to truncate text either from the beginning or the end and by characters or words. This functionality ensures that you can tailor the truncation process to meet your specific needs, making it a versatile tool for text processing tasks.
This parameter represents the main text string that you want to truncate. It is a required input and must be provided for the node to function. The text can be any string that you need to shorten.
This parameter determines whether the truncation should be based on characters or words. You can choose between characters
and words
. Selecting characters
will truncate the text by the specified number of characters, while selecting words
will truncate the text by the specified number of words.
This parameter specifies the direction from which the text should be truncated. You can choose between end
and beginning
. Selecting end
will truncate the text from the end, while selecting beginning
will truncate the text from the beginning.
This parameter defines the maximum length to which the text should be truncated. It accepts an integer value, with a default of 10. The value can range from -99999999 to 99999999, allowing for both positive and negative truncation lengths.
This is an optional parameter that allows you to provide a second text string for truncation. If provided, this text will also be truncated according to the same settings as the main text.
This is an optional parameter that allows you to provide a third text string for truncation. If provided, this text will also be truncated according to the same settings as the main text.
This is an optional parameter that allows you to provide a fourth text string for truncation. If provided, this text will also be truncated according to the same settings as the main text.
The primary output is the truncated version of the main text string. This output reflects the text after it has been shortened according to the specified parameters.
If the optional text_b
parameter was provided, this output will be the truncated version of the second text string.
If the optional text_c
parameter was provided, this output will be the truncated version of the third text string.
If the optional text_d
parameter was provided, this output will be the truncated version of the fourth text string.
truncate_by
parameter to switch between character-based and word-based truncation depending on your specific needs.truncate_from
parameter.truncate_from
parameter is set to either beginning
or end
.truncate_by
parameter.truncate_by
parameter is set to either characters
or words
.© Copyright 2024 RunComfy. All Rights Reserved.