wdtagger is a local image tagging tool that uses onnxruntime and HuggingFace-hosted ONNX models (e.g. wd-vit-tagger-v3) to generate Danbooru-style tags for images stored in a BlobPics (Cloudflare Worker + R2) bucket.
It downloads the model and tag CSV on first run, performs OpenCV-based preprocessing, and applies a configurable confidence threshold.
Each tagged image is saved as a local .json file and automatically uploaded to your BlobPics backend via a POST /upload-json API.
- Python 3.11+
uvpackage manager (or pip)- Access to a BlobPics site (Cloudflare Worker + R2, with
/list,/original/,/upload-json) - Internet access (for HuggingFace model download)
- CUDA-compatible GPU (optional)
git clone https://github.com/Mooshieblob1/wdtagger.git
cd wdtagger
python3 -m venv .venv
source .venv/bin/activate
uv pip install -r requirements.txtSet your BlobPics domain in the script (test_tagger.py):
DOMAIN = "blobpics.tech"Run the script to fetch all images, tag them, and upload tag data to your site:
python test_tagger.pyThis will:
- Get image IDs from your BlobPics
/listendpoint - Download each image and generate tags
- Save
.jsonfiles locally (one per image) - POST tags to your BlobPics
/upload-jsonAPI
To continuously tag new images every 60 minutes:
./persistent_runner.shOr run in the background:
nohup ./persistent_runner.sh > tagger.log 2>&1 &If you change your TAG_THRESHOLD and want to regenerate all tags:
rm tagged_images.json
python test_tagger.pyEdit the top of test_tagger.py:
DOMAIN = "blobpics.tech" # Your BlobPics site
TAG_THRESHOLD = 0.5 # Minimum confidence to keep tag
TAG_BLACKLIST = ["blue_skin"] # Tags to ignore completely| File | Purpose |
|---|---|
test_tagger.py |
Tags images from BlobPics & uploads tags via API |
persistent_runner.sh |
Optional: loops tagging every hour |
requirements.txt |
Dependencies for the project |
tagged_images.json |
Output tag cache (local copy) |
MIT — use freely with credit.