Visit ComfyUI Online for ready-to-use ComfyUI environment
Manipulate and transform text with prepend, append, and replace functions using TextTransformer node for AI artists.
The TextTransformer
node is designed to manipulate and transform text based on various input parameters. It allows you to prepend and append text, as well as replace specific text patterns using either normal string replacement or regular expressions. This node is particularly useful for AI artists who need to format or modify text data dynamically, ensuring that the text fits specific requirements or formats. By leveraging this node, you can automate text transformations, making your workflow more efficient and consistent.
This is the main text that you want to transform. It serves as the base text to which other transformations will be applied. The text is first unescaped to handle any special characters properly.
This parameter allows you to add text at the beginning of the main text. If provided, the specified text will be prepended to the main text after unescaping. This is useful for adding prefixes or introductory phrases.
This parameter allows you to add text at the end of the main text. If provided, the specified text will be appended to the main text after unescaping. This is useful for adding suffixes or concluding phrases.
This parameter determines the mode of text replacement. It can be set to either "normal" for standard string replacement or "regular expression (regex)" for pattern-based replacement. The choice of mode affects how the replace_find
and replace_with
parameters are used.
This is the text or pattern that you want to find and replace in the main text. If replace_find_mode
is set to "normal," this should be a simple string. If set to "regular expression (regex)," this should be a valid regex pattern.
This is the text that will replace the replace_find
text or pattern in the main text. It can be a simple string or a replacement pattern, depending on the replace_find_mode
.
The output is a tuple containing the transformed text. This text reflects all the modifications specified by the input parameters, including any prepended or appended text and any replacements made.
prepend_text
and append_text
parameters to easily add consistent prefixes or suffixes to your text, which can be useful for formatting or tagging.replace_find_mode
set to "regular expression (regex)," ensure your regex patterns are correctly formatted to avoid errors.<pattern>
'. Details: <error_details>
replace_find
parameter contains an invalid regex pattern.text
parameter is empty or not provided.text
parameter contains the main text you want to transform. This is the base text required for any transformations to take place.© Copyright 2024 RunComfy. All Rights Reserved.