ComfyUI  >  Nodes  >  ComfyUI-Ollama-Describer >  📝 Text Transformer 📝

ComfyUI Node: 📝 Text Transformer 📝

Class Name

TextTransformer

Category
Ollama
Author
alisson-anjos (Account age: 616 days)
Extension
ComfyUI-Ollama-Describer
Latest Updated
6/29/2024
Github Stars
0.0K

How to Install ComfyUI-Ollama-Describer

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

Manipulate and transform text with prepend, append, and replace functions using TextTransformer node for AI artists.

📝 Text Transformer 📝:

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.

📝 Text Transformer 📝 Input Parameters:

text

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.

prepend_text

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.

append_text

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.

replace_find_mode

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.

replace_find

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.

replace_with

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.

📝 Text Transformer 📝 Output Parameters:

transformed_text

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.

📝 Text Transformer 📝 Usage Tips:

  • Use the prepend_text and append_text parameters to easily add consistent prefixes or suffixes to your text, which can be useful for formatting or tagging.
  • When using the replace_find_mode set to "regular expression (regex)," ensure your regex patterns are correctly formatted to avoid errors.
  • Test your text transformations with simple examples to ensure that the parameters are set correctly before applying them to larger or more complex texts.

📝 Text Transformer 📝 Common Errors and Solutions:

Error: Invalid regular expression '<pattern>'. Details: <error_details>

  • Explanation: This error occurs when the replace_find parameter contains an invalid regex pattern.
  • Solution: Double-check the regex pattern for syntax errors and ensure it is correctly formatted. Use online regex testers to validate your pattern before using it in the node.

No text provided for transformation

  • Explanation: This error occurs when the text parameter is empty or not provided.
  • Solution: Ensure that the text parameter contains the main text you want to transform. This is the base text required for any transformations to take place.

📝 Text Transformer 📝 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Ollama-Describer
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.