Skip to content

The ultimate open-source AI tagging tool for image galleries using metadata, or .txt files for AI training. Using newest wd-vit-tagger-v3 model by SmilingWolf

License

Notifications You must be signed in to change notification settings

Deiwulf/AI-image-auto-tagger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Image Auto Tagger

ScreenCap.png

The successor of WD14 tagger and an alternative to DeepDanbooru - now with a metadata saving feature for NSFW-oriented gallery tagging (optimized for digiKam). Currently using wd-vit-tagger-v3 model by SmilingWolf which is newer than WD14 and latest DeepDanbooru. Using CUDA and ONNX library over Gradio WEBUI. Tested on Windows.

Features

  • Output: There are 2 output modes: embedding tags directly into images for galleries OR .txt files for AI training
  • Supported models: Latest WaifuDiffusion v3 tagger architecture featuring SmilingWolf/wd-vit-tagger-v3 model
  • Supported files: JPG/JPEG (recommended), PNG, WEBP, GIF, BMP(no metadata)
  • Easy user interface: By utilizing gradio for GUI, the usage of this script should be smooth
  • Process subdirectories: recursively goes through all directories within a given one. In case of writing tags to .txt, it mirrors the folder structure
  • User preferred threshold: Using the gradio slider, the user can adjust the threshold of the tagger model
  • Hide rating tags: You can choose whether to output the rating tags (Like "General", "Explicit", "Questionable", etc) or not
  • Character tags first: This feature makes the character name tag appear in front of others
  • Remove separator: This function will remove the standard separator "_" of the tags in the output caption
  • Overwrite existing metadata tags: wipes clean any existing tags in metadata before writing new ones (XMP:Subject and IPTC:Keywords)

How to run

Python >3.10 and CUDA GPU is required to run this script. Download from https://www.python.org/downloads
ExifTool >12.15 is required. Download from https://exiftool.org

Steps to run:

  1. Clone this repository git clone https://github.com/Deiwulf/AI-image-auto-tagger.git OR download as a zip and extract
  2. Navigate to the directory cd AI-image-auto-tagger
  3. Set up a virtual environment python -m venv venv *
  4. Activate the new venv: *
    • Windows: venv\scripts\activate
  5. Install the requirements pip install -r requirements.txt
    • Optionally visit https://pytorch.org/ and install one fitting your system for a performance boost (~69% here)
  6. Run the script python wdv3tagger.py OR use start.bat on Windows (using venv)

* Virtual environment is optional, but recommended to keep this isolated. You can skip to step 5 if you want to install and run in a global environment

Disclaimer

This has been thoroughly tested, but still do be savvy and back up before running, and report issues if any.

Was this free tool useful to you?

ko-fi

About

The ultimate open-source AI tagging tool for image galleries using metadata, or .txt files for AI training. Using newest wd-vit-tagger-v3 model by SmilingWolf

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Batchfile 0.4%