ComfyUI Node

Booru Tagger

Point this at an image and it hands you the Danbooru prompt that made it

By nestflow·Created about a year ago·Updated about a month ago· 5
Booru Tagger
  • tagger_model
  • tagger_info
  • image
  • tags
  • general_tags
  • rating
  • character_tags
threshold0.35
character_threshold0.85
use_best_thresholdtrue
trailing_commafalse
sort_tagsfalse
exclude_tags

You see an image you love and you want the prompt behind it. This node is how you get it back out: feed it any image and it interrogates the picture into a comma-separated Danbooru tag string you can paste straight into a CLIP Text Encode node. No API, no key, no account. It's all local ONNX inference.

Booru Tagger is the inference half of the nestflow/ComfyUI-Booru-Tagger pack. The pack's whole pitch is that it took pythongosssss's WD14 tagger - the classic in this space - and split it in two: a loader that loads the model once, and this node that just runs it. So the same model stays warm in memory while you tag a whole batch. That matters more than it sounds: a multi-hundred-MB ONNX model reloading per image was the classic way these workflows crawled.

When do you reach for it? When you're captioning a dataset for LoRA training, when you found art whose exact vocabulary you want to reuse, or when you want an img2img loop that re-prompts an image before resampling. Just remember which side of the ecosystem you're on. Danbooru tags are the native language of the Illustrious/NoobAI/Pony family of models - those checkpoints were trained on the board's tag vocabulary. On a natural-language model like Flux, tags are a foreign tongue, so keep this pack on the anime side of your graph.

How it works

The node itself loads nothing. You wire in a tagger_model and tagger_info from the Load Booru Tagger node - those carry the warm ONNX session and its tag metadata - plus your image. Internally the image gets resized to the model's input size, padded to a square (white, grey, or a brownish tone depending on which model family you picked, matching how each was trained), normalized, and pushed through onnxruntime.

Out come probabilities for every tag in the model's vocabulary. Those get filtered against two thresholds and bucketed by tag category: general (attributes, clothing, pose), rating, and character/copyright/artist. What survives is recombined into the four output strings.

The inputs that matter

The defaults are genuinely fine to leave alone, which is rare for a node like this. The two you'll actually touch:

  • threshold (default 0.35) - the probability bar for general tags. Lower it and you get more tags but more junk; raise it and output gets sparse but cleaner.
  • character_threshold (default 0.85) - deliberately high so characters don't sneak in from weak matches.
  • exclude_tags - a comma-separated kill list. This is where you delete whatever always annoys you (watermarks, an artist you don't want to copy).

trailing_comma and sort_tags are output formatting; turn on sort_tags when you're captioning so the confident tags come first.

Outputs

Four strings, each one per image in your batch (so a batch gives you a list of strings in order):

  • tags - character + general combined. This is the one you wire into a CLIP Text Encode node, or into Save Text / Preview Text.
  • general_tags / character_tags - the two halves split apart, if you want them separate.
  • rating - the single top rating tag: safe / sensitive / questionable / explicit.

Install

ComfyUI Manager: search "Booru Tagger". Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/nestflow/ComfyUI-Booru-Tagger

Then make sure the Python deps are present - the pack needs onnxruntime and pandas (grab onnxruntime-gpu instead if you want CUDA acceleration). The model itself downloads automatically on first use into ComfyUI/models/booru_tagger/.

Where people get burned

The model download happens in the Loader, not this node - if the graph stalls with a progress bar on load, that's the download, not a hang. The whole pack is written on ComfyUI's newer Node v3 API, so it needs a reasonably recent ComfyUI; on an older install the nodes simply won't appear. And if you picked a gated model (CL Tagger v2, AnimeTimm), the loader will 401 until you've logged into HuggingFace. All of that is fixable in the loader article - the payoff here is that once it's loaded, tagging is instant.

CategoryBooruTagger

Inputs (9)

NameTypeDefaultDescription
tagger_modelTAGGER_MODEL
tagger_infoTAGGER_INFO
imageIMAGE
thresholdFLOAT0.350–1
character_thresholdFLOAT0.850–1
use_best_thresholdBOOLEANtrueUse AnimeTimm's per-tag best_threshold values as minimum thresholds.
trailing_commaBOOLEANfalse
sort_tagsBOOLEANfalse
exclude_tagsSTRING

Outputs (4)

NameTypeDescription
tagsSTRING
general_tagsSTRING
ratingSTRING
character_tagsSTRING