Visit ComfyUI Online for ready-to-use ComfyUI environment
Enhance text prompts by removing unwanted words/phrases for AI model input precision and clarity.
PromptCleanerV2 is a versatile node designed to enhance the clarity and precision of text prompts by removing unwanted words or phrases. This node is particularly beneficial for AI artists who need to refine their input prompts to achieve more accurate and desired outputs from AI models. By allowing you to specify both individual words and entire phrases for removal, PromptCleanerV2 provides a flexible solution for text cleaning, ensuring that the resulting text is free from unnecessary or distracting elements. This capability is crucial for maintaining the focus and intent of the prompt, ultimately leading to more effective and efficient AI-generated content.
The text
parameter is the main input for the node, where you provide the original text prompt that you wish to clean. This parameter accepts a string input and supports multiline text, allowing you to input complex and lengthy prompts. The text you provide here will be processed to remove specified words or phrases, resulting in a cleaner version of the original input.
The words_to_remove
parameter allows you to specify a list of individual words that you want to eliminate from the text. These words should be separated by commas and are processed in a case-insensitive manner. The default value for this parameter is "man, woman, world," but you can customize it to suit your specific needs. By removing these words, you can refine the text to better align with your intended message or focus.
The phrase_to_remove
parameter is used to specify a particular phrase that you want to remove from the text. Unlike the words_to_remove
parameter, this allows for the removal of a sequence of words, preserving the formatting of the original text. This parameter is optional and defaults to an empty string, meaning no phrase will be removed unless specified. This feature is particularly useful for eliminating recurring phrases that may detract from the clarity or intent of the prompt.
The output of the PromptCleanerV2 node is a cleaned version of the input text, returned as a string. This output reflects the original text with the specified words and phrases removed, providing a more focused and concise prompt. The cleaned text is crucial for ensuring that the AI model receives a clear and unambiguous input, which can significantly enhance the quality and relevance of the generated content.
phrase_to_remove
parameter to eliminate common phrases that may appear frequently in your text, ensuring a more streamlined and effective prompt.text
text
parameter is not provided as a string.text
parameter is a valid string, and if necessary, convert other data types to a string format before inputting them into the node.words_to_remove
and phrase_to_remove
parameters to ensure they are not overly broad, and adjust them to retain essential parts of the text.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.