📁 Batch AnimeTimm Tagger
Caption a whole folder of anime images in one queue run
- summary
If you've ever built an anime dataset, you know the grind: load one image, tag it, save a .txt, repeat 200 times. This node kills that loop. BatchAnimeTimmTagger points at a folder, tags every image in it with the AnimeTimm model family, and writes one matching caption file per image - image.png becomes image.txt - all in a single queue operation. It's the dataset-prep convenience wrapper, not a fancy inference node, and it's very good at that one job.
The tagger itself is worth understanding before you install. AnimeTimm is a DeepGHS project: a family of timm-based vision models trained to predict Danbooru-style tags, newer and with fresher character knowledge than the classic WD14 line. The default convnextv2_huge.dbv4-full is the strongest of them - the community's go-to when WD14 misses a character. The trade: fewer tools support it, which is exactly why this pack exists. It reuses the model loader and inference code from MakkiShizu's ComfyUI-animetimm instead of bundling a second copy. That's a deliberate design call, and it's also the number-one gotcha, so hold that thought.
How it works
On queue, the node scans the top level of folder_path (no subdirectories - keep your dataset flat), builds a plan mapping each image to its .txt, and instantiates one AnimeTimmNode from the companion pack. The model loads once and is reused for the whole run, so a 500-image folder isn't 500 model loads. Each image goes through the same tagger with your settings, and the caption is written with an atomic write - an interrupted save can't leave a half-written .txt. It honors ComfyUI's cancel button mid-run, which matters more than you'd think on a big folder.
The output is a single summary STRING containing per-file results and final counts. This is an output node; you don't wire it into a render pipeline, you just queue it and read the summary.
The inputs that matter
folder_path- the images. Only the top level is scanned.output_dir- where captions land; leave empty to write next to the images.threshold(default0.35) - minimum confidence for a tag to survive. Lower it and you get tag spam; the default is the sensible starting point.model_repo- defaults toconvnextv2_huge.dbv4-full. Best accuracy, heaviest load. The smallmobilenet*options are there if you're tagging thousands of images and don't need the flagship.include_character(defaultFalse) - for a character dataset, flip this on; the whole point of convnextv2 is that it's good at names.include_rating(defaultTrue) - includes thegeneral/sensitive/nsfwrating tags anime-lineage models understand.replace_underscore(defaultFalse) - booru tags ship aslong_hair. Keep the underscores for Illustrious/NoobAI training; flip it only if your trainer or workflow wants spaces.use_custom_threshold- off by default, which lets the model use its own per-tag best thresholds. Turn it on if you want one blunt cutoff for everything.skip_existing(optional) - skip images that already have a.txt. Your resume button after an interrupted or partially-failed run.
Installing
First, install the companion - this pack will not work without it:
cd ComfyUI/custom_nodes
git clone https://github.com/MakkiShizu/ComfyUI-animetimm.git
git clone https://github.com/zzczzcx1/ComfyUI-BatchAnimeTimm.git
python -m pip install -r ComfyUI-animetimm/requirements.txt
Then restart ComfyUI. ComfyUI Manager covers it too: install ComfyUI-animetimm, then batch-anime-timm from the registry. The model itself isn't downloaded at install - it pulls from HuggingFace on first use, so the first run can take a minute (or a while, for the huge convnextv2 checkpoint).
Troubleshooting
- "AnimeTimmNode was not found" - you skipped the companion pack. This is the #1 failure mode, and the error message says it plainly.
- Model fails to load - check the ComfyUI console and that you can reach HuggingFace. A load failure stops the job cleanly; it won't silently write empty captions.
- A "collision" error naming
cat.jpg/cat.png- both map tocat.txt, so the node refuses rather than overwrite. Rename the offenders. - The run fails at the end over a corrupt image - the successfully written captions stick around, so fix the bad file and re-run with
skip_existingon.
One last thing worth saying: these are Danbooru tags, so use them for the tagged-anime lineage (Illustrious, NoobAI, that family). If you're captioning for Flux or another natural-language base, this is the wrong tool - you want a captioner, not a tagger.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | Folder containing images to tag (top level only) | |
| output_dir | STRING | Where to save .txt files. Leave empty to use folder_path | |
| threshold | FLOAT | 0.350–1 | — |
| model_repo | COMBO | animetimm/convnextv2_huge.dbv4-full | 20 options: animetimm/caformer_b36.dbv4-full, animetimm/caformer_m36.dbv4-full, animetimm/caformer_s18.dbv4-full, animetimm/caformer_s36.dbv4-full, animetimm/convnextv2_huge.dbv4-full, animetimm/convnext_base.dbv4-full, +14 |
| include_general | BOOLEAN | true | — |
| include_character | BOOLEAN | false | — |
| include_artist | BOOLEAN | false | — |
| include_rating | BOOLEAN | true | — |
| replace_underscore | BOOLEAN | false | — |
| use_custom_threshold | BOOLEAN | false | — |
| file_extensionsopt | STRING | .png,.jpg,.jpeg,.webp,.bmp,.gif | Comma-separated extensions. Animated GIFs use the first frame |
| skip_existingopt | BOOLEAN | false | Skip images whose destination .txt already exists |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| summary | STRING | — |