ComfyUI-BatchAnimeTimm
Batch-tag a folder of anime images with AnimeTimm and save matching UTF-8 caption files.
ComfyUI-BatchAnimeTimm
A focused ComfyUI output node that tags every image in a folder with
ComfyUI-animetimm and writes
one matching UTF-8 .txt caption file per image.
Required companion node: install ComfyUI-animetimm before using this extension. BatchAnimeTimm reuses its model loader and inference code; it does not download or bundle a second copy of AnimeTimm.
Why use it?
- Process a dataset folder with one node and one queue operation
- Write
image.pngtoimage.txtwith deterministic filename matching - Load the selected AnimeTimm model once and reuse it for the entire run
- Resume interrupted jobs by enabling
skip_existing - Control threshold, tag categories, model, and underscore formatting
- Stop safely through ComfyUI's cancel button
- Reject filename collisions instead of silently overwriting captions
- Use atomic writes so an interrupted save cannot leave a partial caption
Installation
ComfyUI Manager / Registry
- Install ComfyUI-animetimm.
- Install ComfyUI-BatchAnimeTimm (
batch-anime-timm). - Restart ComfyUI.
Manual
cd ComfyUI/custom_nodes
git clone https://github.com/MakkiShizu/ComfyUI-animetimm.git
git clone https://github.com/zzczzcx1/ComfyUI-BatchAnimeTimm.git
Install the upstream requirements using the same Python environment that runs ComfyUI, then restart ComfyUI:
python -m pip install -r ComfyUI-animetimm/requirements.txt
Usage
- Add Batch AnimeTimm Tagger from the
AnimeTimmcategory. - Enter the image folder and, optionally, a separate output folder.
- Choose the model and tag settings.
- Queue the workflow. The node's
summaryoutput contains the final counts.
An importable example is included in
workflow_example.json.
| Parameter | Default | Description |
|---|---|---|
| folder_path | empty | Folder containing source images; only the top level is scanned |
| output_dir | empty | Caption destination; empty means folder_path |
| threshold | 0.35 | Minimum confidence threshold |
| model_repo | animetimm/convnextv2_huge.dbv4-full | AnimeTimm model |
| include_general | True | Include general tags |
| include_character | False | Include character tags |
| include_artist | False | Include artist tags |
| include_rating | True | Include rating tags |
| replace_underscore | False | Replace underscores with spaces |
| use_custom_threshold | False | Ignore per-tag best thresholds |
| file_extensions | .png,.jpg,.jpeg,.webp,.bmp,.gif | Comma-separated extensions |
| skip_existing | False | Do not replace an existing destination caption |
Output and safety behavior
- Captions are comma-separated tag strings stored as UTF-8.
- Existing captions are replaced unless
skip_existingis enabled. - Animated GIF input uses its first frame.
cat.jpgandcat.pngwould both targetcat.txt; the node detects this before inference and stops with a list of conflicting files.- A model load failure stops the job and does not create an empty caption.
- Corrupt or unreadable images are reported at the end and make the ComfyUI
execution fail. Successfully written captions remain available, so the run
can be resumed with
skip_existing.
Development
Run the regression suite with a Python environment that provides ComfyUI's
normal torch, numpy, and Pillow dependencies:
python -m unittest discover -s tests -v
Acknowledgements
- ComfyUI-animetimm by MakkiShizu
- AnimeTimm models from animetimm
License
MIT