Load WD14 model (timm)
Load the WD14 tagger (the accurate, heavy way)
- ui_widget
- tagger
This is the loader half of LF's tag-captioning pair: LF_LoadWD14Model gives you a ready-to-run WD14 tagger object, which you then feed into LF_CaptionImageWD14 along with an image to get booru tags out. Think of it as the "make me a tagger" node - the tagger output is a processor + model + settings bundle, not anything you can see on screen.
WD14 (the Danbooru tagger, from the wd-vit-* model family) is the standard tool for captioning anime-image datasets the way Illustrious/Pony/NoobAI were trained. It doesn't describe scenes; it emits the known tag vocabulary with confidence scores. That's a feature, not a limitation - the durable community practice is to run WD14 for tags and a natural-language describer like Florence-2 for scene context, then concatenate.
How it works
Default model_id is SmilingWolf/wd-vit-large-tagger-v3, the current generation of the SmilingWolf tagger family. The node's primary path loads it through HuggingFace transformers; the parameters architecture (vit_large_patch16_224), num_classes (10861), image_size (448) and the mean/std strings are the timm fallback path, kept for compatibility. In practice: leave them alone unless you know you're running the fallback.
The knobs that matter are in the optional section:
min_probability(default0.25) - tags below this confidence get dropped. Lower it if the captions miss things you want; raise it if they're noisy.max_tags(default20) - how many tags max per image. For training captioning, 20 is a reasonable ceiling; you can push toward 30–40 for a detailed set.tags_to_exclude- comma-separated tags to always strip (e.g.watermark, signature). Supports TagGUI-style escaped commas if a tag itself contains one.
The single output, tagger, carries the loaded processor + model + those defaults straight into LF_CaptionImageWD14.
Installing it
Part of lf-nodes, one install covers it:
cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/lf-nodes
restart ComfyUI (or use ComfyUI Manager → "LF Nodes"). Requirements include transformers, timm, and torchvision. The big cost is the model itself: the vit-large tagger is roughly a 1.3GB download from HuggingFace on first load, cached afterward.
Choosing between this and the ONNX loader
lf-nodes ships two WD14 loaders. LF_LoadWD14Onnx runs the same model through onnxruntime - lighter on VRAM, happier on CPU, slightly fiddlier setup. This node (HF/timm) is generally the higher-fidelity path and the one to pick when you have a GPU to spare and care about tag accuracy on a training set. If you're captioning thousands of images on a modest machine, the ONNX version is the pragmatic choice. Where people get burned: forgetting the first-load model download exists and assuming the workflow is stuck.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model_id | STRING | SmilingWolf/wd-vit-large-tagger-v3 | HuggingFace WD14 model ID. |
| architecture | STRING | vit_large_patch16_224 | timm architecture for fallback path (kept for compatibility). |
| num_classes | INT | 10861 | Number of classes/tags for WD14 model (used only in timm fallback). |
| image_size | INT | 448 | Input image size for WD14 in timm fallback (Transformers path ignores this). |
| mean | STRING | 0.5,0.5,0.5 | Mean for normalization in timm fallback (comma-separated). |
| std | STRING | 0.5,0.5,0.5 | Std for normalization in timm fallback (comma-separated). |
| min_probabilityopt | FLOAT | 0.250–1 | Minimum confidence to keep a tag when using the HF/timm backend. |
| max_tagsopt | INT | 20 | Maximum number of tags to output when using the HF/timm backend. |
| tags_to_excludeopt | STRING | Tags to exclude (comma-separated; TagGUI-style escaped commas are supported). | |
| ui_widgetopt | LF_CODE | [object Object] | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tagger | TAGGER | WD14 HF/timm tagger object (processor + model + defaults). |