Nodes/cgem156-ComfyUI๐ŸŒ/Predict Tag ๐ŸŒ
ComfyUI Node

Predict Tag ๐ŸŒ

Run WD Tagger v3 on an image to get Danbooru tags

By laksjdjfยทCreated 2 years agoยทUpdated about a month agoยท 93
Predict Tag ๐ŸŒ
  • tagger
  • labels
  • image
  • BATCH_STRING
  • STRING
  • WD-TAGGER-FEATURES
โ—„ratingfalseโ–บ
โ—„character_thereshold0.850โ–บ
โ—„general_thereshold0.350โ–บ

This is the actual image-tagging node in cgem156's wd-tagger family - feed it a picture, get back Danbooru-style tags. It wraps SmilingWolf's WD Tagger v3 (the README links both SmilingWolf's Hugging Face and the neggles/wdv3-timm implementation it's built on), which is the same tool the wider community reaches for to auto-caption anime-style training data for Illustrious, Pony, and NoobAI, where the base models were themselves trained on Danbooru-tag captions rather than natural-language sentences.

How it works

The image goes through the tagger model, which scores every tag in its vocabulary by confidence. This node then keeps whatever clears your threshold settings and returns it as text - no manual tag review needed for the common case, though you should still spot-check the output before trusting it wholesale for anything you're training on.

Inputs and outputs that matter

  • tagger and labels - the loaded model and label set, supplied by an upstream WD Tagger loader node (not covered in this article).
  • image - the picture to tag.
  • rating (default off) - include Danbooru's content-rating tags (general/sensitive/questionable/explicit) in the output, not just descriptive tags.
  • character_thereshold (default 0.85) and general_thereshold (default 0.35) - yes, that's how the fields are actually spelled in this node; a typo worth knowing about if you're ever setting these programmatically via the API rather than clicking the widget. These set the confidence cutoff for character tags versus general tags separately, and the gap between them (0.85 vs 0.35) is deliberate: character tags need a much higher bar before the model commits to naming a specific character, while general descriptive tags (pose, clothing, setting) tolerate a looser threshold before they're worth including.
  • Outputs: BATCH_STRING, STRING (a joined/comma-separated tag string, the form you'd typically paste into a prompt or a caption file), and WD-TAGGER-FEATURES (the raw feature output, meant for other nodes in the pack that consume it rather than for you to read directly).

Installing it

ComfyUI Manager โ†’ search cgem156-ComfyUI๐ŸŒ โ†’ install โ†’ restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/laksjdjf/cgem156-ComfyUI

then restart ComfyUI. You also need the pack's WD Tagger loader node upstream, which downloads SmilingWolf's WD-tagger v3 weights from Hugging Face the first time you run it - expect that download on first use.

Common issues & troubleshooting

Typo'd field names breaking API calls. If you're building or editing workflow JSON by hand (or hitting the ComfyUI API directly) rather than clicking through the UI, remember the exact spelling: character_thereshold and general_thereshold, not "threshold." Get this wrong in a script and the node will either ignore your override or error, depending on how you're calling it.

Too many or too few tags. Raise general_thereshold if you're getting noisy, low-confidence tags you don't want; lower it if the output feels sparse. character_thereshold is worth raising further still if you're getting confident-sounding but wrong character names - false character IDs are the most damaging kind of tagging error for training data.

Tags don't match what the target model expects. WD Tagger's vocabulary is Danbooru's - great for Illustrious/Pony/NoobAI, not what you want if you're captioning for a natural-language model like Flux, which wants prose descriptions instead of comma-separated tags.

No tagger/labels connected. Both are required - you need the pack's loader node upstream before this one runs.

Categorycgem156 ๐ŸŒ/wd-tagger

Inputs (6)

NameTypeDefaultDescription
taggerWD_TAGGERโ€”
labelsWD_TAGGER_LABELSโ€”
imageIMAGEโ€”
ratingBOOLEANfalseโ€”
character_theresholdFLOAT0.8500โ€“1.001โ€”
general_theresholdFLOAT0.3500โ€“1.001โ€”

Outputs (3)

NameTypeDescription
BATCH_STRINGBATCH_STRINGโ€”
STRINGSTRINGโ€”
WD-TAGGER-FEATURESWD-TAGGER-FEATURESโ€”