Prompt De-Dupe - PromptDrafter
When your prompt says the same tag four times
- cleaned_string
- removed_items
- duplicate_count
If you build prompts by combining templates - a base, a style, a few LoRA trigger tags - you eventually produce something with blue eyes, blue_eyes, and (blue eyes:1.2) all in the same string. Prompt De-Dupe - PromptDrafter is the node that cleans that up before it hits the encoder. It's prompt hygiene, basically: feed it a messy combined prompt and it removes duplicate tags and phrases while resolving the conflicts between how the same concept is weighted and formatted.
This is a surprisingly meaty little engine for what looks like a string cleaner. It parses your prompt into segments - booru tags, natural-language prose, weighted expressions, wildcards, LoRA references, nested brackets - and deduplicates across them with rules. blue eyes, blue_eyes, and (blue eyes:1.2) all collapse to one entry, and the version that survives is the one carrying the explicit weight, so (blue_eyes:1.2) wins. It processes BREAK and AND zones separately so one region's tags don't bleed into another's, and it deliberately protects special syntax: wildcards, <lora:...> references, prompt scheduling brackets, and nested grouping all survive untouched. That protection matters - a dedupe node that ate your LoRA tags would be worse than no dedupe node.
The settings you'll actually touch
input_string- the prompt to clean. Feed it the output of a String Combiner or a PromptDrafter node.prose_threshold- word count (1–20, default 4) above which text is treated as prose rather than tags. Booru tags are short; sentences aren't. Leave it at 4 until you have a reason not to.force_underscores- replace spaces with underscores in tags only. Mostly for models whose vocabulary prefersblue_eyesoverblue eyes.prefer_specified_weights- when the same term appears once bare and once weighted, keep the explicit weight. Default on, and you'll usually want it on.remove_spaces_around_commas- normalizestag , tagandtag, taginto clean,spacing. Default on.
Outputs are cleaned_string (use this), removed_items (a log of every merge it performed, useful for trusting or distrusting it), and duplicate_count (an integer you can wire somewhere or just read).
Installing and what's bit people
ComfyUI Manager (search "PromptDrafter"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/Carasibana/ComfyUI-PromptDrafter
Restart after. No extra dependencies, no model downloads - pure text processing. If you want to see the merges happening, the console logs everything.
Troubleshooting, straight from the changelog: v1.3.4 fixed a startup crash (TypeError: can't access property "readOnly", inputEl is undefined) that a ComfyUI update introduced - if the pack won't even boot, update it. Earlier, v1.2.1 fixed prose_threshold losing its value on workflow reload by making it a required input, and v1.2.2 fixed LoRA dedupe failing when two <lora:...> tags sat adjacent with no comma between them. General advice: run it, check removed_items once, and if it mangled something, that's the evidence for which setting to flip.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| input_string | STRING | — | |
| prose_threshold | INT | 41–20 | — |
| force_underscoresopt | BOOLEAN | false | — |
| prefer_specified_weightsopt | BOOLEAN | true | — |
| remove_spaces_around_commasopt | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| cleaned_string | STRING | — |
| removed_items | STRING | — |
| duplicate_count | INT | — |