ComfyUI > Nodes > ComfyUI > Replace Text

ComfyUI Node: Replace Text

Class Name

ReplaceText

Category
dataset/text
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

Install this extension via the ComfyUI Manager by searching for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Replace Text Description

Streamline text modification by replacing substrings with ease, automating find-and-replace tasks for efficiency and accuracy.

Replace Text:

The ReplaceText node is designed to streamline the process of modifying text by replacing specified substrings within a given text. This node is particularly useful for tasks that require consistent text alterations, such as correcting repeated errors, updating terminology, or customizing text outputs. By automating the find-and-replace function, it saves time and reduces the potential for human error, ensuring that text modifications are applied uniformly across all instances. This node is essential for anyone looking to efficiently manage and manipulate text data, providing a straightforward method to substitute text elements with ease.

Replace Text Input Parameters:

find

The find parameter specifies the exact text string that you want to locate within the input text. This parameter is crucial as it determines which parts of the text will be targeted for replacement. There are no minimum or maximum values for this parameter, but it defaults to an empty string if not specified. The effectiveness of the ReplaceText node heavily relies on accurately defining this parameter, as it directly influences which text segments are identified for substitution.

replace

The replace parameter defines the text string that will replace the occurrences of the find parameter within the input text. This parameter allows you to specify what the identified text should be changed to, enabling customization and correction of text data. Like the find parameter, it defaults to an empty string if not specified, and there are no inherent restrictions on its length or content. The replace parameter is essential for achieving the desired text transformation, as it dictates the new content that will appear in place of the original text.

Replace Text Output Parameters:

text

The output parameter text represents the modified version of the input text after the specified replacements have been applied. This output is crucial as it reflects the final result of the text transformation process, showcasing the changes made by substituting the find parameter with the replace parameter. The output text is a direct representation of the node's functionality, providing users with the updated text that incorporates all specified modifications.

Replace Text Usage Tips:

  • Ensure that the find parameter accurately matches the text you intend to replace to avoid unintended modifications.
  • Use the ReplaceText node in conjunction with other text processing nodes to create complex text manipulation workflows.

Replace Text Common Errors and Solutions:

Text not found for replacement

  • Explanation: The specified find text does not exist in the input text, resulting in no changes being made.
  • Solution: Double-check the find parameter to ensure it matches the text you intend to replace, considering case sensitivity and exact spelling.

Unintended replacements

  • Explanation: The find parameter is too broad or generic, causing more text to be replaced than intended.
  • Solution: Refine the find parameter to be more specific, ensuring it targets only the desired text segments for replacement.

Replace Text Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Replace Text