ComfyUI > Nodes > DJZ-Nodes > Prompt Cleaner V2

ComfyUI Node: Prompt Cleaner V2

Class Name

PromptCleanerV2

Category
Custom-Nodes
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

Install this extension via the ComfyUI Manager by searching for DJZ-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DJZ-Nodes 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Prompt Cleaner V2 Description

Enhance text prompts by removing unwanted words/phrases for AI model input precision and clarity.

Prompt Cleaner V2:

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.

Prompt Cleaner V2 Input Parameters:

text

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.

words_to_remove

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.

phrase_to_remove

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.

Prompt Cleaner V2 Output Parameters:

STRING

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.

Prompt Cleaner V2 Usage Tips:

  • To achieve the best results, carefully select the words and phrases you wish to remove, focusing on those that are irrelevant or redundant to your prompt's intent.
  • Use the phrase_to_remove parameter to eliminate common phrases that may appear frequently in your text, ensuring a more streamlined and effective prompt.
  • Experiment with different combinations of words and phrases to see how they impact the clarity and focus of your AI-generated outputs.

Prompt Cleaner V2 Common Errors and Solutions:

Invalid input type for text

  • Explanation: This error occurs when the text parameter is not provided as a string.
  • Solution: Ensure that the input for the text parameter is a valid string, and if necessary, convert other data types to a string format before inputting them into the node.

Empty output after cleaning

  • Explanation: This may happen if the words or phrases specified for removal constitute the majority of the input text.
  • Solution: Review the 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.

Prompt Cleaner V2 Related Nodes

Go back to the extension to check out more related nodes.
DJZ-Nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.