The Prompt Cleaner node is a utility for cleaning up prompt text by removing specified words. This can be useful for refining prompts by eliminating unwanted terms or standardizing prompt content.
-
text (STRING, multiline)
- The input text/prompt that you want to clean
- Supports multiple lines of text
- This is the source text from which specified words will be removed
-
words_to_remove (STRING)
- A comma-separated list of words that should be removed from the input text
- Default value: "man, woman, world"
- Case-insensitive matching (e.g., "Man" will match "man")
- Each word should be separated by commas
- Leading and trailing whitespace around words is automatically trimmed
- Connect your prompt source to the "text" input
- Specify the words you want to remove in the "words_to_remove" field
- The node will process the text and output a cleaned version with the specified words removed
Input text:
A beautiful world with a man and woman walking
words_to_remove: "man, woman, world"
Output:
A beautiful with a and walking
- The cleaning process is case-insensitive
- Punctuation is preserved in the output
- Words are matched as whole words only (e.g., "man" won't match "manual")
- Multiple consecutive spaces that may result from word removal are automatically condensed to single spaces