Skip to content

stark-eater/PixAI-Tagger-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

PixAI-Tagger-Code

Here, my latest program in python 3.11.9 which uses PixAI's open source tagger and deepghs's imageutils library to tag multiple images.

It is NOT vibe coded. You can check it yourself.

It can even tag nested folders, and the output has the same folder structure as the INPUT.

It uses embedded python, so you don't have to install it.

The install.bat file will install the dependencies in the python-embed folder. You need to run it by double-clicking on it for the very first time, and only once.

The run.bat file will run the python program ForCombined-Final.py.

The ONNX model and required csv files will automatically get downloaded to appropriate locations within C:\Users\username\.cache\huggingface folder when the run.bat file will be ran for the very first time. I am assuming you have Windows installed in your C: drive.

The OUTPUT will have 2 folders - with_underscores and without_underscores - and each folder will have the same directory structure as input.

Which means, if you put individual images without folders in the INPUT folder, you will get individual images with their corrsponding tags as .txt files in both folders of the OUTPUT. And, if you put nested folders (useful for tagging images needed for making multi-concept loras) as INPUT, then the OUTPUT will be faithful to the same folder structure.

Note: It works only in Windows (mine is Windows 10, but it works in Windows 11 too (speaking from experience with other python codes, since I downgraded from Windows 11 to Windows 10 weeks ago).

If you are using Linux, then the code will be slightly different since Windows uses backslashes in the path and Linux uses forward slashes in the directory path, and you will need to build the python version corresponding to your own OS (mine is Fedora KDE 42, yours might be Ubuntu Jammy), or create a virtual environment.

Yes, an ordinary user will be able to run it too, hopefully.

Oh, and it is NOT vibe coded. You can check it yourself.

Obviously, I must mention them - All thanks to PixAI for making a tagging model. And all thanks to deepghs for converting it to ONNX and making it accessible through a python library.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors