BSS WD14 Batch Tagger 🌿
Auto-caption a folder of anime images without leaving ComfyUI
- image
- tags
This is the node you reach for when you need to caption a pile of anime images for LoRA training without bouncing out to a webui extension to do it. It runs one of the WD14 v3 models against an image and hands you back a comma-separated string of Danbooru-style tags - the exact vocabulary Illustrious, NoobAI, and the Pony family were trained on, so it's the caption format their training data wants (see the danbooru-tags knowledge panel for why). For anything on the tagged-anime lineage, WD14 remains the community-standard captioner, and this node does it in-graph.
One honesty note up front: the name oversells it slightly. "Batch Tagger" actually tags one image per call. The pack's sibling node BSS WD14 Tagger Batch ⚡ is the true multi-image one; this one is built to pair with BSS Load Images from Folder, where ComfyUI pushes each image through and this node writes the caption file.
How it works
On the first run the node downloads the selected model from Hugging Face - the pack pulls model.onnx plus the selected_tags.csv tag list from SmilingWolf's wd-*-tagger-v3 repos into its own models/ folder (a few hundred MB, so the first run needs network and patience). From then on it's plain ONNX inference: the image is resized to the model's input square, letterboxed on white, converted to the BGR float format the model expects, and scored against roughly seven thousand tags. Anything above its threshold survives; the rest is dropped. The model stays cached in memory between calls, so a folder's worth of images doesn't re-download anything.
The inputs that actually matter
Most of the ten inputs have sane defaults; you'll touch these:
- model - four WD14 v3 choices: ViT (default), SwinV2, EVA02 Large, ConvNeXT. The dropdown even marks which ones are already downloaded. Community shorthand: SwinV2 is the reliable all-rounder for anime, EVA02 Large the bigger, more accurate one if you have time and VRAM. ViT as the default is a fine place to start.
- threshold (0.35) and character_threshold (0.85) - the tag confidence cutoffs. General tags use the first; character tags get their own, much stricter bar so the model doesn't hallucinate a character every time a face is ambiguous. These are the WD14-recommended starting points; resist dropping the general one below ~0.25 or you'll get garbage.
- replace_underscore (on) - turns
1girl_blue_hairinto1girl blue hair. Leave it on unless your trainer prefers underscores. - prepend_tags and exclude_tags - prepend forces tags to the very front of the string, which is where you slip in a trigger word; exclude is a comma-separated list of tags to veto outright.
- use_gpu (off) - only helps if your onnxruntime build actually has the CUDA execution provider, see below.
You also must feed image, filename, and folder_path - that's the loader's other outputs wiring straight in. If folder_path is set, the node writes a .txt caption next to each image using filename as the stem. That's the feature: folder of images in, image-plus-txt out, no Save node required.
Output
Just one: tags, a single string, comma-separated and ready to paste into a CLIP Text Encode or dump to a file. Because the node is marked as an output node it shows up as a terminal in the graph, but you can still run it through postprocessing if you want.
Install and the one thing that bites
Install via ComfyUI Manager → search BSS WD14 Batch Tagger → restart, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/BlackSnowSkill/wd14_batch_tagger
cd wd14_batch_tagger
pip install -r requirements.txt
Dependencies are onnxruntime>=1.18.0,<2.0.0, numpy, pillow, and huggingface-hub. The onnxruntime pin is the classic source of pain: it's a notoriously finicky package that other nodes also touch, and version clashes produce import errors at ComfyUI startup. The pack's installer force-reinstalls the right version, so if the node fails to load, reinstall onnxruntime>=1.18.0,<2.0.0 into the environment ComfyUI actually runs from, and restart.
Two more honest warnings. First, use_gpu does nothing if you only have the stock CPU build - the requirements install plain onnxruntime, so on Windows you'd need onnxruntime-gpu for the CUDA toggle to bite. Without it the node logs a warning and falls back to CPU, which is workable but slow for a big dataset. Second, the first-run model download is the other place people get stuck: if it fails, check network access to Hugging Face - partial files linger in models/ until retried. Everything else is genuinely straightforward - this is one of those nodes that just works once the runtime cooperates.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| filename | STRING | — | |
| folder_path | STRING | — | |
| model | COMBO | wd-vit-tagger-v3 | 4 options: wd-vit-tagger-v3|⬇️ WD ViT Tagger v3 (wd-vit-tagger-v3), wd-swinv2-tagger-v3|⬇️ WD SwinV2 Tagger v3 (wd-swinv2-tagger-v3), wd-eva02-large-tagger-v3|⬇️ WD EVA02 Large Tagger v3 (wd-eva02-large-tagger-v3), wd-convnext-tagger-v3|⬇️ WD ConvNeXT Tagger v3 (wd-convnext-tagger-v3) |
| threshold | FLOAT | 0.350–1 | — |
| character_threshold | FLOAT | 0.850–1 | — |
| replace_underscore | BOOLEAN | true | — |
| use_gpu | BOOLEAN | false | — |
| prepend_tags | STRING | — | |
| exclude_tags | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tags | STRING | — |