WD14 Tagger
WD14 tagging inside ComfyUI, no webui extension required
- image
- tags
If you've ever captioned a LoRA dataset for an anime model, you know the drill: every image needs a comma-separated list of Danbooru tags, and the standard tool has been SmilingWolf's WD14 tagger - usually bolted onto a webui extension or a script you run outside ComfyUI. This node is the version that stays inside the graph. Same ONNX models, same tag vocabulary, no API key, no second UI to babysit.
WD14 is what you want whenever you need to turn an image back into tags: captioning training data for Illustrious, Pony or NoobAI (the playbook is blunt about this - those bases were trained on Danbooru-style tags, so a WD14-style caption beats a natural-language one), or reverse-tagging an image you like so you can feed its tags straight back into a CLIP Text Encode and rework it. It's one of three tagger nodes in the small booru-helper-mini pack, alongside a Camie tagger and a PixAI tagger, and it's the one most people actually need.
How it works
On first use the node downloads the model's model.onnx and its selected_tags.csv from the SmilingWolf/... repo on HuggingFace and stashes them under models/wd14/ in the node folder. Then it's plain onnxruntime: your image gets resized to 448px, padded to square with white, flipped to BGR, and pushed through the model in real batches - batch_size actually batches, it's not cosmetic. Logits go through a sigmoid and get thresholded in vectorized numpy, splitting on tag category from the CSV (general, character, and rating are kept as separate index lists).
Two details are worth knowing. First, there's a separate character_threshold (default 0.85) from the general threshold (default 0.35), because character names are precise and you don't want a mis-tag. Second, sessions are LRU-cached (two most recent), so bouncing between a v1.4 and a v3 model doesn't reload from disk every time you switch - a genuinely thoughtful touch for a pack this small.
The inputs that matter
- model - 11 SmilingWolf models, from the older
wd-v1-4-vit-taggerup to the v3 family (wd-eva02-large-tagger-v3is the accuracy king; the defaultwd-v1-4-moat-tagger-v2is the community old faithful). - threshold / character_threshold - the two knobs that change what you get out. Raise the general one to drop noise, raise the character one to only keep confident names.
- include_rating - off by default; flip it on to prepend the rating tag (general/sensitive/nsfw) to each caption.
The rest are boring but useful: exclude_tags (comma-separated, case-insensitive) to strip tags you never want, replace_underscore to turn long_hair into long hair, separator and trailing_comma for output formatting, and force_download to re-pull the model if a file got corrupted.
Output
One output, tags: a list of strings, one per image in the batch. Wire it into a prompt/conditioning node to reuse the tags, or into a caption-writing node when you're building a dataset. It's not an output node - it hands data onward, it doesn't display it.
Installing it
It's a small pack, so don't overthink it:
cd ComfyUI/custom_nodes
git clone https://github.com/adbrasi/booru-helper-mini
cd booru-helper-mini
pip install -r requirements.txt
Then restart ComfyUI. ComfyUI Manager can also find it if you search "booru-helper-mini". Dependencies are light: onnxruntime, huggingface_hub, Pillow, and timm (the last one is only really needed for the PixAI node's PyTorch backend - torch/torchvision come from ComfyUI itself).
Where people get burned
First run downloads the model, so it looks frozen for a bit - that's the download, not a hang. If you're on CPU, onnxruntime silently falls back from CUDA and a big batch_size will crawl, so keep it at 4 unless you're on a GPU. And if the model ever errors out mid-run, force_download re-fetches a clean copy rather than you hunting for a corrupt .onnx by hand. The pack is young and mostly unproven in the wild, but the WD14 mechanism it wraps is the most battle-tested tagger in the ecosystem - the thinness is in the wrapper, not the model.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model | COMBO | wd-v1-4-moat-tagger-v2 | 11 options: wd-eva02-large-tagger-v3, wd-vit-tagger-v3, wd-swinv2-tagger-v3, wd-convnext-tagger-v3, wd-v1-4-moat-tagger-v2, wd-v1-4-convnextv2-tagger-v2, +5 |
| batch_size | INT | 41–256 | — |
| threshold | FLOAT | 0.350–1 | — |
| character_threshold | FLOAT | 0.850–1 | — |
| separator | STRING | , | — |
| exclude_tags | STRING | — | |
| replace_underscore | BOOLEAN | false | — |
| include_rating | BOOLEAN | false | — |
| trailing_comma | BOOLEAN | false | — |
| force_download | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tags | STRING | — |