ComfyUI Node

WD Tagger

Turn an image into Danbooru tags

By mirabarukaso·Created 2 years ago·Updated 9 days ago· 206
WD Tagger
  • image
  • tags
model_name
general_threshold0.35
character_threshold0.85
general_mcutfalse
character_mcutfalse
replace_spacetrue
categoriesrating,general,character
exclude_tags
session_method

Feed it an image, get back a comma-separated string of Danbooru tags. That's the whole job, and it's a job you end up needing constantly: 1girl, long hair, looking at viewer, dutch angle, outdoors and so on, pulled straight off a picture. This is a ComfyUI wrapper around SmilingWolf's WD taggers - the same "WD14 tagger" that shows up in every LoRA-training tutorial for anime models - living inside mirabarukaso's grab-bag ComfyUI_Mira pack alongside a hundred-odd other utility nodes.

Why reach for it? Two reasons. First, captioning a dataset. If you're training a LoRA on Illustrious, Pony, or NoobAI, those bases learned the exact Danbooru vocabulary, so a comma list of correct tags beats a written sentence for controlling pose, clothing, and camera. WD14 is the de-facto standard here - auto-taggers like Anima's one-page trainer ship wd-eva02-large-tagger-v3 under the hood for exactly this. Second, reverse-engineering a reference image: drop a picture in, read the tags back out, paste them into your prompt, tweak. Fastest way to get a Danbooru-model prompt in the ballpark without typing tags from memory.

How it works

It's an ONNX image classifier, not a generative model. The tagger scores every tag it knows against your image; the node keeps the ones above your threshold and drops the rest. It runs locally - nothing calls out at run time. The two model files people actually use are wd-eva02-large-tagger-v3 (the accurate one, what I'd default to) and wd-vit-large-tagger-v3 (a touch faster, slightly less sharp).

Inputs that matter

Most of the ten inputs you can leave alone. The handful worth understanding:

  • model_name - picks the ONNX model. If this dropdown only shows None, you haven't downloaded a model yet (see install below). This is the number-one thing people trip on.
  • general_threshold (default 0.35) - the confidence cutoff for ordinary tags. Lower it and you get more tags, including noise; raise it and you keep only what the model's sure about. 0.35 is a sane default - leave it unless the output is too sparse or too junky.
  • character_threshold (default 0.85) - the cutoff for named characters, deliberately much higher. A wrong character name baked into every caption poisons a whole dataset, so the node errs toward silence. Don't drop this without a reason.
  • general_mcut / character_mcut - instead of a fixed number, mCut (maximum-cut thresholding) finds the natural gap between the confident predictions and the unconfident ones and cuts there, per image. Handy when a single fixed threshold is too loose on one picture and too tight on the next. It overrides the manual threshold when you switch it on.
  • categories (default rating,general,character) - which tag groups to emit and in what order. rating is the general/sensitive/nsfw/explicit token, general is the bulk of it, character is named characters. Drop rating if you don't want the content-rating token in your caption.
  • exclude_tags - a comma list of tags to strip out. Useful for killing a tag you never want in the output.
  • session_method - CPU, CPU Release, GPU, or GPU Release. GPU is faster if you have the VRAM to spare; the Release variants free the model from memory after each run so it isn't parked in VRAM between generations. Tag occasionally, or short on VRAM? Pick a Release variant.

The single output is tags - a plain string. Wire it into a CLIP Text Encode, a text-combine node, a caption/metadata saver, or a ShowText node so you can actually eyeball what it produced. Feed multiple images in and you get one line of tags per image.

Installing it

Standard drill. In ComfyUI Manager, open the Custom Nodes Manager, search ComfyUI_Mira, hit Install, restart. Or from a terminal:

cd ComfyUI/custom_nodes && git clone https://github.com/mirabarukaso/ComfyUI_Mira.git

then restart ComfyUI. If it errors on load, run pip install -r requirements.txt inside the ComfyUI_Mira folder - that pulls the ONNX runtime it needs.

The model is a separate download and this is the step people skip. Grab a WD tagger - wd-eva02-large-tagger-v3.onnx plus its wd-eva02-large-tagger-v3_selected_tags.csv - from SmilingWolf on Hugging Face, and drop both into ComfyUI/models/onnx/wd_tagger/. The .onnx and the matching _selected_tags.csv must sit together with the same base name; the node scans that folder to fill the model_name dropdown.

Where people get burned

model_name stuck on None is almost always a missing or misfiled model - check the folder is models/onnx/wd_tagger/ and the CSV name matches the ONNX name. If the GPU session runs slowly, your ONNX runtime probably can't find a GPU provider and quietly fell back to CPU; it still works, just not fast. And if your output reads as a wall of half-confident garbage, that's a threshold problem - nudge general_threshold up or flip general_mcut on and let it pick the cut for you.

CategoryMira/Tagger

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
model_nameCOMBO1 options: None
general_thresholdFLOAT0.350.05–1
character_thresholdFLOAT0.850.05–1
general_mcutBOOLEANfalse
character_mcutBOOLEANfalse
replace_spaceBOOLEANtrue
categoriesSTRINGrating,general,character
exclude_tagsSTRING
session_methodCOMBO4 options: CPU, CPU Release, GPU, GPU Release

Outputs (1)

NameTypeDescription
tagsSTRING