Nodes/Bubba Nodes/Bubba Prompt Cleaner
ComfyUI Node

Bubba Prompt Cleaner

Bubba Prompt Cleaner

By bubbafett5611·Created 5 months ago·Updated 2 months ago· 0
Bubba Prompt Cleaner
  • pipe
  • metadata
  • clip
  • pipe
  • metadata
  • positive
  • negative
  • clean_positive
  • clean_negative
positive_prompt
negative_prompt
cleanuptrue
dedupetrue

Bubba Prompt Cleaner is the janitor node for your prompt: it takes messy, duplicated, oddly-spaced tag soup and hands back a normalized, deduped version. If you've ever pasted a prompt from somewhere and squinted at the double commas, stray spaces, and the same tag spelled two ways, this is the node that fixes that before the text ever reaches the CLIP encoder.

Tag prompting has its own hygiene rules, and the KB's prompt-engineering essay has the full lecture. The short version that matters here: on tag-based models (Pony, Illustrious, NoobAI, the SDXL lineage) earlier tags get stronger attention, duplicate tags waste attention that could go to new concepts, and consistent separators keep the encoder from gluing words together. A cleaner is a small quality win on every run and a big one on batch workflows where you're generating from templates.

How it works

Two toggles do all the work:

  • cleanup - normalizes whitespace and separators, so "blonde hair,, blue eyes" becomes a tidy comma-separated list.
  • dedupe - removes duplicate tags case-insensitively while keeping the first spelling and first occurrence. "Blonde hair, blonde Hair" collapses to one.

The cleaned result comes out on clean_positive and clean_negative as plain strings. Wire in a clip and the node also encodes those cleaned strings into positive and negative conditioning outputs, so the CLIP text-encode step is handled for you. It's pipe-aware too: give it a pipe and it updates the pipe's prompts and metadata.

The outputs that matter

For most graphs you only care about two: clean_positive and clean_negative - feed them to a CLIP Text Encode (or use the positive/negative conditioning outputs directly if you connected a clip). pipe and metadata pass through for Bubba workflow integration.

How to install it

It's part of the Bubba_Nodes pack. ComfyUI Manager → "Bubba Nodes" → install → restart, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/bubbafett5611/bubba_nodes.git

restart, and pip install -r requirements.txt if the console asks (aiohttp and pydantic - nothing exotic). The pack needs ComfyUI v0.27.0+ and uses the newer V3 node API.

Gotchas

The honest limits: this node normalizes text, it doesn't rewrite meaning. It won't catch semantically duplicated tags like 1girl and solo, and it won't fix prompt conflicts - that's what Bubba Prompt Inspector is for (same pack, and they're designed to sit next to each other: Cleaner first, Inspector after, sampler last). And one real hazard of over-cleanup: if you're doing A/B testing of prompts, run every candidate through the cleaner so the dedupe doesn't silently change one version and not the other - otherwise your "difference" between two prompts is actually the dedupe doing different work. Also remember that on newer LLM-encoded models the whole tag-vs-sentence question changes (see the prompt-engineering essay), so this node is most at home on the tag-based SDXL lineage it was clearly built for. The pack itself is young with no meaningful community discussion yet, so the README's prompt notes are the authoritative guide to exactly what cleanup and dedupe touch.

CategoryBubba Nodes/Prompt

Inputs (7)

NameTypeDefaultDescription
positive_promptSTRING
negative_promptSTRING
cleanupBOOLEANtrue
dedupeBOOLEANtrue
pipeoptBUBBA_PIPE
metadataoptBUBBA_METADATA
clipoptCLIP

Outputs (6)

NameTypeDescription
pipeBUBBA_PIPE
metadataBUBBA_METADATA
positiveCONDITIONING
negativeCONDITIONING
clean_positiveSTRING
clean_negativeSTRING