Danbooru Tags Upsampler
A local LLM that writes your Danbooru tags for you
- upsampled_prompt
Type 1girl, solo into this thing and it writes the rest of the tag list for you: ahoge, animal ears, blue hair, blush, fox girl, looking at viewer, smile.... That's the whole pitch, and unlike a lot of ComfyUI "AI prompt helper" nodes it's not calling some cloud API with a key - it's running a small language model locally and giving you the output as a plain string.
Danbooru Tags Upsampler is a ComfyUI port of p1atdev's sd-danbooru-tags-upsampler extension for AUTOMATIC1111. It's powered by DART, a family of small LLMs p1atdev trained on Danbooru tags to "complete" a prompt the way a booru-literate person would. Both are real and have been around since 2024; this pack is a fairly obscure port by rookiestar28 that makes the same trick work inside ComfyUI without leaving your workflow. The author is upfront that all credit for the concept, model, and core logic goes to p1atdev.
Why you'd reach for it
Models in the Danbooru-trained lineage - Illustrious, NoobAI, Pony - respond to the board's exact tag vocabulary, not to prose. A correct tag beats a sentence, and the community's own advice is to stop guessing tags and learn the taxonomy you're prompting against. This node is the "predictive" version of the old random-tag generators, which produced contradictory garbage because nothing checked whether tags actually co-occur. DART learned which tags go together from the board itself, so you get plausible, coherent completions instead of 1girl plus two male character names. There's a reason gwern pointed at this exact approach years ago.
How it works
Your prompt goes through an analyzer that classifies what you typed against the bundled tag lists (character.txt, copyright.txt, quality.txt - about 15,000 tags total). The DART model then gets a special length token - <|long|>, <|short|>, and friends - plus your tags, and generates a completion. The node joins your original prompt with the generated tags into one upsampled_prompt string. Sampling is standard: temperature, top_k, top_p, num_beams, max_new_tokens.
Three backends matter here. Original runs the plain Hugging Face model and is the only one that supports CFG. ONNX and ONNX (Quantized) - the default - are optimized exports that enforce ban_tags but reject CFG requests. Models auto-download from Hugging Face on first use (pinned revisions), into the usual HF cache.
The inputs that actually matter
prompt- your base tags, e.g.1girl, solo(default). Garbage in, garbage out; give it a real seed prompt.tag_length-very short/short/long/very long. This is the big one;long(< 40 tags) is a sensible start.ban_tags- comma-separated tags or wildcards to exclude, likeenglish text, * background.model_backendandmodel_device- default to ONNX (Quantized) andcpu.
The output is upsampled_prompt (a single STRING), which you wire straight into a CLIPTextEncode node and then into the KSampler.
Installing it
The easy way is ComfyUI Manager: search "Danbooru Tags Upsampler" and install. Manual:
cd ComfyUI/custom_nodes/
git clone https://github.com/rookiestar28/ComfyUI-Danbooru-Tags-Upsampler.git
cd ComfyUI-Danbooru-Tags-Upsampler
python install.py
requirements.txt pulls transformers, optimum[onnxruntime], tokenizers, and sentencepiece. PyTorch is deliberately not pinned - ComfyUI manages its own torch, so don't pip-install a separate build. Then restart and the node appears under Prompt Styling → casual_gamer28.
Where people get burned
- The first run looks hung. It's downloading a DART model into the HF cache. Watch the console and be patient.
- CFG needs the Original backend.
negative_prompt_tags+cfg_scaleonly do anything there (andcfg_scaleis ignored unless you supply negative tags). ONNX rejects CFG outright. - Not every model works on every backend.
dart-v2-moe-sftis Original-only;dart-v2-sftonly ships a quantized ONNX. The node falls back with a warning when an artifact is missing, so read the log. - Reproducibility is loose. The seed tooltip says results can still vary across backends, devices, and library versions - don't expect bit-identical prompts after swapping machines.
- Bracket weirdness. The node escapes/unescapes
()and[](inherited from the original extension), and their interaction with CLIPTextEncode is a known fiddly spot.
One honest caveat: this is a prompt writer, not a quality button. Feed it to an Illustrious/NoobAI/Pony workflow where tags are the language. On a natural-language model like Flux, a generated tag list is mostly noise.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | 1girl, solo | Comma-separated Danbooru tags to analyze and expand. |
| model_name | COMBO | dart-v1-sft | Allowlisted DART model. Model files use a pinned revision and may download on first use. |
| tag_length | COMBO | long | Target amount of detail requested from the DART model. |
| seed | INT | 00–4294967295 | Generation seed. Reproducibility can still vary across backends, devices, and library versions. |
| temperature | FLOAT | 1.000.01–5 | Sampling randomness; higher values produce more varied tag choices. |
| top_k | INT | 300–1000 | Limits sampling to the highest-probability tokens; 0 disables this limit. |
| top_p | FLOAT | 1.000–1 | Nucleus-sampling probability mass; 1.0 keeps the full distribution. |
| num_beams | INT | 11–20 | Beam-search width. Larger values use more time and memory. |
| model_device | COMBO | cpu | Requested execution device. Failed CUDA initialization falls back to CPU and is logged. |
| model_backend | COMBO | ONNX (Quantized) | Original supports CFG. ONNX variants enforce ban tags but reject CFG; unavailable artifacts fall back with a warning. |
| max_new_tokens | INT | 1288–512 | Maximum number of new tokens generated for the tag completion. |
| negative_prompt_tagsopt | STRING | Tags used for CFG with the Original backend. ONNX rejects CFG requests. | |
| ban_tagsopt | STRING | Comma-separated tags or supported wildcard patterns to block on every backend. | |
| cfg_scaleopt | FLOAT | 1.51–10 | Classifier-free guidance strength for negative tags; supported only by Original. |
| debug_loggingopt | BOOLEAN | false | Enable detailed node/runtime logs for troubleshooting. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| upsampled_prompt | STRING | The original prompt plus generated Danbooru tag completions. |