ComfyUI  >  Nodes  >  ComfyUI Easy Use >  XY Inputs: PromptSR //EasyUse

ComfyUI Node: XY Inputs: PromptSR //EasyUse

Class Name

easy XYInputs: PromptSR

Category
EasyUse/XY Inputs
Author
yolain (Account age: 1341 days)
Extension
ComfyUI Easy Use
Latest Updated
6/25/2024
Github Stars
0.5K

How to Install ComfyUI Easy Use

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

XY Inputs: PromptSR //EasyUse Description

Automate prompt search and replace for AI artists, enhancing efficiency and consistency.

XY Inputs: PromptSR //EasyUse:

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.

XY Inputs: PromptSR //EasyUse Input Parameters:

target_prompt

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.

search_txt

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.

replace_all_text

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.

replace_count

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.

replace_1 to replace_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.

XY Inputs: PromptSR //EasyUse Output Parameters:

X or Y

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.

XY Inputs: PromptSR //EasyUse Usage Tips:

  • To ensure all instances of a search text are replaced, set replace_all_text to True.
  • Use the replace_count parameter to limit the number of replacements if you only want to change a specific number of occurrences.
  • Utilize the replace_1 to replace_29 parameters to specify different replacement texts for each occurrence, providing flexibility in prompt modifications.

XY Inputs: PromptSR //EasyUse Common Errors and Solutions:

"Invalid target_prompt value"

  • Explanation: The target_prompt parameter must be either "positive" or "negative".
  • Solution: Ensure that you select either "positive" or "negative" for the target_prompt parameter.

"replace_count out of range"

  • Explanation: The replace_count parameter must be between 1 and 29. - Solution: Adjust the replace_count value to be within the valid range.

"Missing search_txt"

  • Explanation: The search_txt parameter is required and cannot be empty.
  • Solution: Provide a valid string for the search_txt parameter.

XY Inputs: PromptSR //EasyUse Related Nodes

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