Visit ComfyUI Online for ready-to-use ComfyUI environment
Streamline text manipulation by replacing terms with a predefined dictionary for dynamic content generation and customization.
The Text Find and Replace by Dictionary node is designed to streamline the process of text manipulation by allowing you to replace specific terms within a text using a predefined dictionary. This node is particularly useful for tasks that require dynamic text generation or modification, such as creating varied prompts or scripts. By leveraging a dictionary of terms and their possible replacements, this node can introduce variability and customization into your text, making it a powerful tool for AI artists looking to enhance their creative outputs. The node ensures that each term in the text is replaced with a randomly selected alternative from the dictionary, providing a unique and tailored result each time it is executed.
This parameter represents the input text that you want to process. It is the main body of text where the search and replace operations will be performed. The text should be of type STRING
, and it is a required input for the node to function.
The dictionary parameter is a collection of terms and their corresponding replacement options. It is of type DICT
and is essential for the node to know which terms to look for and what their possible replacements are. Each key in the dictionary represents a term to be replaced, and the value is a list of possible replacements.
This parameter specifies the delimiter used to identify the terms in the text that need to be replaced. The default value is __
, meaning that terms in the text should be enclosed within double underscores (e.g., __term__
). This helps the node to accurately locate the terms that need to be replaced.
The seed parameter is an integer that initializes the random number generator used to select replacements from the dictionary. It ensures reproducibility of results. The default value is 0
, and it can range from 0
to 0xffffffffffffffff
. If the seed is set to a non-zero value, it will increment with each replacement to ensure variability.
The output text is the modified version of the input text, where all specified terms have been replaced according to the dictionary. This output maintains the same structure as the input text but with the specified terms substituted by their randomly chosen replacements.
replacement_key
delimiters to avoid any missed replacements.replacement_key
delimiters in the input text does not exist in the dictionary.© Copyright 2024 RunComfy. All Rights Reserved.