Prompt Clean Append
Prompt Clean Append does the boring string work
- text
- removed_terms
- removed_count
Every ComfyUI user eventually hits the same grunt work: you grab a great prompt off CivitAI - or out of your own saved workflows - and half of it is tags you don't want. Swap an anime prompt to a realistic one and you're deleting illustration, CG, cel shading by hand, then retyping the same five quality tags you always use. Prompt Clean Append is a single small node from the kryzbell2/comfyui-prompt-clean-append pack that does exactly that cleanup for you: strip out exact unwanted tokens, drop the duplicates, and tack on your standard closing tags. Nothing more, nothing less.
The whole thing is one focused node under text/prompt. It has no models, no API keys, and no dependencies beyond Python's standard library - the pack is a single .py file. That's refreshing, because the alternative is dragging in a full text-utility suite like WAS Node Suite when all you need is a reliable find-and-remove.
How it works
The mechanism is simple and worth understanding, because its limits are its personality. The node takes your prompt, splits it into comma-separated tokens (it also respects newlines), and strips whitespace and empty tokens. Then it checks each token against your remove_terms list and drops exact matches, keeping the order of everything that survives. Matching is case-insensitive by default, so CG will catch cg - flip case_sensitive on if that bites you.
Two behaviors in the source are worth knowing before they surprise you. First, it removes only exact token matches: illustration won't touch illustration, (already handled) but it also won't touch digital illustration or illustration1. No regex, no partial matching. Second, it deduplicates surviving tokens - and it does this even when you're not removing anything. If you deliberately repeat a tag for emphasis the way old SD 1.5 lore recommends, this node will quietly collapse it.
After cleanup it appends your append_text tokens, skipping any that are already in the kept list, and joins everything with the separator (default ", ").
The inputs and outputs that matter
You'll actually set three of the five inputs:
text- your incoming prompt, usually from a prompt reader or a saved workflow's text node.remove_terms- the tokens to drop. One per line or comma-separated; the README even ships a ready-made cartoon-to-realistic removal list (anime, cartoon, illustration, CG, cel shading, flat colors, line art, exaggerated eyes, simplified features).append_text- what gets added last, e.g.realistic facial proportions, photorealistic studio portrait, natural skin texture.
separator and case_sensitive are the tweak knobs; the defaults (, and off) are right for almost everyone.
Outputs: text is the finished string - wire it into a CLIPTextEncode text input. removed_terms and removed_count report what actually got stripped, which is handy for confirming a term matched when the image doesn't change.
Installing it
Through ComfyUI Manager, search the pack title comfyui-prompt-clean-append and hit install. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kryzbell2/comfyui-prompt-clean-append.git
Restart ComfyUI. There's nothing else to download - no requirements.txt, no model files, no hidden deps.
Where people get burned
The biggest trap is expecting fuzzy matching. This node is a scalpel for exact comma-separated tokens, so it suits the booru-tag style of prompting that still dominates SDXL-lineage models (Illustrious, NoobAI, Pony), not prose prompts on LLM-encoded models. The other gotcha is the dedupe: if you rely on repeated tags for emphasis, that emphasis is getting silently removed. And one honest caveat - with zero community footprint, you're adopting a brand-new utility, so keep the README's remove list and the source handy if you need to verify behavior. For a two-hundred-line node that's easy to do, and what it does, it does correctly.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| remove_terms | STRING | — | |
| append_text | STRING | — | |
| separator | STRING | , | — |
| case_sensitive | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| removed_terms | STRING | — |
| removed_count | INT | — |