Standalone Danbooru-style tag search using WD Tagger
  • Python 86.3%
  • PowerShell 13.7%
Find a file
2026-05-21 12:55:04 -04:00
.gitignore Add .gitignore 2026-05-21 12:55:04 -04:00
danbooru_search.py Simplify: in-memory only, no cache, search+copy/move 2026-05-21 12:52:37 -04:00
README.md Update README: in-memory only 2026-05-21 12:53:04 -04:00
requirements.txt Add setup.ps1 and requirements.txt 2026-05-21 12:46:38 -04:00
setup.ps1 Add setup.ps1 and requirements.txt 2026-05-21 12:46:38 -04:00

Danbooru Tag Search

Standalone Danbooru-style tag search using WD Tagger v3. All in memory — no cache, no database.

Setup

.\setup.ps1
.\.venv\Scripts\Activate.ps1

Usage

# Copy matches to destination
python danbooru_search.py search /path/to/images \
    --tag solo_focus --threshold 0.5 --dest /path/to/output

# Multiple tags (AND — all must match)
python danbooru_search.py search /path/to/images \
    --tag 1girl abs --threshold 0.5 --dest /path/to/output

# Multiple tags (OR — any match)
python danbooru_search.py search /path/to/images \
    --tag 1girl solo_focus --any --threshold 0.5 --dest /path/to/output

# Move instead of copy
python danbooru_search.py search /path/to/images \
    --tag solo_focus --threshold 0.5 --dest /path/to/output --move

# Dry run (preview)
python danbooru_search.py search /path/to/images \
    --tag solo_focus --threshold 0.5 --dest /path/to/output --dry-run

Options

Flag Description Default
--tag, -t Tag(s) to search for (repeatable) required
--threshold Minimum tag confidence score 0.5
--dest, -d Output directory required
--any OR logic (any tag matches), default is AND (all must match) False
--move Move instead of copy False
--dry-run Preview without copying/moving False

Notes

  • Uses p1atdev/wd-swinv2-tagger-v3-hf (WD Tagger v3, SwinV2-based, trained on Danbooru)
  • All tagging is done in-memory — no SQLite cache, no disk persistence
  • Model is lazy-loaded on first use