Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates dynamic text replacement with seed-based randomization or controlled increment for creative content generation.
The AD_PromptReplace
node is a utility designed to facilitate dynamic text replacement within a given content string. Its primary function is to search for specific text patterns and replace them with alternative text, which can be selected either randomly or sequentially. This node is particularly useful for AI artists who need to generate varied textual prompts or modify existing text content in a flexible manner. By leveraging a seed-based randomization or a controlled increment approach, the node allows for creative experimentation and ensures that the text replacement process can be both predictable and varied, depending on the user's needs. This capability is essential for tasks that require the generation of diverse outputs from a single input template, enhancing the creative process by introducing variability and adaptability.
The Content
parameter is a multiline string that represents the original text in which replacements will be made. It serves as the base text where the specified Match
string will be searched and replaced. The default value is an empty string, and it can be customized to include any text content you wish to modify.
The Match
parameter is a string that specifies the exact text pattern you want to find within the Content
. This is the text that will be replaced by the Replace
parameter. The default value is an empty string, meaning no specific text is targeted for replacement unless specified.
The Replace
parameter is a multiline string that provides the alternative text to substitute for the Match
string in the Content
. This parameter can contain multiple lines, allowing for varied replacements. The default value is an empty string, and it can be customized to include any replacement text you desire.
The seed
parameter is an integer that influences the random selection process when Increment
is set to 0. It ensures that the randomization is consistent and repeatable, allowing for predictable outcomes when the same seed is used. The default value is 0, with a minimum of 0 and a maximum of 0xffffffffffffffff.
The Increment
parameter is an integer that determines the method of selecting the replacement text. A value of 0 triggers random selection based on the seed
, while any other value enables sequential selection, incrementing through the replacement options. The default value is 1, with a minimum of 0 and a maximum of 1000.
The Replaced_Text
output is a string that contains the modified version of the Content
after the specified Match
text has been replaced with the selected Replace
text. This output reflects the changes made by the node and is essential for verifying the success of the replacement operation.
The new_seed
output is an integer that represents the seed used during the replacement process. This value is crucial for reproducing the same random selection results in future operations, ensuring consistency and repeatability in the text replacement process.
seed
value across different runs. This will ensure that the random selection of replacement text remains the same each time.Increment
parameter to a non-zero value. This will allow you to control the sequence of replacements, which can be useful for generating a series of related outputs.Content
or Replace
parameters are empty, the node may not perform any replacements as expected.Content
and Replace
parameters contain valid text. If necessary, provide default text to avoid empty inputs.seed
value is within the specified range (0 to 0xffffffffffffffff) and adjust it if necessary.Increment
parameter to a value outside the allowed range can disrupt the replacement sequence.Increment
value is between 0 and 1000 to maintain proper functionality. Adjust the value to fit within this range if needed.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.