ComfyUI Node: XY Input: Prompt S/R

Class Name

XY Input: Prompt S_R

Category
Efficiency Nodes/XY Inputs
Author
jags111 (Account age: 3922days)
Extension
Efficiency Nodes for ComfyUI Version 2.0+
Latest Updated
2024-08-07
Github Stars
0.83K

How to Install Efficiency Nodes for ComfyUI Version 2.0+

Install this extension via the ComfyUI Manager by searching for Efficiency Nodes for ComfyUI Version 2.0+
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Efficiency Nodes for ComfyUI Version 2.0+ 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 Input: Prompt S/R Description

Facilitates search and replace in prompts for AI artists, enhancing prompt manipulation efficiency and effectiveness.

XY Input: Prompt S/R:

The XY Input: Prompt S_R node is designed to facilitate the search and replace functionality within prompts, specifically targeting positive and negative prompts. This node is particularly useful for AI artists who need to dynamically modify prompts during the generation process, allowing for more flexible and efficient experimentation with different prompt variations. By automating the search and replace process, this node helps streamline the workflow, making it easier to test and refine prompts without manual intervention. The main goal of this node is to enhance the efficiency and effectiveness of prompt manipulation, ensuring that artists can quickly iterate and achieve the desired results in their AI-generated art.

XY Input: Prompt S/R Input Parameters:

target_prompt

This parameter specifies whether the target prompt is positive or negative. It accepts two options: "positive" or "negative". The choice of target prompt determines the type of search and replace operation that will be performed, either on the positive or negative prompt. This parameter is crucial as it directs the node to the correct prompt type for manipulation.

search_txt

This parameter is a string that represents the text to be searched within the target prompt. It is the initial text that the node will look for in the prompt to replace. The default value is an empty string, and it is not multiline. This parameter is essential as it defines the specific text segment that will be targeted for replacement.

replace_count

This integer parameter determines the number of replacements to be made. It has a default value defined by XYPLOT_DEF, with a minimum value of 0 and a maximum value of XYPLOT_LIM-1. This parameter controls how many times the search text will be replaced within the prompt, allowing for multiple variations to be tested.

replace_1, replace_2, ..., replace_n

These parameters are dynamically added based on the replace_count value. Each replace_i parameter is a string that specifies the replacement text for the corresponding search text. The default value is an empty string, and it is not multiline. These parameters enable the node to perform multiple replacements, each with a different replacement text, thereby creating various prompt variations.

XY Input: Prompt S/R Output Parameters:

X or Y

This output parameter is a tuple that contains the type of prompt (either "Positive Prompt S/R" or "Negative Prompt S/R") and a list of tuples representing the search and replace values. The list includes the initial search text and the corresponding replacement texts. This output is crucial as it provides the modified prompt values that can be used in subsequent nodes or processes, enabling the dynamic manipulation of prompts based on the specified search and replace criteria.

XY Input: Prompt S/R Usage Tips:

  • Ensure that the search_txt parameter is not left empty, as this will result in no replacements being made. Always specify the text you want to search for within the prompt.
  • Use the replace_count parameter to control the number of variations you want to create. Setting this parameter to a higher value allows for more extensive experimentation with different prompt replacements.

XY Input: Prompt S/R Common Errors and Solutions:

XY Plot Error: Prompt S/R value can not be empty.

  • Explanation: This error occurs when the search_txt parameter is left empty, which means there is no text specified for the node to search and replace.
  • Solution: Ensure that you provide a valid string for the search_txt parameter. This string should be the text you want to search for within the target prompt.

XY Plot Error: '{plot_value}' is not a valid batch count.

  • Explanation: This error occurs when the length of the plot_value array is not equal to 1 while using the "Seeds++ Batch" plot type.
  • Solution: Verify that the plot_value array contains exactly one element when using the "Seeds++ Batch" plot type. Adjust the array length accordingly to resolve this error.

XY Input: Prompt S/R Related Nodes

Go back to the extension to check out more related nodes.
Efficiency Nodes for ComfyUI Version 2.0+
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.