Local FastAPI + React workflow that threshes a media dump into destination bins — anime/GIF/video tagging, review, and folder migration (ML-Danbooru / WD taggers).
React SPA with sectioned settings, run dashboard, and review table
Multi-model inference via dghs-imgutils (ML-Danbooru ONNX and WD14 taggers)
ONNX weights are not stored in this git tree (too large for GitHub). They are downloaded into the Hugging Face Hub cache on first use. See Model weights for direct links.
What The Web UI Does
Settings — paths, tagger model, thresholds, workers; sticky unsaved save bar
Tag selection — search chips from tags.csv (auto-persisted)
Preview scan — eligible image counts before starting a run
Run dashboard — status, totals, failed/review counts, progress bar, cancel
Review table — preview, primary (or “needs review”), secondary suggestions, global top-5 tags, final tag, approve/migrate
Tagger Models
Choose in Settings (persisted in SQLite as tagger_model):
Setting value
Backend call
Notes
wd_swinv2_v3 (default)
get_wd14_tags(..., model_name="SwinV2_v3")
Recommended accuracy baseline
wd_eva02_large
get_wd14_tags(..., model_name="EVA02_Large")
Larger / slower WD tagger
ml_danbooru
get_mldanbooru_tags(..., threshold=0.0, size=448)
Original ML-Danbooru path
Related settings:
confidence_threshold (default 0.6) — assignment gate for selected tags
Extensionless / odd extensions are included when PIL can decode them
By default ignored: .gif and common video formats
Optional experimental media: quality-filtered multi-frame sampling with presence pooling (require ≥2 corroborating frames; tagged budget up to 48; black/blank frames rejected) when enabled in settings
GPU Acceleration
Inference uses ONNX Runtime CUDA when the pip CUDA/cuDNN wheels are installed and discoverable.
On Windows the API prepends site-packages/nvidia/*/bin to the DLL search path before creating sessions. Without that, ORT may list CUDA then fall back to CPU on the first Conv.
CUDA usability is independent of which tagger model is selected; both ML-Danbooru and WD14 share the ORT runtime path.
Look for "cuda_usable": true, "likely_device": "gpu", and active_providers containing CUDAExecutionProvider. Listing CUDA alone is not enough. The providers payload also echoes the active tagger_model.
Runtime controls
Settings UI values are mirrored into env knobs used by the run executor:
MAX_INFERENCE_WORKERS (default 2, clamped 1..16)
FORCE_CPU_INFERENCE=true
INFERENCE_MODE=batch|single (default single in practice for imgutils; batch falls back to per-image)