Bubba Prompt Inspector
Bubba Prompt Inspector
- pipe
- token_count
- duplicate_tags
- conflict_warnings
- formatted_preview
Bubba Prompt Inspector is a diagnostic node that tells you things about your prompt you can't see by staring at it: how many tokens it'll chew through, which tags are duplicated, whether your positive and negative prompts contradict each other, and what the cleaned version looks like. You wire prompts in, read the numbers, fix the prompt. It's the "before you press queue" sanity check for people who write tag-heavy prompts.
The token count is the headline feature, and it matters more than most people realize. The KB's prompt-engineering essay walks through the real constraint landscape: CLIP-based tag models have a 77-token chunk boundary, and even on newer LLM-encoded models there's an attention cap around 75–100 effective tokens where drift starts. The Inspector won't tell you what the cap is for your model, but it tells you the count, which is the half of the problem that's actually visible from the graph.
How it works
It takes positive_prompt and negative_prompt (or a pipe that carries them) and runs the same analysis the pack's prompt machinery uses everywhere: tokenization, duplicate detection, and a set of simple conflict checks. Then it emits four outputs:
token_count(INT) - the estimated token count of the positive prompt. The raw number you can compare against your model's limits.duplicate_tags(STRING) - which tags appear more than once, case-insensitively. Dedupe exists in this pack for a reason.conflict_warnings(STRING) - the interesting one. It flags tags that appear in both positive and negative prompts, plus simple pair checks like solo/multiple people, male/female, day/night, indoors/outdoors, and safe/nsfw. "1girl" in positive and "1girl" in negative is a contradiction the encoder will try to satisfy and fail at.formatted_preview(STRING) - a cleaned, normalized version of the prompt text so you can eyeball what the encoder will actually see.
None of the inputs are required - it's happy with just a pipe or just prompt strings - and it has no side effects. It's a read-only diagnostic, which is exactly why it's safe to drop anywhere in a graph.
How to install it
Part of the Bubba_Nodes pack. ComfyUI Manager → "Bubba Nodes" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/bubbafett5611/bubba_nodes.git
restart ComfyUI, pip install -r requirements.txt if needed. Needs ComfyUI v0.27.0+ for the V3 node API; no models to download.
Gotchas
Set expectations: the conflict warnings are deliberately simple heuristics, not an AI proofreader. "day" in positive and "night" in negative is an obvious catch; subtle semantic contradictions slip right through, and the KB's prompt essay notes that some models (Illustrious) quietly ignore impossible tag combinations while others (Anima) will try to render them all and produce body horror - the Inspector won't save you from the second class. Also, the token count is an estimate - the pack's frontend shows a "~tokens" figure for a reason, because the real tokenizer differs by model family. And one practical workflow note: run the Inspector before a prompt builder node's wildcards expand, and you're inspecting the template, not the result. Put it after the expansion (or after Bubba Prompt Cleaner) and you're inspecting what actually gets encoded. Which is the version you want. The pack is new with no community discussion to speak of yet, so the README's prompt notes are currently the best reference on what exactly counts as a conflict here.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| pipeopt | BUBBA_PIPE | — | |
| positive_promptopt | STRING | — | |
| negative_promptopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| token_count | INT | — |
| duplicate_tags | STRING | — |
| conflict_warnings | STRING | — |
| formatted_preview | STRING | — |