Nodes/cgem156-ComfyUI๐ŸŒ/WD Tagger Similarity ๐ŸŒ
ComfyUI Node

WD Tagger Similarity ๐ŸŒ

Find related Danbooru tags, not tag an image

By laksjdjfยทCreated 2 years agoยทUpdated about a month agoยท 93
WD Tagger Similarity ๐ŸŒ
  • tagger
  • labels
  • STRING
โ—„tagโ€”โ–บ
โ—„categoryโ–พโ–บ
โ—„ascendingfalseโ–บ

Easy to mix up with PredictTag from the same pack, so let's be clear up front: this node does not look at an image. It doesn't take an IMAGE input at all. What it does is take a tag you already know and find tags that are semantically close to it, using the WD Tagger model's own internal representation of the Danbooru tag vocabulary - a tag thesaurus, effectively, built on the same model that normally captions images.

Why this is useful

Danbooru's tag vocabulary is huge and specific: dutch_angle, looking_at_viewer, long_hair versus very_long_hair, dozens of near-synonym clothing tags. If you're building a prompt or exploring what a WD-tagger-trained model (Illustrious, NoobAI, and friends) actually understands, knowing the neighbors of a tag you already have - synonyms, more specific variants, related concepts - is genuinely useful, and it's not something a captioning run gives you directly.

Inputs and outputs that matter

  • tagger and labels - the loaded WD Tagger model and its label set, both produced by a separate loader node earlier in your graph (not covered in this article; look for the pack's WD-tagger loader node).
  • tag - the tag you're starting from, typed in as text.
  • category - restrict the search to one of Danbooru's tag categories (general, character, artist, copyright, meta) rather than searching across all of them at once.
  • ascending - sort order for the results; toggle it to flip between "most similar first" and "least similar first," which is handy if you're hunting for genuinely different tags to compare rather than near-duplicates.
  • Output: STRING - the resulting tag(s), ready to drop into a prompt.

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. This node needs an upstream WD Tagger loader connected to its tagger/labels inputs - that loader pulls SmilingWolf's WD-tagger v3 weights from Hugging Face the first time you run it, so expect a model download on first use even though this specific node has nothing to download itself.

Common issues & troubleshooting

Results look unrelated to what you expected. Similarity here is in the model's learned embedding space, not a plain-English notion of "similar." Two tags can be close because they co-occur constantly in the training data, not because they mean the same thing to a human - treat the output as a starting point to browse, not a guaranteed synonym list.

No tagger/labels connected. Both are required inputs and neither has a default - you need the pack's WD Tagger loader node upstream before this one will run at all.

Category filter returns nothing. If your tag and your selected category don't actually match (e.g. typing a character name while filtering to general), you'll get an empty or unhelpful result. Match the category to the kind of tag you typed.

Wrong tool for tagging an image. If what you actually want is "what tags describe this picture," that's PredictTag, not this node - this one only ever starts from a tag you already have.

Categorycgem156 ๐ŸŒ/wd-tagger

Inputs (5)

NameTypeDefaultDescription
taggerWD_TAGGERโ€”
labelsWD_TAGGER_LABELSโ€”
tagSTRINGโ€”
categoryCOMBO3 options: all, general, character
ascendingBOOLEANfalseโ€”

Outputs (1)

NameTypeDescription
STRINGSTRINGโ€”