Visit ComfyUI Online for ready-to-use ComfyUI environment
Automate prompt search and replace for AI artists, enhancing efficiency and consistency.
The easy XYInputs: PromptSR
node is designed to facilitate the search and replace functionality within prompts, specifically targeting either positive or negative prompts. This node allows you to specify a target prompt type and perform text replacements based on your input criteria. It is particularly useful for AI artists who need to dynamically modify prompts to achieve desired outputs without manually editing each instance. By automating the search and replace process, this node enhances efficiency and ensures consistency across multiple prompt modifications.
This parameter specifies the type of prompt you want to target for search and replace operations. You can choose between "positive" and "negative" prompts. Selecting "positive" will apply changes to the positive prompt, while "negative" will target the negative prompt.
This is the text string that you want to search for within the target prompt. It is a required field and must be a string. The default value is an empty string, and it does not support multiline input.
This boolean parameter determines whether all instances of the search text should be replaced. If set to True
, every occurrence of the search text will be replaced. If set to False
, only the specified number of occurrences (defined by replace_count
) will be replaced. The default value is False
.
This integer parameter specifies the number of occurrences of the search text to replace. It is only relevant if replace_all_text
is set to False
. The default value is 3, with a minimum value of 1 and a maximum value of 29.
These are additional string parameters that allow you to specify the replacement text for each occurrence of the search text. Each parameter is optional and has a default value of an empty string. These parameters do not support multiline input and are dynamically added based on the replace_count
.
This output parameter returns a dictionary containing the axis type and the values that were modified. The axis type indicates whether the changes were applied to the positive or negative prompt, and the values list contains tuples of the search text, replacement text, and the boolean flag indicating whether all instances were replaced. This output is crucial for understanding the modifications made to the prompts and for further processing in your workflow.
replace_all_text
to True
.replace_count
parameter to limit the number of replacements if you only want to change a specific number of occurrences.replace_1
to replace_29
parameters to specify different replacement texts for each occurrence, providing flexibility in prompt modifications.target_prompt
parameter must be either "positive" or "negative".target_prompt
parameter.replace_count
parameter must be between 1 and 29. - Solution: Adjust the replace_count
value to be within the valid range.search_txt
parameter is required and cannot be empty.search_txt
parameter.© Copyright 2024 RunComfy. All Rights Reserved.