Skip to content
arenatemp edited this page Nov 30, 2022 · 2 revisions

Usage

Open a terminal where you would like to store the program then run:

git clone https://github.com/arenatemp/sd-tagging-helper.git
pip install pillow pyqt5==5.15.7
cd sd-tagging-helper
python helper.py

On Windows you can run start.bat after cloning the repo, this will install the dependancies into a venv and launch the program for you.

On first launch you will be asked for the input folder, this is the dataset folder with all the images you want to tag. A different dataset folder can be loaded later. The last loaded folder will be remembered for next launch.

The default resolution is 1024x1024. Most trainers will downscale the image to whatever resolution you are training with, so 1024 is safe.

In your chosen dataset folder, the staging and output folders will be created. Staging is used to store the tags you add to each image as well as its positioning information. Output is where packaged outputs will be saved.

Tagging

Tags can be added and removed by double clicking or selecting them and pressing Enter. If applicable, tags can be ordered by dragging or by selecting them and using the and arrow keys. The currently selected tag column can be cycled by Tab and Shift+Tab. The horizontal and vertical dividers around tag columns can be dragged to fit your specific use case.

The prompt for an image can be seen in the Output tab, this is the final exported prompt so will include global tags.

Search

This program provides a list of tags that can be searched. By default these are the danbooru tags but more can be added by the user. Any tag that is not in the list is considered unknown. Searching for an unknown tag will give the option to add it. Unknown tags are also highlighted in red, they can be right clicked for an option to add them. The search results are ordered by popularity, with user added tags always being at the bottom.

While searching the and arrow keys can be used to select a tag from the results, pressing Enter will add that tag and reset the searched text.

Stored in danbooru.csv. This file can be easily edited directly. The numbers in the file just indicate the color of the tag for when color mode is enabled, they can be ommitted if needed. User added tags are appended to the bottom and given the unique number 6 which corresponds to a cyan color.

Active

Shows the current tags applied to the shown image. Global tags are not shown. Tags can be ordered by dragging or selecting one and using the or arrow keys.

Favourites

Shows your Favourited tags, click the star next to any tag to favourite/unfavourite. These can also be ordered by the user.

Stored in config.json.

Suggestions

Shows your Frequently used tags. Using any tag will add it to the list, ordered by how many times the tag has been used.

Stored in config.json.

In the default layout this shares its space with the DeepDanbooru tags. If DeepDanboou tags are available for the image then the DeepDanbooru tags are shown preferentially. Click the bookshelf button to show the frequently used tags again. To use the alternate layout with seperate columns press Ctrl+L.

DeepDanbooru

The DeepDanbooru model can be used to interrogate an image for its tags. The blue interrogate button can be pressed to interrogate the current image. Tags are not automatically added to the image, they are just shown in the column. The input image for the model is the same as what is shown in the Output tab.

Right click the button for more options. 'Interrogate All' will interrogate the entire dataset at once. 'Add found tags' will add any found tags to the image, it is not recommended since it can easily ruin all the tagging you have done, especially with 'Interrogate All'.

If you have never used DeepDanbooru in the program before it will prompt you to specify the WebUI folder. This is the parent folder of the WebUI, so it will usually be named stable-diffusion-webui. The DeepDanbooru functionality of the WebUI needs to be working since this program is borrowing it.

Global

These tags are applied to every image. The individual tags of each image are represented by the ••• tag. If a global tag already exists on an image then it is ignored. The global tag list can be accessed via the Globe button or Ctrl+G.

Stored with the dataset in DATASET_PATH/config.json.

Positioning

TODO

Packaging

TODO

Clone this wiki locally