Visit ComfyUI Online for ready-to-use ComfyUI environment
Enhance text prompts with dynamic repacking for creative AI outputs using word and phrase replacement strategies.
The PromptRepack node is designed to enhance the flexibility and adaptability of text prompts by dynamically repacking them based on specified criteria. This node is particularly useful for AI artists who want to manipulate and refine text prompts to achieve more creative and varied outputs. By utilizing a combination of word and phrase replacement strategies, PromptRepack allows you to prioritize either individual words or longer phrases, depending on your artistic needs. It also supports various matching modes to control how replacements are identified and applied, offering a balance between precision and flexibility. The node can handle complex prompt structures, including those with wildcard patterns and blacklists, ensuring that unwanted terms are excluded from the final output. Overall, PromptRepack provides a powerful tool for customizing and optimizing text prompts, enabling more nuanced and controlled creative expression.
This parameter represents the input text string that you want to repack. It is the primary content that will undergo transformation based on the node's settings. The string can be multiline, allowing for complex and detailed prompts. The default value is an empty string.
This parameter determines the priority of replacements within the text. It offers two options: prioritize_words, which focuses on replacing individual words, and prioritize_phrase, which targets longer, underscore-joined phrases first before addressing individual words. The default setting is prioritize_phrase, which is useful for maintaining the integrity of longer expressions.
This parameter controls how the node matches text for replacement. It includes three options: exact, which requires precise matches without case folding or space-to-underscore conversion; ignore_case, which matches text in a case-insensitive manner; and flexible, the default mode, which combines case insensitivity with space-to-underscore conversion for broader matching capabilities.
This boolean parameter specifies whether to expand bracketed combinations (e.g., {a|b}) into all indexed variants. If set to true, the node will consider all possible combinations for indexing; otherwise, lines with braces are skipped. The default value is false, which simplifies processing by ignoring bracketed variations.
This parameter is a float that defines the probability of a replacement occurring. It ranges from 0.0 to 1.0, with a default value of 1.0, meaning replacements are always applied when possible. Adjusting this value allows for controlled randomness in the repacking process, which can lead to more varied outputs.
This integer parameter sets the seed for the random number generator used in the repacking process. It ensures reproducibility of results by providing a consistent starting point for random operations. The default value is 0, and it can range up to 0xffffffffffffffff.
This parameter specifies the file containing terms that should be excluded from the repacking process. It allows you to maintain a list of words or phrases that should not appear in the final output. The default file is blacklist.txt, and you can choose from other available blacklist files in the specified directory.
This boolean parameter determines whether to reload the wildcards and blacklist caches. Setting it to true forces the node to refresh its internal data, ensuring that any changes to the blacklist or wildcard patterns are applied. The default value is false, which maintains the current cache state for efficiency.
The output of the PromptRepack node is a transformed string that reflects the applied repacking rules. This string is the result of replacing words and phrases according to the specified detection and matching modes, while respecting the blacklist and chance settings. The output is designed to be a refined version of the input prompt, tailored to your creative requirements.
chance parameter by setting it to a value less than 1.0, introducing controlled randomness into the repacking process.detection_mode parameter to focus on either individual word replacements or longer phrases, depending on the complexity and style of your desired output.blacklist_file to ensure that unwanted terms are effectively excluded from your prompts, maintaining the quality and relevance of the output.blacklist.txt file exists in the correct directory or update the blacklist_file parameter to point to an existing file.matching_mode parameter.matching_mode is set to one of the supported options: exact, ignore_case, or flexible.seed parameter.seed parameter is set to a valid integer value within the specified range.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.