Compare commits

..

67 Commits

Author SHA1 Message Date
Dominik Reh
bec222f2b3 Fix for 1-letter completion
Completion would sometimes not show if the prompt was only one letter long and identical to the previous completion
2023-01-12 15:54:57 +01:00
Dominik Reh
d4db6a7907 Option to show ? wiki links for danbooru/e621 tags
Disabled by default since the wiki pages likely contain NSFW images.
Closes #109
2023-01-12 15:49:53 +01:00
Dominik Reh
52593e6ac8 Update setting descriptions for black/whitelist 2023-01-12 14:45:16 +01:00
Dominik Reh
849e346924 Black/whitelisting options for models
Enables selective (de)activation based on model hash.
Closes #14
2023-01-12 14:35:54 +01:00
Dominik Reh
25b285bea3 Styling adjustments 2023-01-10 15:10:13 +01:00
Dominik Reh
984a7e772a File comments 2023-01-10 15:01:22 +01:00
Dominik Reh
964b4fcff3 Rework results system
Now uses object properties instead of array indices, much less confusing
2023-01-10 14:59:09 +01:00
Dominik Reh
54641ddbfc Move utility functions to their own file 2023-01-10 14:58:25 +01:00
Dominik Reh
c048684909 Load embeds recursively in fallback
Webui now supports recursive embedding loading, so we also use it here.
This shouldn't happen since the newer version uses the non-fallback, but it doesn't hurt
2023-01-06 15:52:40 +01:00
Dominik Reh
da9acfea2a Rework embedding load, now uses callback.
Should hopefully fix #100
2023-01-03 17:30:30 +01:00
Dominik Reh
552c6517b8 Make new settings id the default behavior instead of fallback 2023-01-03 11:14:16 +01:00
DominikDoom
f626eb3467 Merge pull request #101 from stysmmaker/fix/apply-settings-button-fallback
Add fallback to applySettingsButton variable
2023-01-03 10:57:53 +01:00
MMaker
2ba513bedc fix: Add fallback to applySettingsButton var
Need due to layout change in recent webui update
269f6e8676
2023-01-03 00:07:15 -05:00
Dominik Reh
89d36da47e Add fallback for embedding loading
Fixes error on outdated webuis, as mentioned in #98 and #99
2023-01-02 16:09:36 +01:00
Dominik Reh
5f2f746310 Skipped embeddings now also hold shape info
so we don't need to guess the type anymore if the model didn't load any.
2023-01-02 12:45:56 +01:00
Dominik Reh
454c13ef6d Fix for embedding search without v1/v2 prefix 2023-01-02 00:44:56 +01:00
Dominik Reh
6deefda279 Show version info for embeddings
Also allows searching by version to quickly find v1 or v2 model embeddings
Closes #97
2023-01-02 00:38:48 +01:00
Dominik Reh
b57042edd0 Remove leftover debug logs 2022-12-26 13:31:04 +01:00
DominikDoom
ceba61163e Merge pull request #93 from ctwrs/umi-suggestions
Smarter suggestion system for UMI wildcard tags that takes previous tags into account to only show possible candidates.
2022-12-26 13:28:46 +01:00
catwars
16201605d0 Merge branch 'DominikDoom:main' into umi-suggestions 2022-12-26 02:10:49 +01:00
ctwrs
0c3397aee6 Fix umi tag autocomplete filtering logic 2022-12-26 01:57:15 +01:00
DominikDoom
4f582f4528 Merge pull request #92 from ctwrs/main
Allows None as a main tag file selection if the user wants special completion like wildcards but not for normal tags.
2022-12-24 13:27:34 +01:00
ctwrs
d2b5142d7d Umi filtering - initial version 2022-12-24 01:32:45 +01:00
ctwrs
f11abe60c2 Allow for selecting an empty tagFile to disable booru suggestions 2022-12-23 21:34:00 +01:00
DominikDoom
16bf9d9a51 Merge pull request #90 from DominikDoom/feature-yaml-wildcards 2022-12-22 14:48:23 +01:00
Dominik Reh
bdd8cf68c7 Fix show all condition 2022-12-22 12:39:00 +01:00
Dominik Reh
63a0d2e73e Bugfixes for change detection & multiple umi tags
(WIP)
2022-12-20 19:45:07 +01:00
Dominik Reh
34ba08d804 Extract regexes for easier editing & testing 2022-12-20 18:25:37 +01:00
Dominik Reh
f1a437ff48 Autocompletion for UMI yaml wildcards 2022-12-20 17:08:09 +01:00
Dominik Reh
97cbada882 Sort yaml tags by count 2022-12-20 13:28:43 +01:00
DominikDoom
860a4034bb Update README.md 2022-12-19 19:30:36 +01:00
Dominik Reh
255d7420fd Merge branch 'main' of https://github.com/DominikDoom/a1111-sd-webui-tagcomplete into main 2022-12-19 19:07:32 +01:00
Dominik Reh
6b34d8ccd1 Warning about e621 as extra file 2022-12-19 19:07:29 +01:00
DominikDoom
b35ee10f8e Merge pull request #88 from ctwrs/main
Preparation for new yaml wildcard support
2022-12-19 13:05:43 +01:00
ctwrs
fc8540589a Index tags used in yaml wildcard files 2022-12-19 12:53:30 +01:00
Dominik Reh
3d1ca6893a Fix formatting 2022-12-19 10:32:47 +01:00
Dominik Reh
73c3424ab3 Fix for script load if no third party found
Added missing null check
Fixes #87
2022-12-19 10:23:34 +01:00
DominikDoom
5f8a5d468d Update README_ZH.md 2022-12-18 16:51:11 +01:00
DominikDoom
4296d8e3b7 Update README.md 2022-12-18 16:38:17 +01:00
DominikDoom
8d9c0c7bb7 Merge pull request #86 from DominikDoom/support-dataset-tag-editor 2022-12-18 14:17:27 +01:00
Dominik Reh
1c22a22abe Support third party textboxes
Base functionality for third party textboxes, specifically Dataset Tag Editor
Closes #83
2022-12-18 14:15:37 +01:00
DominikDoom
f38c5df257 Update README_ZH.md 2022-11-28 08:00:08 +01:00
DominikDoom
3332d62639 Update README.md 2022-11-28 07:55:23 +01:00
DominikDoom
b159efe74e Update README.md 2022-11-28 07:52:36 +01:00
DominikDoom
3789457702 Fix typo 2022-11-26 15:44:43 +01:00
DominikDoom
35875a07a8 Update README_ZH.md 2022-11-26 15:42:30 +01:00
DominikDoom
77c6a2b950 Update README.md for new settings 2022-11-26 15:22:44 +01:00
DominikDoom
bc80b3ea2c Merge pull request #80 from DominikDoom/feature-options
Migrates config file to webui settings
2022-11-26 15:09:46 +01:00
Dominik Reh
a4e0b69d26 Better description for translation format 2022-11-26 15:01:51 +01:00
Dominik Reh
4f68a50a25 Fix styling for tac refresh buttons
Add change listener for settings of type 'select'
2022-11-26 14:45:43 +01:00
Dominik Reh
05c11c9781 Finalize settings migration
- Dropdown selection & refresh for tag files
- Tag, Extra & Translation file reloading without restart
- Any options can now be added to the quicksettings bar
- Standalone colors.json file
2022-11-26 14:29:20 +01:00
Dominik Reh
def6ebb798 Initial changes for settings migration 2022-11-21 19:11:20 +01:00
Dominik Reh
e4a8ee7439 Move settings inline
As mentioned in #71
2022-11-20 12:28:47 +01:00
Dominik Reh
1c3e60cfb2 Use fetch instead of XmlHttpRequest
Easier to use and also seems to be faster
2022-11-19 18:43:04 +01:00
DominikDoom
fc4484ddc6 Merge pull request #77 from stysmmaker/patch/embeddings-dir 2022-11-17 18:22:20 +01:00
MMaker
d6eb751e4b fix: Use correct embeddings dir
Use the `--embeddings-dir` if specified
2022-11-17 12:13:43 -05:00
batvbs
894335f1de Improved search function (#75)
Now only searches for matches at the start of tags or sub-words in multi-word-tags.
Old behavior can still be used by typing * at the beginning of the word.
2022-11-14 12:56:59 +01:00
Dominik Reh
2d45d6c796 Dynamic css construction for less duplicate code
Inserts variables for light/dark mode instead of keeping separate css for both
Fixes scrollbar space being reserved in chrome where it's not needed.
2022-11-07 19:25:51 +01:00
DominikDoom
dba4046064 Update README_ZH.md
I updated it using machine translation, so if you are a native Chinese speaker and notice any mistakes, please tell me.
2022-11-07 10:01:29 +01:00
Dominik Reh
ca8a0c433e Fix result text cutoff in Firefox
Fixes #65
2022-11-06 14:33:11 +01:00
Dominik Reh
535c2a6753 Safety checks for translations
Should prevent list getting cut off if no translation or alias matches
2022-11-06 14:16:56 +01:00
Dominik Reh
e86c604903 Fix for translations failing to match sometimes
Fixes #62 (again)
2022-11-06 14:00:34 +01:00
Dominik Reh
4eabf00f01 Remove max width for resutls
Fixes #65
2022-11-05 18:27:53 +01:00
Dominik Reh
a39b0d0742 Include deprecated danbooru tags
Since many of the deprecated tags have large post counts, it makes sense to include them, even if better alternatives are available now.
Fixes #64
2022-11-05 17:51:34 +01:00
DominikDoom
ecc71902cd Update README.md 2022-11-05 16:46:24 +01:00
DominikDoom
2dc1dfea86 Update README.md 2022-11-05 16:21:38 +01:00
Dominik Reh
18556c6115 Rework translation to be separate from aliases
Enables two-way translation where the translation is always visible.
Closes #62.
2022-11-05 15:54:26 +01:00
10 changed files with 1343 additions and 712 deletions

184
README.md
View File

@@ -1,3 +1,5 @@
![tag_autocomplete_light](https://user-images.githubusercontent.com/34448969/208306863-90bbd663-2cb4-47f1-a7fe-7b662a7b95e2.png)
# Booru tag autocompletion for A1111
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/DominikDoom/a1111-sd-webui-tagcomplete)](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/releases)
@@ -9,28 +11,25 @@ This custom script serves as a drop-in extension for the popular [AUTOMATIC1111
It displays autocompletion hints for recognized tags from "image booru" boards such as Danbooru, which are primarily used for browsing Anime-style illustrations.
Since some Stable Diffusion models were trained using this information, for example [Waifu Diffusion](https://github.com/harubaru/waifu-diffusion), using exact tags in prompts can often improve composition and help to achieve a wanted look.
I created this script as a convenience tool since it reduces the need of switching back and forth between the web UI and a booru site to copy-paste tags.
You can either clone / download the files manually as described [below](#installation), or use a pre-packaged version from [Releases](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/releases).
You can install it using the inbuilt available extensions list, clone the files manually as described [below](#installation), or use a pre-packaged version from [Releases](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/releases).
## Common Problems & Known Issues:
- The browser might cache old versions of the script, config, or embedding/wildcard lists. Try hitting `CTRL+F5` to clear the cache if you have issues.
- If `replaceUnderscores` is active, the script will currently only partially replace edited tags containing multiple words in brackets.
For example, editing `atago (azur lane)`, it would be replaced with e.g. `taihou (azur lane), lane)`, since the script currently doesn't see the second part of the bracket as the same tag. So in those cases you should delete the old tag beforehand.
## Screenshots
Demo video (with keyboard navigation):
https://user-images.githubusercontent.com/34448969/195344430-2b5f9945-b98b-4943-9fbc-82cf633321b1.mp4
https://user-images.githubusercontent.com/34448969/200128020-10d9a8b2-cea6-4e3f-bcd2-8c40c8c73233.mp4
Wildcard script support:
https://user-images.githubusercontent.com/34448969/195632461-49d226ae-d393-453d-8f04-1e44b073234c.mp4
https://user-images.githubusercontent.com/34448969/200128031-22dd7c33-71d1-464f-ae36-5f6c8fd49df0.mp4
Dark and Light mode supported, including tag colors:
![tagtypes](https://user-images.githubusercontent.com/34448969/195177127-f63949f8-271d-4767-bccd-f1b5e818a7f8.png)
![tagtypes_light](https://user-images.githubusercontent.com/34448969/195180061-ceebcc25-9e4c-424f-b0c9-ba8e8f4f17f4.png)
![results_dark](https://user-images.githubusercontent.com/34448969/200128214-3b6f21b4-9dda-4acf-820e-5df0285c30d6.png)
![results_light](https://user-images.githubusercontent.com/34448969/200128217-bfac8b60-6673-447b-90fd-dc6326f1618c.png)
## Installation
### As an extension (recommended)
@@ -47,7 +46,7 @@ Copy the `javascript`, `scripts` and `tags` folder into your web UI installation
---
In both configurations, the tags folder contains `config.json` and the tag data the script uses for autocompletion. By default, Danbooru and e621 tags are included.
In both configurations, the `tags` folder contains `colors.json` and the tag data the script uses for autocompletion. By default, Danbooru and e621 tags are included.
After scanning for embeddings and wildcards, the script will also create a `temp` directory here which lists the found files so they can be accessed in the browser side of the script. You can delete the temp folder without consequences as it will be recreated on the next startup.
### Important:
@@ -56,106 +55,95 @@ The script needs **all three folders** to work properly.
## Wildcard & Embedding support
Autocompletion also works with wildcard files used by [this script](https://github.com/jtkelm2/stable-diffusion-webui-1/blob/master/scripts/wildcards.py) of the same name or other similar scripts/extensions. This enables you to either insert categories to be replaced by the script, or even replace them with the actual wildcard file content in the same step. Wildcards are searched for in every extension folder as well as the `scripts/wildcards` folder to support legacy versions. This means that you can combine wildcards from multiple extensions. Nested folders are also supported if you have grouped your wildcards in that way.
It also scans the embeddings folder and displays completion hints for the names of all .pt and .bin files inside if you start typing `<`. Note that some normal tags also use < in Kaomoji (like ">_<" for example), so the results will contain both.
It also scans the embeddings folder and displays completion hints for the names of all .pt, .bin and .png files inside if you start typing `<`. Note that some normal tags also use < in Kaomoji (like ">_<" for example), so the results will contain both.
## Settings
The extension has a large amount of configuration & customizability built in:
![image](https://user-images.githubusercontent.com/34448969/204093162-99c6a0e7-8183-4f47-963b-1f172774f527.png)
## Config
The config contains the following settings and defaults:
```json
{
"tagFile": "danbooru.csv",
"activeIn": {
"txt2img": true,
"img2img": true,
"negativePrompts": true
},
"hideUIOptions": false,
"maxResults": 5,
"resultStepLength": 500,
"delayTime": 100,
"showAllResults": false,
"useLeftRightArrowKeys": false,
"replaceUnderscores": true,
"escapeParentheses": true,
"appendComma": true,
"useWildcards": true,
"useEmbeddings": true,
"alias": {
"searchByAlias": true,
"onlyShowAlias": false
},
"extra": {
"extraFile": "",
"onlyAliasExtraFile": false
},
"colors": {
"danbooru": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["indianred", "firebrick"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["orange", "darkorange"]
},
"e621": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["gold", "goldenrod"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["tomato", "darksalmon"],
"6": ["red", "maroon"],
"7": ["whitesmoke", "black"],
"8": ["seagreen", "darkseagreen"]
}
}
}
```
| Setting | Description |
|---------|-------------|
| tagFile | Specifies the tag file to use. You can provide a custom tag database of your liking, but since the script was developed with Danbooru tags in mind, it might not work properly with other configurations.|
| activeIn | Allows to selectively (de)activate the script for txt2img, img2img, and the negative prompts for both. |
| hideUIOptions | Allows to hide the added GUI options at the top of the page to adjust active and comma settings without restarting. |
| maxResults | How many results to show max. For the default tag set, the results are ordered by occurence count. For embeddings and wildcards it will show all results in a scrollable list. |
| resultStepLength | Allows to load results in smaller batches of the specified size for better performance in long lists or if showAllResults is true. |
| delayTime | Specifies how much to wait in milliseconds before triggering autocomplete. Helps prevent too frequent updates while typing. |
| showAllResults | If true, will ignore maxResults and show all results in a scrollable list. **Warning:** can lag your browser for long lists. |
| useLeftRightArrowKeys | If true, left and right arrows will select the first/last result in the popup instead of moving the cursor in the textbox. |
| replaceUnderscores | If true, undescores are replaced with spaces on clicking a tag. Might work better for some models. |
| escapeParentheses | If true, escapes tags containing () so they don't contribute to the web UI's prompt weighting functionality. |
| appendComma | Specifies the starting value of the "Append commas" UI switch. If UI options are disabled, this will always be used. |
| useWildcards | Used to toggle the wildcard completion functionality. |
| useEmbeddings | Used to toggle the embedding completion functionality. |
| alias | Options for aliases and translating tags. More info in the section below. |
| alias | Options for aliases. More info in the section below. |
| translation | Options for translations. More info in the section below. |
| extras | Options for additional tag files / aliases / translations. More info in the section below. |
| colors | Contains customizable colors for the tag types, you can add new ones here for custom tag files (same name as filename, without the .csv). The first value is for dark, the second for light mode. Color names and hex codes should both work.|
### colors.json
Additionally, tag type colors can be specified using the separate `colors.json` file in the extension's `tags` folder.
You can also add new ones here for custom tag files (same name as filename, without the .csv). The first value is for dark, the second for light mode. Color names and hex codes should both work.
```json
{
"danbooru": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["indianred", "firebrick"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["orange", "darkorange"]
},
"e621": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["gold", "goldenrod"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["tomato", "darksalmon"],
"6": ["red", "maroon"],
"7": ["whitesmoke", "black"],
"8": ["seagreen", "darkseagreen"]
}
}
```
The numbers are specifying the tag type, which is dependent on the tag source. For an example, see [CSV tag data](#csv-tag-data).
### Aliases, Translations & Extra tags
#### Aliases
Like on Booru sites, tags can have one or multiple aliases which redirect to the actual value on completion. These will be searchable / shown according to the settings in `config.json`:
- `searchByAlias` - Whether to search for the alias or only the actual tag.
- `searchByAlias` - Whether to also search for the alias or only the actual tag.
- `onlyShowAlias` - Shows only the alias instead of `alias -> actual`. Only for displaying, the inserted text at the end is still the actual tag.
The alias feature can also be used for translation, since translating just adds another alias for the respective tag.
Example with full and partial chinese tag sets:
#### Translations
An additional file can be added in the translation section, which will be used to translate both tags and aliases and also enables searching by translation.
This file needs to be a CSV in the format `<English tag/alias>,<Translation>`, but for backwards compatibility with older extra files that used a three column format, you can turn on `oldFormat` to use that instead.
![translation](https://user-images.githubusercontent.com/34448969/196175839-8aaacb26-5c90-48e3-be65-647a0b444ead.png)
![translation_mixed](https://user-images.githubusercontent.com/34448969/196176233-76d4cb5f-16cf-4800-a69b-adb64a79ca8b.png)
Example with chinese translation:
Aliases and translations can be added in multiple ways, which is where the "Extra" file comes into play.
1. Directly in the main tag file. Simply add a fourth value, separated by comma, containing the translation for the tag in that row.
2. As an extra file containing only the translated tag rows (so still including the english Tag name and tag type). Will be matched to the English tags in the main file based on the name & type, so might be slow for large translation files.
3. As an extra file with `onlyTranslationExtraFile` true. With this configuration, the extra file has to include *only* the translation itself. That means it is purely index based, assigning the translations to the main tags is really fast but also needs the lines to match (including empty lines). If the order or amount in the main file changes, the translations will potentially not match anymore.
![IME-input](https://user-images.githubusercontent.com/34448969/200126551-2264e9cc-abb2-4450-9afa-43f362a77ab0.png)
![english-input](https://user-images.githubusercontent.com/34448969/200126513-bf6b3940-6e22-41b0-a369-f2b4640f87d6.png)
**Important**
As of a recent update, translations added in the old Extra file way will only work as an alias and not be visible anymore if typing the English tag for that translation.
#### Extra file
Aliases can be added in multiple ways, which is where the "Extra" file comes into play.
1. As an extra file containing tag, category, optional count and the new alias. Will be matched to the English tags in the main file based on the name & type, so might be slow for large files.
2. As an extra file with `onlyAliasExtraFile` true. With this configuration, the extra file has to include *only* the alias itself. That means it is purely index based, assigning the aliases to the main tags is really fast but also needs the lines to match (including empty lines). If the order or amount in the main file changes, the translations will potentially not match anymore. Not recommended.
So your CSV values would look like this for each method:
| | 1 | 2 | 3 |
|------------|------------------------|--------------------------|--------------------|
| Main file | `tag,type,count,alias` | `tag,type,count` | `tag,type,count` |
| Extra file | - | `tag,type,(count),alias` | `alias` |
| | 1 | 2 |
|------------|--------------------------|--------------------------|
| Main file | `tag,type,count,(alias)` | `tag,type,count,(alias)` |
| Extra file | `tag,type,(count),alias` | `alias` |
Count in the extra file is optional, since there isn't always a post count for custom tag sets.
Methods 1 & 2 can also be mixed, in which case translations in the extra file will have priority over those in the main file if they translate the same tag.
The extra files can also be used to just add new / custom tags not included in the main set, provided `onlyTranslationExtraFile` is false.
If an extra tag doesn't match any existing tag, it will be added to the list as a new tag instead.
The extra files can also be used to just add new / custom tags not included in the main set, provided `onlyAliasExtraFile` is false.
If an extra tag doesn't match any existing tag, it will be added to the list as a new tag instead. For this, it will need to include the post count and alias columns even if they don't contain anything, so it could be in the form of `tag,type,,`.
##### WARNING
Do not use e621.csv or danbooru.csv as an extra file. Alias comparison has exponential runtime, so for the combination of danbooru+e621, it will need to do 10,000,000,000 (yes, ten billion) lookups and usually take multiple minutes to load.
## CSV tag data
The script expects a CSV file with tags saved in the following way:
@@ -171,28 +159,28 @@ long_hair,0,2898315,longhair
commentary_request,5,2610959,
```
Notably, it does not expect column names in the first row and both count and aliases are technically optional,
although count is always included in the default data.
although count is always included in the default data. Multiple aliases need to be comma separated as well, but encased in string quotes to not break the CSV parsing.
The numbering system follows the [tag API docs](https://danbooru.donmai.us/wiki_pages/api%3Atags) of Danbooru:
| Value | Description |
|-------|-------------|
|0 | General |
|1 | Artist |
|3 | Copyright |
|4 | Character |
|5 | Meta |
|0 | General |
|1 | Artist |
|3 | Copyright |
|4 | Character |
|5 | Meta |
or of e621:
or similarly for e621:
| Value | Description |
|-------|-------------|
|-1 | Invalid |
|0 | General |
|1 | Artist |
|3 | Copyright |
|4 | Character |
|5 | Species |
|6 | Invalid |
|7 | Meta |
|8 | Lore |
|-1 | Invalid |
|0 | General |
|1 | Artist |
|3 | Copyright |
|4 | Character |
|5 | Species |
|6 | Invalid |
|7 | Meta |
|8 | Lore |
The tag type is used for coloring entries in the result list.

View File

@@ -1,3 +1,5 @@
![tag_autocomplete_light_zh](https://user-images.githubusercontent.com/34448969/208307331-430696b4-e854-4458-b9e9-f6a6594f19e1.png)
# Booru tag autocompletion for A1111
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/DominikDoom/a1111-sd-webui-tagcomplete)](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/releases)
@@ -11,9 +13,44 @@
你可以按照[以下方法](#installation)下载或拷贝文件,也可以使用[Releases](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/releases)中打包好的文件。
## 常见问题 & 已知缺陷:
* 浏览器可能因为缓存无法更新脚本、设置、embedding/wildcard列表尝试使用`CRTL+F5`清空浏览器缓存并重新加载
-`replaceUnderscores`选项开启时, 脚本只会替换Tag的一部分如果Tag包含多个单词,比如将`atago (azur lane)`修改`atago``taihou`并使用自动补全时.会得到 `taihou (azur lane), lane)`的结果, 因为脚本没有把后面的部分认为成同一个Tag。
## 演示与截图
演示视频(使用了键盘导航):
https://user-images.githubusercontent.com/34448969/200128020-10d9a8b2-cea6-4e3f-bcd2-8c40c8c73233.mp4
Wildcard支持演示:
https://user-images.githubusercontent.com/34448969/200128031-22dd7c33-71d1-464f-ae36-5f6c8fd49df0.mp4
深浅色主题支持,包括Tag的颜色:
![results_dark](https://user-images.githubusercontent.com/34448969/200128214-3b6f21b4-9dda-4acf-820e-5df0285c30d6.png)
![results_light](https://user-images.githubusercontent.com/34448969/200128217-bfac8b60-6673-447b-90fd-dc6326f1618c.png)
## 安装
### 作为一种扩展(推荐)
要么把它克隆到你的扩展文件夹里
```bash
git clone "https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git" extensions/tag-autocomplete
```
(第二个参数指定文件夹的名称,你可以选择任何你喜欢的东西)。
或者手动创建一个文件夹,将 `javascript``scripts``tags`文件夹放在其中。
### 在根目录下(旧方法)
只需要将`javascript``scripts``tags`文件夹复制到你的Web UI安装根目录下.下次启动Web UI时它将自动启动。
---
在这两种配置中,标签文件夹包含`colors.json`和脚本用于自动完成的标签数据。
默认情况下Tag数据包括`Danbooru.csv``e621.csv`
在扫描过`/embeddings`和wildcards后会将列表存放在`tags/temp`文件夹下。删除该文件夹不会有任何影响,下次启动时它会重新创建。
### 注意:
本脚本的允许需要**全部的三个文件夹**。
## [Wildcard](https://github.com/jtkelm2/stable-diffusion-webui-1/blob/master/scripts/wildcards.py) & Embedding 支持
自动补全同样适用于 [Wildcard](https://github.com/jtkelm2/stable-diffusion-webui-1/blob/master/scripts/wildcards.py)中所述的通配符文件(后面有演示视频)。这将使你能够插入Wildcard脚本需要的通配符更进一步的你还可以插入通配符文件内的某个具体Tag。
@@ -23,124 +60,97 @@
现在这项功能默认是启用的,并会自动扫描`/embeddings``/scripts/wildcards`文件夹,不再需要使用`tags/wildcardNames.txt`文件了,早期版本的用户可以将它删除。
## 演示与截图
演示视频(使用了键盘导航):
https://user-images.githubusercontent.com/34448969/195344430-2b5f9945-b98b-4943-9fbc-82cf633321b1.mp4
Wildcard支持演示:
https://user-images.githubusercontent.com/34448969/195632461-49d226ae-d393-453d-8f04-1e44b073234c.mp4
深浅色主题支持,包括Tag的颜色:
![tagtypes](https://user-images.githubusercontent.com/34448969/195177127-f63949f8-271d-4767-bccd-f1b5e818a7f8.png)
![tagtypes_light](https://user-images.githubusercontent.com/34448969/195180061-ceebcc25-9e4c-424f-b0c9-ba8e8f4f17f4.png)
## 安装
只需要将`javascript``scripts``tags`文件夹复制到你的Web UI安装根目录下.下次启动Web UI时它将自动启动。
`tags`文件夹下包含`config.json`用于设置和Tag数据.csv格式。默认情况下Tag数据包括`Danbooru.csv``e621.csv`
在扫描过`/embeddings``/scripts/wildcards`后,会将列表存放在`tags/temp`文件夹下。删除该文件夹不会有任何影响,下次启动时它会重新创建。
### 注意:
本脚本的允许需要**全部的三个文件夹**。
## 配置文件
配置文件config.json的默认值如下
```json
{
"tagFile": "danbooru.csv",
"activeIn": {
"txt2img": true,
"img2img": true,
"negativePrompts": true
},
"maxResults": 5,
"showAllResults": false,
"replaceUnderscores": true,
"escapeParentheses": true,
"useWildcards": true,
"useEmbeddings": true,
"translation": {
"searchByTranslation": true,
"onlyShowTranslation": false
},
"extra": {
"extraFile": "",
"onlyTranslationExtraFile": false
},
"colors": {
"danbooru": {
"0": ["lightblue", "dodgerblue"],
"1": ["indianred", "firebrick"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["orange", "darkorange"]
},
"e621": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["gold", "goldenrod"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["tomato", "darksalmon"],
"6": ["red", "maroon"],
"7": ["whitesmoke", "black"],
"8": ["seagreen", "darkseagreen"]
}
}
}
```
该扩展有大量的配置和可定制性的内建
![image](https://user-images.githubusercontent.com/34448969/204093162-99c6a0e7-8183-4f47-963b-1f172774f527.png)
| 设置 | 描述 |
|---------|-------------|
| tagFile | 指定要使用的标记文件。您可以提供您喜欢的自定义标签数据库,但由于该脚本是在考虑 Danbooru 标签的情况下开发的,因此它可能无法与其他配置一起正常工作。|
| activeIn | 允许有选择地(取消)激活 txt2img、img2img 和两者的否定提示的脚本。|
| maxResults | 最多显示多少个结果。对于默认标记集,结果按出现次数排序。对于嵌入和通配符,它​​将在可滚动列表中显示所有结果。 |
| showAllResults | 如果为真,将忽略 maxResults 并在可滚动列表中显示所有结果。 **警告:**对于长列表,您的浏览器可能会滞后。 |
| showAllResults | 如果为真,将忽略 maxResults 并在可滚动列表中显示所有结果。 **警告:** 对于长列表,您的浏览器可能会滞后。 |
| resultStepLength | 允许以指定大小的小批次加载结果以便在长列表中获得更好的性能或者在showAllResults为真时。 |
| delayTime | 指定在触发自动完成之前要等待多少毫秒。有助于防止打字时过于频繁的更新。 |
| replaceUnderscores | 如果为 true则在单击标签时将取消划线替换为空格。对于某些型号可能会更好。|
| escapeParentheses | 如果为 true则转义包含 () 的标签,因此它们不会对 Web UI 的提示权重功能做出贡献。 |
| useWildcards | 用于切换通配符完成功能。 |
| useEmbeddings | 用于切换嵌入完成功能。 |
| alias | 标签别名的选项。更多信息在下面的部分。 |
| translation | 用于翻译标签的选项。更多信息在下面的部分。 |
| extras | 附加标签文件/翻译的选项。更多信息在下面的部分。|
| colors | 包含标签类型的可自定义颜色,您可以在此处为自定义标签文件添加新颜色(与文件名相同,不带 .csv。第一个值是暗模式第二个值是亮模式。颜色名称和十六进制代码都应该有效。|
## 翻译&新增Tag
通过最近的更新,现在可以为标签添加翻译。这些将根据 `config.json` 中的设置可搜索/显示:
- `searchByTranslation` - 是同时搜索翻译词还是仅搜索英文标签
- `onlyShowTranslation` - 如果有英文标签,则用其翻译替换它。仅用于显示,最后插入的文本仍然是英文标签。
### colors.json (标签颜色)
此外,标签类型的颜色可以使用扩展的`tags`文件夹中单独的`colors.json`文件来指定。
你也可以在这里为自定义标签文件添加新的(与文件名相同,不带 .csv。第一个值是暗模式第二个值是亮模式。颜色名称和十六进制代码都被支持
```json
{
"danbooru": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["indianred", "firebrick"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["orange", "darkorange"]
},
"e621": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["gold", "goldenrod"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["tomato", "darksalmon"],
"6": ["red", "maroon"],
"7": ["whitesmoke", "black"],
"8": ["seagreen", "darkseagreen"]
}
}
```
数字是指定标签的类型,这取决于标签的来源。例如,见[CSV tag data](#csv-tag-data)。
### 别名,翻译&新增Tag
#### 别名
像Booru网站一样标签可以有一个或多个别名完成后重定向到实际值。这些将根据`config.json`中的设置进行搜索/显示。
- `searchByAlias` - 是否也要搜索别名,或只搜索实际的标签。
- `onlyShowAlias` - 只显示别名,不显示 `别名->实际`。仅用于显示,最后的文本仍然是实际的标签。
#### 翻译
可以在翻译部分添加一个额外的文件,它将被用来翻译标签和别名,同时也可以通过翻译进行搜索。
这个文件需要是CSV格式的`<英语标签/别名>,<翻译>`,但为了向后兼容使用三栏格式的旧的额外文件,你可以打开`oldFormat`来代替它。
完整和部分中文标签集的示例:
![translation](https://user-images.githubusercontent.com/34448969/196175839-8aaacb26-5c90-48e3-be65-647a0b444ead.png)
![translation_mixed](https://user-images.githubusercontent.com/34448969/196176233-76d4cb5f-16cf-4800-a69b-adb64a79ca8b.png)
![IME-input](https://user-images.githubusercontent.com/34448969/200126551-2264e9cc-abb2-4450-9afa-43f362a77ab0.png)
![english-input](https://user-images.githubusercontent.com/34448969/200126513-bf6b3940-6e22-41b0-a369-f2b4640f87d6.png)
可以通过多种方式添加翻译,这就是额外文件发挥作用的地方。
1. 直接在主标签文件中。只需添加第三个值,用逗号分隔,包含该行中标签的翻译
2. 作为仅包含已翻译标签行的额外文件(因此仍包括英文标签名称和标签类型)。将根据名称和类型与主文件中的英文标签匹配,因此对于大型翻译文件可能会很慢。
3. 作为 `onlyTranslationExtraFile` 为 true 的额外文件。使用此配置,额外文件必须包含*仅*翻译本身。这意味着它完全基于索引,将翻译分配给主要标签非常快,但也需要匹配行(包括空行)。如果主文件中的顺序或数量发生变化,则翻译可能不再匹配
**重要的是**
从最近的更新来看用旧的Extra文件方式添加的翻译只能作为一个别名使用如果输入该翻译的英文标签将不再可见
可以通过多种方式添加别名,这就是额外文件发挥作用的地方
1. 作为仅包含已翻译标签行的额外文件(因此仍包括英文标签名称和标签类型)。将根据名称和类型与主文件中的英文标签匹配,因此对于大型翻译文件可能会很慢。
2. 作为 `onlyAliasExtraFile` 为 true 的额外文件。使用此配置,额外文件必须包含*仅*翻译本身。这意味着它完全基于索引,将翻译分配给主要标签非常快,但也需要匹配行(包括空行)。如果主文件中的顺序或数量发生变化,则翻译可能不再匹配。
因此,对于每种方法,您的 CSV 值将如下所示:
| | 1 | 2 | 3 |
|------------|---------------------|--------------------|---------------|
| Main file | `tag,0,translation` | `tag,0` | `tag,0` |
| Extra file | - | `tag,0,translation`| `translation` |
| | 1 | 2 |
|------------|--------------------------|--------------------------|
| Main file | `tag,type,count,(alias)` | `tag,type,count,(alias)` |
| Extra file | `tag,type,(count),alias` | `alias` |
方法 1 和 2 也可以混合使用,在这种情况下,如果它们翻译相同的标签,额外文件中的翻译将优先于主文件中的翻译
如果 `onlyTranslationExtraFile` 为 false额外文件也可用于添加未包含在主集中的新/自定义标签。
额外文件中的计数是可选的,因为自定义标签集并不总是有帖子计数
如果额外的标签与任何现有标签都不匹配,它将作为新标签添加到列表中。
### CSV tag data
本脚本的Tag文件格式如下你可以安装这个格式制作自己的Tag文件:
```csv
1girl,0
solo,0
highres,5
long_hair,0
1girl,0,4114588,"1girls,sole_female"
solo,0,3426446,"female_solo,solo_female"
highres,5,3008413,"high_res,high_resolution,hires"
long_hair,0,2898315,longhair
commentary_request,5,2610959,
```
值得注意的是,不希望第一行有列名。
第一个值需要是标签名称,而第二个值指定标签类型
值得注意的是,不希望第一行有列名而且count和aliases在技术上都是可选的
尽管count总是包含在默认数据中。多个别名也需要用逗号分隔但要用字符串引号包裹以免破坏CSV解析
编号系统遵循 Danbooru 的 [tag API docs](https://danbooru.donmai.us/wiki_pages/api%3Atags):
| Value | Description |
|-------|-------------|
@@ -150,7 +160,7 @@ long_hair,0
|4 | Character |
|5 | Meta |
or of e621:
类似的还有e621
| Value | Description |
|-------|-------------|
|-1 | Invalid |

29
javascript/_result.js Normal file
View File

@@ -0,0 +1,29 @@
// Result data type for cleaner use of optional completion result properties
// Type enum
const ResultType = Object.freeze({
"tag": 1,
"embedding": 2,
"wildcardTag": 3,
"wildcardFile": 4,
"yamlWildcard": 5
});
// Class to hold result data and annotations to make it clearer to use
class AutocompleteResult {
// Main properties
text = "";
type = ResultType.tag;
// Additional info, only used in some cases
category = null;
count = null;
aliases = null;
meta = null;
// Constructor
constructor(text, type) {
this.text = text;
this.type = type;
}
}

84
javascript/_textAreas.js Normal file
View File

@@ -0,0 +1,84 @@
// Utility functions to select text areas the script should work on,
// including third party options.
// Supported third party options so far:
// - Dataset Tag Editor
// Core text area selectors
const core = [
"#txt2img_prompt > label > textarea",
"#img2img_prompt > label > textarea",
"#txt2img_neg_prompt > label > textarea",
"#img2img_neg_prompt > label > textarea"
];
// Third party text area selectors
const thirdParty = {
"dataset-tag-editor": {
"base": "#tab_dataset_tag_editor_interface",
"hasIds": false,
"selectors": [
"Caption of Selected Image",
"Interrogate Result",
"Edit Caption",
"Edit Tags"
]
}
}
function getTextAreas() {
// First get all core text areas
let textAreas = [...gradioApp().querySelectorAll(core.join(", "))];
for (const [key, entry] of Object.entries(thirdParty)) {
if (entry.hasIds) { // If the entry has proper ids, we can just select them
textAreas = textAreas.concat([...gradioApp().querySelectorAll(entry.selectors.join(", "))]);
} else { // Otherwise, we have to find the text areas by their adjacent labels
let base = gradioApp().querySelector(entry.base);
// Safety check
if (!base) continue;
let allTextAreas = [...base.querySelectorAll("textarea")];
// Filter the text areas where the adjacent label matches one of the selectors
let matchingTextAreas = allTextAreas.filter(ta => [...ta.parentElement.childNodes].some(x => entry.selectors.includes(x.innerText)));
textAreas = textAreas.concat(matchingTextAreas);
}
};
return textAreas;
}
const thirdPartyIdSet = new Set();
// Get the identifier for the text area to differentiate between positive and negative
function getTextAreaIdentifier(textArea) {
let txt2img_p = gradioApp().querySelector('#txt2img_prompt > label > textarea');
let txt2img_n = gradioApp().querySelector('#txt2img_neg_prompt > label > textarea');
let img2img_p = gradioApp().querySelector('#img2img_prompt > label > textarea');
let img2img_n = gradioApp().querySelector('#img2img_neg_prompt > label > textarea');
let modifier = "";
switch (textArea) {
case txt2img_p:
modifier = ".txt2img.p";
break;
case txt2img_n:
modifier = ".txt2img.n";
break;
case img2img_p:
modifier = ".img2img.p";
break;
case img2img_n:
modifier = ".img2img.n";
break;
default:
// If the text area is not a core text area, it must be a third party text area
// Add it to the set of third party text areas and get its index as a unique identifier
if (!thirdPartyIdSet.has(textArea))
thirdPartyIdSet.add(textArea);
modifier = `.thirdParty.ta${[...thirdPartyIdSet].indexOf(textArea)}`;
break;
}
return modifier;
}

96
javascript/_utils.js Normal file
View File

@@ -0,0 +1,96 @@
// Utility functions for tag autocomplete
// Parse the CSV file into a 2D array. Doesn't use regex, so it is very lightweight.
function parseCSV(str) {
var arr = [];
var quote = false; // 'true' means we're inside a quoted field
// Iterate over each character, keep track of current row and column (of the returned array)
for (var row = 0, col = 0, c = 0; c < str.length; c++) {
var cc = str[c], nc = str[c + 1]; // Current character, next character
arr[row] = arr[row] || []; // Create a new row if necessary
arr[row][col] = arr[row][col] || ''; // Create a new column (start with empty string) if necessary
// If the current character is a quotation mark, and we're inside a
// quoted field, and the next character is also a quotation mark,
// add a quotation mark to the current column and skip the next character
if (cc == '"' && quote && nc == '"') { arr[row][col] += cc; ++c; continue; }
// If it's just one quotation mark, begin/end quoted field
if (cc == '"') { quote = !quote; continue; }
// If it's a comma and we're not in a quoted field, move on to the next column
if (cc == ',' && !quote) { ++col; continue; }
// If it's a newline (CRLF) and we're not in a quoted field, skip the next character
// and move on to the next row and move to column 0 of that new row
if (cc == '\r' && nc == '\n' && !quote) { ++row; col = 0; ++c; continue; }
// If it's a newline (LF or CR) and we're not in a quoted field,
// move on to the next row and move to column 0 of that new row
if (cc == '\n' && !quote) { ++row; col = 0; continue; }
if (cc == '\r' && !quote) { ++row; col = 0; continue; }
// Otherwise, append the current character to the current column
arr[row][col] += cc;
}
return arr;
}
// Load file
async function readFile(filePath, json = false) {
let response = await fetch(`file=${filePath}`);
if (response.status != 200) {
console.error(`Error loading file "${filePath}": ` + response.status, response.statusText);
return null;
}
if (json)
return await response.json();
else
return await response.text();
}
// Load CSV
async function loadCSV(path) {
let text = await readFile(path);
return parseCSV(text);
}
// Debounce function to prevent spamming the autocomplete function
var dbTimeOut;
const debounce = (func, wait = 300) => {
return function (...args) {
if (dbTimeOut) {
clearTimeout(dbTimeOut);
}
dbTimeOut = setTimeout(() => {
func.apply(this, args);
}, wait);
}
}
// Difference function to fix duplicates not being seen as changes in normal filter
function difference(a, b) {
if (a.length == 0) {
return b;
}
if (b.length == 0) {
return a;
}
return [...b.reduce((acc, v) => acc.set(v, (acc.get(v) || 0) - 1),
a.reduce((acc, v) => acc.set(v, (acc.get(v) || 0) + 1), new Map())
)].reduce((acc, [v, count]) => acc.concat(Array(Math.abs(count)).fill(v)), []);
}
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
function escapeHTML(unsafeText) {
let div = document.createElement('div');
div.textContent = unsafeText;
return div.innerHTML;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,12 @@
# This helper script scans folders for wildcards and embeddings and writes them
# to a temporary file to expose it to the javascript side
import gradio as gr
from pathlib import Path
from modules import scripts
from modules import scripts, script_callbacks, shared, sd_hijack
import yaml
import time
import threading
# Webui root path
FILE_DIR = Path().absolute()
@@ -15,7 +19,7 @@ TAGS_PATH = Path(scripts.basedir()).joinpath('tags')
# The path to the folder containing the wildcards and embeddings
WILDCARD_PATH = FILE_DIR.joinpath('scripts/wildcards')
EMB_PATH = FILE_DIR.joinpath('embeddings')
EMB_PATH = Path(shared.cmd_opts.embeddings_dir)
def find_ext_wildcard_paths():
@@ -52,9 +56,86 @@ def get_ext_wildcards():
return wildcard_files
def get_embeddings():
"""Returns a list of all embeddings"""
return [str(e.relative_to(EMB_PATH)) for e in EMB_PATH.glob("**/*") if e.suffix in {".bin", ".pt", ".png"}]
def get_ext_wildcard_tags():
"""Returns a list of all tags found in extension YAML files found under a Tags: key."""
wildcard_tags = {} # { tag: count }
yaml_files = []
for path in WILDCARD_EXT_PATHS:
yaml_files.extend(p for p in path.rglob("*.yml"))
yaml_files.extend(p for p in path.rglob("*.yaml"))
count = 0
for path in yaml_files:
try:
with open(path, encoding="utf8") as file:
data = yaml.safe_load(file)
for item in data:
wildcard_tags[count] = ','.join(data[item]['Tags'])
count += 1
except yaml.YAMLError as exc:
print(exc)
# Sort by count
sorted_tags = sorted(wildcard_tags.items(), key=lambda item: item[1], reverse=True)
output = []
for tag, count in sorted_tags:
output.append(f"{tag},{count}")
return output
def get_embeddings(sd_model):
"""Write a list of all embeddings with their version"""
# Version constants
V1_SHAPE = 768
V2_SHAPE = 1024
emb_v1 = []
emb_v2 = []
results = []
try:
# Get embedding dict from sd_hijack to separate v1/v2 embeddings
emb_type_a = sd_hijack.model_hijack.embedding_db.word_embeddings
emb_type_b = sd_hijack.model_hijack.embedding_db.skipped_embeddings
# Get the shape of the first item in the dict
emb_a_shape = -1
emb_b_shape = -1
if (len(emb_type_a) > 0):
emb_a_shape = next(iter(emb_type_a.items()))[1].shape
if (len(emb_type_b) > 0):
emb_b_shape = next(iter(emb_type_b.items()))[1].shape
# Add embeddings to the correct list
if (emb_a_shape == V1_SHAPE):
emb_v1 = list(emb_type_a.keys())
elif (emb_a_shape == V2_SHAPE):
emb_v2 = list(emb_type_a.keys())
if (emb_b_shape == V1_SHAPE):
emb_v1 = list(emb_type_b.keys())
elif (emb_b_shape == V2_SHAPE):
emb_v2 = list(emb_type_b.keys())
# Get shape of current model
#vec = sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
#model_shape = vec.shape[1]
# Show relevant entries at the top
#if (model_shape == V1_SHAPE):
# results = [e + ",v1" for e in emb_v1] + [e + ",v2" for e in emb_v2]
#elif (model_shape == V2_SHAPE):
# results = [e + ",v2" for e in emb_v2] + [e + ",v1" for e in emb_v1]
#else:
# raise AttributeError # Fallback to old method
results = sorted([e + ",v1" for e in emb_v1] + [e + ",v2" for e in emb_v2], key=lambda x: x.lower())
except AttributeError:
print("tag_autocomplete_helper: Old webui version or unrecognized model shape, using fallback for embedding completion.")
# Get a list of all embeddings in the folder
all_embeds = [str(e.relative_to(EMB_PATH)) for e in EMB_PATH.rglob("*") if e.suffix in {".bin", ".pt", ".png",'.webp', '.jxl', '.avif'}]
# Remove files with a size of 0
all_embeds = [e for e in all_embeds if EMB_PATH.joinpath(e).stat().st_size > 0]
# Remove file extensions
all_embeds = [e[:e.rfind('.')] for e in all_embeds]
results = [e + "," for e in all_embeds]
write_to_temp_file('emb.txt', results)
def write_tag_base_path():
@@ -69,12 +150,24 @@ def write_to_temp_file(name, data):
f.write(('\n'.join(data)))
csv_files = []
csv_files_withnone = []
def update_tag_files():
"""Returns a list of all potential tag files"""
global csv_files, csv_files_withnone
files = [str(t.relative_to(TAGS_PATH)) for t in TAGS_PATH.glob("*.csv")]
csv_files = files
csv_files_withnone = ["None"] + files
# Write the tag base path to a fixed location temporary file
# to enable the javascript side to find our files regardless of extension folder name
if not STATIC_TEMP_PATH.exists():
STATIC_TEMP_PATH.mkdir(exist_ok=True)
write_tag_base_path()
update_tag_files()
# Check if the temp path exists and create it if not
if not TEMP_PATH.exists():
@@ -84,7 +177,10 @@ if not TEMP_PATH.exists():
# even if no wildcards or embeddings are found
write_to_temp_file('wc.txt', [])
write_to_temp_file('wce.txt', [])
write_to_temp_file('emb.txt', [])
write_to_temp_file('wcet.txt', [])
# Only reload embeddings if the file doesn't exist, since they are already re-written on model load
if not TEMP_PATH.joinpath("emb.txt").exists():
write_to_temp_file('emb.txt', [])
# Write wildcards to wc.txt if found
if WILDCARD_PATH.exists():
@@ -97,9 +193,51 @@ if WILDCARD_EXT_PATHS is not None:
wildcards_ext = get_ext_wildcards()
if wildcards_ext:
write_to_temp_file('wce.txt', wildcards_ext)
# Write yaml extension wildcards to wcet.txt if found
wildcards_yaml_ext = get_ext_wildcard_tags()
if wildcards_yaml_ext:
write_to_temp_file('wcet.txt', wildcards_yaml_ext)
# Write embeddings to emb.txt if found
if EMB_PATH.exists():
embeddings = get_embeddings()
if embeddings:
write_to_temp_file('emb.txt', embeddings)
# Get embeddings after the model loaded callback
script_callbacks.on_model_loaded(get_embeddings)
# Register autocomplete options
def on_ui_settings():
TAC_SECTION = ("tac", "Tag Autocomplete")
# Main tag file
shared.opts.add_option("tac_tagFile", shared.OptionInfo("danbooru.csv", "Tag filename", gr.Dropdown, lambda: {"choices": csv_files_withnone}, refresh=update_tag_files, section=TAC_SECTION))
# Active in settings
shared.opts.add_option("tac_active", shared.OptionInfo(True, "Enable Tag Autocompletion", section=TAC_SECTION))
shared.opts.add_option("tac_activeIn.txt2img", shared.OptionInfo(True, "Active in txt2img (Requires restart)", section=TAC_SECTION))
shared.opts.add_option("tac_activeIn.img2img", shared.OptionInfo(True, "Active in img2img (Requires restart)", section=TAC_SECTION))
shared.opts.add_option("tac_activeIn.negativePrompts", shared.OptionInfo(True, "Active in negative prompts (Requires restart)", section=TAC_SECTION))
shared.opts.add_option("tac_activeIn.thirdParty", shared.OptionInfo(True, "Active in third party textboxes [Dataset Tag Editor] (Requires restart)", section=TAC_SECTION))
shared.opts.add_option("tac_activeIn.modelList", shared.OptionInfo("", "List of model hashes to use as black/whitelist, separated by commas.", section=TAC_SECTION))
shared.opts.add_option("tac_activeIn.modelListMode", shared.OptionInfo("Blacklist", "Mode to use for model hash list", gr.Dropdown, lambda: {"choices": ["Blacklist","Whitelist"]}, section=TAC_SECTION))
# Results related settings
shared.opts.add_option("tac_maxResults", shared.OptionInfo(5, "Maximum results", section=TAC_SECTION))
shared.opts.add_option("tac_showAllResults", shared.OptionInfo(False, "Show all results", section=TAC_SECTION))
shared.opts.add_option("tac_resultStepLength", shared.OptionInfo(100, "How many results to load at once", section=TAC_SECTION))
shared.opts.add_option("tac_delayTime", shared.OptionInfo(100, "Time in ms to wait before triggering completion again (Requires restart)", section=TAC_SECTION))
shared.opts.add_option("tac_useWildcards", shared.OptionInfo(True, "Search for wildcards", section=TAC_SECTION))
shared.opts.add_option("tac_useEmbeddings", shared.OptionInfo(True, "Search for embeddings", section=TAC_SECTION))
shared.opts.add_option("tac_showWikiLinks", shared.OptionInfo(False, "Show '?' next to tags, linking to its Danbooru or e621 wiki page (Warning: This is an external site and very likely contains NSFW examples!)", section=TAC_SECTION))
# Insertion related settings
shared.opts.add_option("tac_replaceUnderscores", shared.OptionInfo(True, "Replace underscores with spaces on insertion", section=TAC_SECTION))
shared.opts.add_option("tac_escapeParentheses", shared.OptionInfo(True, "Escape parentheses on insertion", section=TAC_SECTION))
shared.opts.add_option("tac_appendComma", shared.OptionInfo(True, "Append comma on tag autocompletion", section=TAC_SECTION))
# Alias settings
shared.opts.add_option("tac_alias.searchByAlias", shared.OptionInfo(True, "Search by alias", section=TAC_SECTION))
shared.opts.add_option("tac_alias.onlyShowAlias", shared.OptionInfo(False, "Only show alias", section=TAC_SECTION))
# Translation settings
shared.opts.add_option("tac_translation.translationFile", shared.OptionInfo("None", "Translation filename", gr.Dropdown, lambda: {"choices": csv_files_withnone}, refresh=update_tag_files, section=TAC_SECTION))
shared.opts.add_option("tac_translation.oldFormat", shared.OptionInfo(False, "Translation file uses old 3-column translation format instead of the new 2-column one", section=TAC_SECTION))
shared.opts.add_option("tac_translation.searchByTranslation", shared.OptionInfo(True, "Search by translation", section=TAC_SECTION))
# Extra file settings
shared.opts.add_option("tac_extra.extraFile", shared.OptionInfo("None", "Extra filename (do not use e621.csv here!)", gr.Dropdown, lambda: {"choices": csv_files_withnone}, refresh=update_tag_files, section=TAC_SECTION))
shared.opts.add_option("tac_extra.onlyAliasExtraFile", shared.OptionInfo(False, "Extra file in alias only format", section=TAC_SECTION))
script_callbacks.on_ui_settings(on_ui_settings)

21
tags/colors.json Normal file
View File

@@ -0,0 +1,21 @@
{
"danbooru": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["indianred", "firebrick"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["orange", "darkorange"]
},
"e621": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["gold", "goldenrod"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["tomato", "darksalmon"],
"6": ["red", "maroon"],
"7": ["whitesmoke", "black"],
"8": ["seagreen", "darkseagreen"]
}
}

View File

@@ -1,48 +0,0 @@
{
"tagFile": "danbooru.csv",
"activeIn": {
"txt2img": true,
"img2img": true,
"negativePrompts": true
},
"hideUIOptions": false,
"maxResults": 5,
"resultStepLength": 500,
"delayTime": 100,
"showAllResults": false,
"useLeftRightArrowKeys": false,
"replaceUnderscores": true,
"escapeParentheses": true,
"appendComma": true,
"useWildcards": true,
"useEmbeddings": true,
"alias": {
"searchByAlias": true,
"onlyShowAlias": false
},
"extra": {
"extraFile": "",
"onlyAliasExtraFile": false
},
"colors": {
"danbooru": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["indianred", "firebrick"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["orange", "darkorange"]
},
"e621": {
"-1": ["red", "maroon"],
"0": ["lightblue", "dodgerblue"],
"1": ["gold", "goldenrod"],
"3": ["violet", "darkorchid"],
"4": ["lightgreen", "darkgreen"],
"5": ["tomato", "darksalmon"],
"6": ["red", "maroon"],
"7": ["whitesmoke", "black"],
"8": ["seagreen", "darkseagreen"]
}
}
}

View File

@@ -167,6 +167,7 @@ signature,0,177272,"artist_signature,autograph,signed"
dark_skin,0,176102,"brown_skin,dark_skin_female,dark_skinned_female,darkskin"
hand_up,0,175705,"hand_raised,one_hand_raised,raised_hand"
spread_legs,0,173323,"legs_spread,open_legs,spread_leg"
silver_hair,0,172873,
cum,0,172618,"cumshot,semen,sperm"
2boys,0,170921,2boy
hood,0,170424,
@@ -190,6 +191,7 @@ pokemon,3,157511,"pocket_monsters,pokemons,pok├®mon"
water,0,154351,
grey_background,0,153495,gray_background
necklace,0,151304,
black_legwear,0,151031,"black_kneehighs,black_leggings,black_pantyhose,black_socks,black_thighhighs"
off_shoulder,0,147990,"off-shoulder,off_shoulders"
chibi,0,147648,super_deformed
bag,0,146939,bags
@@ -276,6 +278,7 @@ black_jacket,0,101020,black_blazer
neckerchief,0,100738,
head_tilt,0,100424,
crop_top,0,99832,
white_legwear,0,99720,"white_kneehighs,white_leggings,white_pantyhose,white_socks,white_thighhighs"
see-through,0,99593,"see_through,seethrough,sheer_clothes,sheer_clothing,transparent_clothing"
orange_eyes,0,98788,
gradient,0,98281,
@@ -613,12 +616,14 @@ white_bow,0,43897,
black_hairband,0,43861,
x_hair_ornament,0,43849,
horse_ears,0,43703,
eyebrows,0,43694,
>_<,0,43669,><
hair_bobbles,0,43638,"ball_braids,hair_bobble"
wing_collar,0,43595,
on_stomach,0,43546,"lying_on_stomach,on_belly,on_front,prone"
blue_shirt,0,43462,blue_blouse
plant,0,43377,plants
areolae,0,43051,"areola,areolas"
flandre_scarlet,4,42909,
tan,0,42823,"suntan,tanned,tanned_skin"
lipstick,0,42805,
@@ -886,10 +891,12 @@ eye_contact,0,27001,
forehead,0,26988,
two-tone_background,0,26942,
upskirt,0,26901,
striped_legwear,0,26881,"striped_kneehighs,striped_leggings,striped_pantyhose,striped_socks,striped_thighhighs"
areola_slip,0,26870,areolae_slip
komeiji_koishi,4,26856,
furry,0,26814,"anthro,kemono"
seiza,0,26683,sitting_on_knees
face,0,26664,
yellow_bow,0,26605,
blue_bikini,0,26512,"blue_bikini_bottom,blue_bikini_top"
pink_flower,0,26508,
@@ -1026,6 +1033,7 @@ epaulettes,0,22442,
idolmaster_shiny_colors,3,22395,shiny_colors
frilled_bikini,0,22378,frilled_bikini_bottom
crossdressing,0,22372,"crossdress,crossplay,transvestite"
hands,0,22364,hand
innertube,0,22356,"inner_tube,swim_ring"
ribbon-trimmed_sleeves,0,22260,
dragon_horns,0,22250,
@@ -1137,6 +1145,7 @@ dog,0,19799,dogs
track_jacket,0,19752,
competition_swimsuit,0,19744,
long_skirt,0,19707,
tied_hair,0,19687,hair_tied
princess_connect!,3,19639,"priconne,princess_connect!_re:dive"
striped_bikini,0,19632,
ice,0,19624,
@@ -1364,6 +1373,7 @@ hands_in_pockets,0,15357,
nurse_cap,0,15348,nurse_hat
kamishirasawa_keine,4,15332,
fate/zero,3,15311,fate_zero
remodel_(kantai_collection),0,15309,
front-tie_bikini_top,0,15302,front-tie_bikini
visor_cap,0,15259,
yellow_flower,0,15220,
@@ -1535,6 +1545,7 @@ lactation,0,13407,"lactating,milk_breasts,milking"
swimsuit_under_clothes,0,13405,
underbust,0,13389,
protected_link,5,13387,
brown_legwear,0,13377,"brown_kneehighs,brown_leggings,brown_pantyhose,brown_socks,brown_thighhighs"
kill_la_kill,3,13352,
hat_flower,0,13343,
eyeball,0,13325,eyeballs
@@ -1832,6 +1843,7 @@ space,0,10301,outer_space
mizuhashi_parsee,4,10296,
halloween_costume,0,10290,
blue_leotard,0,10290,
doujinshi,5,10264,doujin
air_bubble,0,10259,
steaming_body,0,10257,
randoseru,0,10253,naked_randoseru
@@ -1918,6 +1930,7 @@ star_print,0,9619,
low_wings,0,9610,"hip_wings,lower_back_wings,waist_wings"
ribbon_choker,0,9607,
cone_hair_bun,0,9604,hair_cones
red_legwear,0,9596,"red_kneehighs,red_leggings,red_pantyhose,red_socks,red_thighhighs"
fujimaru_ritsuka_(female),4,9592,"female_protagonist_(fate/grand_order),gudako"
umineko_no_naku_koro_ni,3,9585,"umineko,when_the_seagulls_cry"
tasuki,0,9574,kimono_sleeve_ties
@@ -2024,6 +2037,7 @@ tiger_print,0,8874,tigerprint
purple_headwear,0,8872,purple_hat
red_shorts,0,8866,
raglan_sleeves,0,8860,
fishnet_legwear,0,8853,"fishnet_pantyhose,fishnet_stockings,fishnet_thighhighs"
leg_ribbon,0,8848,
condom_wrapper,0,8824,
asymmetrical_clothes,0,8812,asymmetrical_clothing
@@ -2216,6 +2230,7 @@ erune,0,7674,erun_(granblue_fantasy)
blue_hairband,0,7674,
leggings,0,7665,
mushroom,0,7654,mushrooms
purple_legwear,0,7651,"purple_kneehighs,purple_leggings,purple_pantyhose,purple_socks,purple_thighhighs"
tank,0,7649,tanks
^o^,0,7644,
scathach_(fate),4,7643,"scathach_(fate)_(all),scathach_(fate/grand_order)"
@@ -2269,6 +2284,7 @@ takamachi_nanoha,4,7431,
bikini_pull,0,7431,bikini_down
shoulder_pads,0,7429,"shoulder_pad,shoulderpads"
asymmetrical_docking,0,7423,
beige_background,0,7421,
sakazuki,0,7416,sake_dish
doughnut,0,7407,"donut,donuts,doughnuts"
toramaru_shou,4,7387,
@@ -2402,6 +2418,7 @@ tiger_tail,0,6819,
orange_shirt,0,6810,orange_blouse
handheld_game_console,0,6807,handheld
white_fur,0,6803,
blue_neckwear,0,6799,"blue_ascot,blue_bowtie,blue_neckerchief,blue_necktie"
spiked_collar,0,6798,spike_collar
rolling_eyes,0,6782,"eye_roll,rolled_eyes,rolleyes"
standing_sex,0,6781,
@@ -2567,6 +2584,7 @@ yellow_bowtie,0,6134,
senran_kagura,3,6130,senran_kagura_(series)
belt_pouch,0,6129,
zhongli_(genshin_impact),4,6128,shouri_(genshin_impact)
grey_legwear,0,6127,"gray_kneehighs,gray_leggings,gray_legwear,gray_pantyhose,gray_socks,gray_thighhighs,grey_kneehighs,grey_leggings,grey_pantyhose,grey_socks,grey_thighhighs"
tamamo_no_mae_(fate/extra),4,6122,"caster_(fate/extra),tamamo_no_mae_(fate)"
ears_through_headwear,0,6121,
power_lines,0,6102,power_line
@@ -2619,6 +2637,7 @@ dawn_(pokemon),4,5915,"hikari_(pokemon),platina_(pokemon),platina_berlitz,platin
fishnet_thighhighs,0,5914,
sheep_horns,0,5913,ram_horns
shouting,0,5911,"shout,yelling"
platinum_blonde_hair,0,5911,
broken,0,5909,
the_legend_of_zelda:_breath_of_the_wild,3,5908,breath_of_the_wild
pokemon_xy,3,5907,"pokemon_x,pokemon_x&y,pokemon_x_and_y,pokemon_y"
@@ -2632,6 +2651,7 @@ black_capelet,0,5885,
white_belt,0,5875,
kujo_jotaro,4,5874,kuujou_joutarou
kitakami_(kancolle),4,5873,kitakami_(kantai_collection)
pink_legwear,0,5871,"pink_kneehighs,pink_leggings,pink_pantyhose,pink_socks,pink_thighhighs"
nervous,0,5862,
plaid_shirt,0,5859,plaid_blouse
multi-strapped_bikini,0,5859,
@@ -2683,6 +2703,7 @@ fish_tail,0,5737,
ibaraki_kasen,4,5729,ibara_kasen
oversized_object,0,5714,
ball_gag,0,5712,ballgag
blue_legwear,0,5707,"blue_kneehighs,blue_leggings,blue_pantyhose,blue_socks,blue_thighhighs"
white_hoodie,0,5706,
mahou_shoujo_lyrical_nanoha_a's,3,5706,"mahou_shoujo_lyirical_nanoha_a's,mahoushoujolyricalnanohaas"
shirakami_fubuki,4,5705,
@@ -2692,6 +2713,7 @@ striped_bowtie,0,5690,
old_man,0,5683,
red_capelet,0,5680,
jujutsu_kaisen,3,5680,
black_neckwear,0,5679,"black_bowtie,black_neckerchief,black_necktie"
planted,0,5675,planted_weapon
xd,0,5662,
matou_sakura,4,5660,
@@ -2857,6 +2879,7 @@ sparkling_eyes,0,5203,sparkle_eyes
dressing,0,5203,
thighhighs_under_boots,0,5197,
diamond_(shape),0,5196,
checkered,0,5196,checkerboard
asashio_(kancolle),4,5195,asashio_(kantai_collection)
red_sweater,0,5189,
cookie_(touhou),3,5185,
@@ -2927,6 +2950,7 @@ twilight,0,5023,
no_socks,0,5023,
keqing_(genshin_impact),4,5016,"keqing,kokusei_(genshin_impact)"
purple_lips,0,5008,"lavender_lipstick,purple_lipstick"
pot,0,5007,cooking_pot
exhibitionism,0,5004,
emiya_shirou,4,5001,
final_fantasy_vii_remake,3,4996,
@@ -3059,6 +3083,7 @@ yoko_littner,4,4654,yoko_ritona
condom_in_mouth,0,4654,
watashi_ga_motenai_no_wa_dou_kangaetemo_omaera_ga_warui!,3,4653,"no_matter_how_you_look_at_it,_it's_your_fault_that_i'm_not_popular.,no_matter_how_you_look_at_it_it's_your_fault_that_i'm_not_popular!,watamote"
full_armor,0,4653,
visor,0,4650,
striped_ribbon,0,4645,
junko_(touhou),4,4640,
leotard_under_clothes,0,4639,
@@ -3425,6 +3450,7 @@ sleeves_pushed_up,0,3866,
morrigan_aensland,4,3865,
blunt_ends,0,3865,
on_desk,0,3864,
fingers_together,0,3862,
teacher,0,3860,sensei
sideways_mouth,0,3859,"cheek_mouth,side_mouth"
long_bangs,0,3858,
@@ -3636,6 +3662,7 @@ fate/hollow_ataraxia,3,3510,
baggy_pants,0,3508,
nude_cover,0,3506,
grey_pantyhose,0,3505,
green_legwear,0,3505,"green_kneehighs,green_leggings,green_pantyhose,green_socks,green_thighhighs"
falling_leaves,0,3504,"blowing_leaves,flying_leaves,leaves_in_wind"
digital_media_player,0,3503,mp3_player
paradis_military_uniform,0,3500,
@@ -3819,6 +3846,7 @@ nitta_minami,4,3253,
kakyoin_noriaki,4,3253,kakyouin_noriaki
eiyuu_densetsu,3,3253,"legend_of_heroes,the_legend_of_heroes"
cynthia_(pokemon),4,3253,shirona_(pokemon)
vertical-striped_legwear,0,3250,"vertical-striped_kneehighs,vertical-striped_leggings,vertical-striped_pantyhose,vertical-striped_socks,vertical-striped_thighhighs,vertical_striped_legwear"
egg_vibrator,0,3250,egg_vibrators
figure,0,3249,figurine
dungeon_and_fighter,3,3249,"arad_senki,dungeon_fighter_online"
@@ -3859,6 +3887,7 @@ concept_art,0,3189,
test_tube,0,3187,
paper_bag,0,3184,
string_of_fate,0,3181,"red_string,red_string_of_fate,red_thread"
frilled_legwear,0,3181,"frilled_kneehighs,frilled_socks,frilled_thighhighs"
animal_crossing,3,3181,doubutsu_no_mori
kaburagi_t._kotetsu,4,3178,"kaburagi_t_kotetsu,kotetsu_t_kaburagi"
ahri_(league_of_legends),4,3176,ahri
@@ -4189,6 +4218,7 @@ arms_around_neck,0,2796,neck_hug
multi-tied_hair,0,2795,
bunny_print,0,2794,
shooting_star,0,2793,shooting_stars
green_neckwear,0,2793,"green_bowtie,green_neckerchief,green_necktie"
orange_hairband,0,2792,
beer_can,0,2791,
traditional_youkai,0,2790,youkai
@@ -4271,6 +4301,7 @@ working!!,3,2735,wagnaria!!
winged_arms,0,2735,
midorikawa_nao,4,2734,
vertical-striped_dress,0,2732,
hand_on_head,0,2732,
hagoromo,0,2732,
gloom_(expression),0,2732,gloomy
panda,0,2731,
@@ -4475,6 +4506,7 @@ seamed_legwear,0,2542,
jintsuu_(kancolle),4,2542,jintsuu_(kantai_collection)
horseshoe_ornament,0,2541,
ears_down,0,2541,
brush,0,2540,
mole_on_thigh,0,2539,
mogami_(kancolle),4,2539,mogami_(kantai_collection)
kanon,3,2539,
@@ -4698,6 +4730,7 @@ project_diva_(series),3,2384,
2017,0,2384,
ram_(re:zero),4,2383,
checkered_scarf,0,2383,
holding_person,0,2382,holding_another
tuxedo,0,2381,
cum_on_boy,0,2380,
bow_(bhp),1,2380,
@@ -4778,6 +4811,7 @@ animal_penis,0,2319,
accelerator_(toaru_majutsu_no_index),4,2318,accelerator
patterned_background,0,2316,
nichijou,3,2316,my_ordinary_life
room,0,2314,
on_lap,0,2314,
beach_towel,0,2314,
hair_spread_out,0,2313,
@@ -4798,6 +4832,7 @@ black_headband,0,2303,
saratoga_(kancolle),4,2302,saratoga_(kantai_collection)
flask,0,2302,
asphyxiation,0,2302,
yellow_legwear,0,2301,"yellow_kneehighs,yellow_leggings,yellow_pantyhose,yellow_socks,yellow_thighhighs"
egyptian_clothes,0,2301,
tally,0,2300,"tallies,tally_marks"
heart_tattoo,0,2300,
@@ -5206,6 +5241,7 @@ hilbert_(pokemon),4,2021,"black_(pokemon),male_protagonist_(pokemon_b&w),male_pr
eren_yeager,4,2021,eren_jaeger
azumanga_daioh,3,2021,"azumanga,azumanga_daiou"
gown,0,2020,
action,0,2020,
clothes_hanger,0,2019,coat_hanger
white_cardigan,0,2018,
nail,0,2018,nails
@@ -5321,6 +5357,7 @@ bronya_zaychik,4,1958,
bad_proportions,0,1958,
nengajou,0,1957,
hands_on_lap,0,1957,hands_in_lap
teenage,0,1954,teen
plunging_neckline,0,1953,
miyuki_(kancolle),4,1953,miyuki_(kantai_collection)
feather_earrings,0,1953,feather_earring
@@ -6102,6 +6139,7 @@ mechanical_pencil,0,1568,
sendai_kai_ni_(kancolle),4,1567,
wheel,0,1566,wheels
heckler_&_koch,0,1566,
hand_on_thigh,0,1566,
faux_figurine,0,1566,
rensouhou-kun,4,1565,
jinx_(league_of_legends),4,1565,
@@ -6208,6 +6246,7 @@ konoshige_(ryuun),1,1527,"ryuun_(stiil),ryuun_the_return"
has_censored_revision,5,1527,
different_reflection,0,1527,
circled_9,0,1527,"(9),Ôæ¿"
orange_legwear,0,1525,"orange_kneehighs,orange_leggings,orange_pantyhose,orange_socks,orange_thighhighs"
special_week_(umamusume),4,1524,special_week
rosehip_(girls_und_panzer),4,1524,rosehip
northern_white-faced_owl_(kemono_friends),4,1524,
@@ -6623,6 +6662,7 @@ matsuno_todomatsu,4,1379,todomatsu
jervis_(kancolle),4,1379,jervis_(kantai_collection)
endeavor_(boku_no_hero_academia),4,1379,todoroki_enji
charlotte_dunois,4,1379,
beige_sweater,0,1379,
alternate_weapon,0,1378,alternative_weapon
treasure_chest,0,1377,
stone_lantern,0,1377,
@@ -6647,6 +6687,7 @@ jean_pierre_polnareff,4,1371,
elesa_(pokemon),4,1371,kamitsure_(pokemon)
konno_junko,4,1370,
fake_facial_hair,0,1370,
hidden_eyes,0,1369,
hayashimo_(kancolle),4,1369,hayashimo_(kantai_collection)
eyewear_on_headwear,0,1369,
takodachi_(ninomae_ina'nis),4,1368,tako_(ninomae_ina'nis)
@@ -6770,6 +6811,7 @@ hand_on_eyewear,0,1332,hand_on_glasses
brown_necktie,0,1332,
sakuma_mayu,4,1331,
italian_flag,0,1330,
hand_on_breast,0,1330,
alice_margatroid_(pc-98),4,1330,alice_margatroid_(young)
aldehyde,1,1330,arudehido
saga,3,1328,
@@ -7261,6 +7303,7 @@ sausage,0,1191,
grey_bikini,0,1191,"gray_bikini,grey_bikini_bottom,grey_bikini_top"
bulbasaur,4,1191,
sona_(league_of_legends),4,1190,sona_buvelle
plaid_neckwear,0,1190,"plaid_bowtie,plaid_necktie"
papakha,0,1190,
molten_rock,0,1190,"lava,magma"
maebara_keiichi,4,1190,
@@ -7499,6 +7542,7 @@ nagatoro_hayase,4,1132,nagatoro
headwear_request,5,1132,headwear
boruto:_naruto_next_generations,3,1132,
they_had_lots_of_sex_afterwards_(meme),0,1131,they_had_lots_of_sex_afterwards
hand_on_shoulder,0,1131,
green_(pokemon),4,1131,blue_(pokemon_special)
plate_armor,0,1130,
park,0,1130,
@@ -7767,6 +7811,7 @@ doitsuken,1,1076,
clog_sandals,0,1076,
watatsuki_no_toyohime,4,1075,
user_interface,0,1075,
red_neckwear,0,1075,"red_ascot,red_bowtie,red_neckerchief,red_necktie"
nowaki_(kancolle),4,1075,nowaki_(kantai_collection)
mask_around_neck,0,1075,
lucas_(pokemon),4,1075,"diamond_(pokemon),kouki_(pokemon)"
@@ -7774,6 +7819,7 @@ keizoku_military_uniform,0,1075,
butterfly_net,0,1075,bug_net
aestus_estus,0,1075,
wall_of_text,0,1074,
low_tied_hair,0,1074,
hayasui_(kancolle),4,1074,hayasui_(kantai_collection)
chocolate_on_breasts,0,1074,
yuuki_yuuna_wa_yuusha_de_aru,3,1073,"yuki_yuna_is_a_hero,yuyuyu"
@@ -8515,6 +8561,7 @@ omori,3,926,
ogami_kazuki,1,926,
kara_(color),1,926,color_(artist)
bokken,0,926,wooden_katana
beige_jacket,0,926,
barbed_wire,0,926,razor_wire
baiken,4,926,
amagi_(kancolle),4,926,amagi_(kantai_collection)
@@ -8761,6 +8808,7 @@ kami_jigen_game_neptune_v,3,884,hyperdimension_neptunia_victory
hammann_(azur_lane),4,884,
credits,0,884,
brown_hoodie,0,884,
beige_shirt,0,884,
waiter,0,883,
godzilla,4,883,gojira
coconut,0,883,coconuts
@@ -9179,6 +9227,7 @@ dragging,0,824,drag
takoluka,4,823,
monomi_(danganronpa),4,823,monomi_(dangan_ronpa)
jouga_maya,4,823,joukawa_maya
hidden_face,0,823,
gills,0,823,
crime_prevention_buzzer,0,823,personal_alarm
unamused,0,822,
@@ -10269,6 +10318,7 @@ norasuko,1,699,
error_musume,4,699,
year_of_the_pig,0,698,
touwa_erio,4,698,
touching,0,698,
totokichi,1,698,fujimiya_yuu
sazaki_ichiri,1,698,
platinum_the_trinity,4,698,
@@ -10564,6 +10614,7 @@ duel_disk,0,669,
double_horizontal_stripe,0,669,
digital_dissolve,0,669,
cast,0,669,
black_clothes,0,669,
behind-the-head_headphones,0,669,
zen33n,1,668,"sea_(lordofk),zen_o"
wixoss,3,668,
@@ -10607,6 +10658,7 @@ holding_skull,0,665,
hardhat,0,665,
gun_to_head,0,665,
futatsuki_hisame,1,665,"darkhisame,soutsuki_hisame"
focused,0,665,
23_(real_xxiii),1,665,real_xxiii
warrior,0,664,
tokyo-3_middle_school_uniform,0,664,tokyo-3_middle_school_uniform_(evangelion)
@@ -10683,6 +10735,7 @@ shinshin,1,658,tigene
riza_hawkeye,4,658,
natsu_(anta_tte_hitoha),1,658,
mega_man_battle_network,3,658,"megaman_battle_network,rockman.exe,rockman_exe"
male_hand,0,658,
koi,0,658,koi_(fish)
ilulu_(maidragon),4,658,"ilulu,iruru"
hashitsuki_nata,0,658,nose_hatchet
@@ -11551,6 +11604,7 @@ vrchat,3,587,
volleyball_net,0,587,
toggles,0,587,
spas-12_(girls'_frontline),4,587,spas-12_(girls_frontline)
self_exposure,0,587,
red_tank_top,0,587,
pyrrha_nikos,4,587,
nagishiro_mito,1,587,
@@ -11564,6 +11618,7 @@ catsuit,0,587,
bekkankou,1,587,
argyle_cutout,0,587,
wooloo,4,586,
symbol,0,586,
side-tie_skirt,0,586,
poi,0,586,
metal_boots,0,586,
@@ -11677,6 +11732,7 @@ scouter,0,579,
print_swimsuit,0,579,
natsuya_(kuttuki),1,579,
megurigaoka_high_school_uniform,0,579,
lifting,0,579,
leo_(fire_emblem),4,579,"leo_(fire_emblem_fates),leon_(fire_emblem_if)"
kuroyukihime,4,579,kuro_yuki_hime
iahfy,1,579,k-y-h-u
@@ -11787,6 +11843,7 @@ mvv,1,571,rancy01
mamemaki,0,571,
kamina_shades,0,571,kamina_glasses
hanging_plant,0,571,
beige_cardigan,0,571,
aegis_sword_(xenoblade),0,571,
60+fps,5,571,
wool_(miwol),1,570,
@@ -12561,6 +12618,7 @@ sukoya_kana,4,520,
singlet,0,520,
pekoyama_peko,4,520,
natsume_eri,1,520,
mouth,0,520,
matanonki,1,520,"erokosei,kinnotama_(erokosei)"
kurasuke,1,520,
janong,1,520,
@@ -12624,6 +12682,7 @@ terry_bogard,4,516,
suzi_q,4,516,suzi_quatro
strength_(black_rock_shooter),4,516,strength_(brs)
snorlax,4,516,
side-tie_bottom,0,516,
risotto_nero,4,516,
kimoshi,1,516,deru06
haunter,4,516,
@@ -12853,6 +12912,7 @@ niiya,1,502,
mg42,0,502,
mawile,4,502,
kawachi_koorogi,1,502,kawauchi_kirigirisu
in_mouth,0,502,
fern,0,502,
cargo_pants,0,502,
calligraphy,0,502,
@@ -13074,6 +13134,7 @@ arashio_kai_ni_(kancolle),4,490,
yui_(sao),4,489,
ushiromiya_rosa,4,489,
two-tone_hoodie,0,489,
mechanical,0,489,
make_up_in_halloween!_(umamusume),0,489,
keenh,1,489,
kallen_kaslana,4,489,
@@ -13648,6 +13709,7 @@ takaman_(gaffe),1,459,nikonikosiro
pirate_costume,0,459,
oven,0,459,
okama,1,459,
multicolored_neckwear,0,459,
metal_skin,0,459,metallic_skin
mega_man_star_force,3,459,ryuusei_no_rockman
kingdom_hearts_birth_by_sleep,3,459,birth_by_sleep
@@ -13696,9 +13758,11 @@ otome_game_no_hametsu_flag_shika_nai_akuyaku_reijou_ni_tensei_shite_shimatta,3,4
nekoguruma,1,456,
movie_poster,0,456,
love_laika_(idolmaster),0,456,love_laika
innerboob,0,456,
hikami_sumire,4,456,
hijikata_toshizou_(fate),4,456,hijikata_toshizou_(fate/grand_order)
gavial_(arknights),4,456,
big_eyes,0,456,
azumi_kazuki,1,456,
anemone_(eureka_seven),4,456,
air_shakur_(umamusume),4,456,
@@ -14109,6 +14173,7 @@ karamoneeze,1,438,karamone-ze
houshin_engi,3,438,
gate_of_babylon_(fate),0,438,"gate_of_babylon,gates_of_babylon"
elf-san_wa_yaserarenai.,3,438,plus-sized_elf
beige_skirt,0,438,
asada_hachi,1,438,sayshownen
aqua_shorts,0,438,
amashiro_natsuki,1,438,
@@ -15646,6 +15711,7 @@ enomoto_takane,4,378,
dyson_(edaokunnsaikouya),1,378,
cocktail_shaker,0,378,
chocolate_on_face,0,378,
beige_fur,0,378,
arika_yumemiya,4,378,
yoru_no_yatterman,3,377,
wasabi60,1,377,
@@ -16282,6 +16348,7 @@ clitoris_slip,0,357,"clit_slip,clitslip"
butterfree,4,357,
blazpu,1,357,
big_hero_6,3,357,
beige_vest,0,357,
:<>,0,357,
zaphn,1,356,
yakumo_yukari_(young),4,356,lolikari
@@ -16656,6 +16723,7 @@ druaga_no_tou,3,346,tower_of_druaga
dean_(momodean),1,346,dean
citron_82,1,346,sanmi_kigen
cirno_day,0,346,
checkered_neckwear,0,346,checkered_necktie
bike_jersey,0,346,bicycle_jersey
arsene_lupin_iii,4,346,
arcane_jinx,4,346,
@@ -16998,6 +17066,7 @@ florence_nightingale_(trick_or_treatment)_(fate)_(cosplay),0,337,
fbc,1,337,
ech,1,337,
diglett,4,337,
diagonal-striped_neckwear,0,337,
coin_rand,1,337,rand_(artist)
clarevoir,1,337,flow_ech
chocolate_chip_cookie,0,337,
@@ -17336,6 +17405,7 @@ fainting,0,327,
creature_on_shoulder,0,327,
catnnn,1,327,"cat_(yidsv),tming"
carnival_phantasm,3,327,
beige_dress,0,327,
bakkanki,1,327,
walther_wa_2000,0,326,"wa-2000,wa2000,walther_wa-2000"
uyama_hajime,1,326,"hajime_(dinton),hajime_null"
@@ -18491,6 +18561,7 @@ daitaku_helios_(umamusume),4,298,
captain_nemo_(fate),4,298,captain_nemo_(fate/grand_order)
black_veil,0,298,
black_lady,4,298,
beige_coat,0,298,
aumann,1,298,
ambience_synesthesia,3,298,
akatsuki_uni,4,298,akatsuki_yuni
@@ -19464,6 +19535,7 @@ color_drain,0,278,
bwell,1,278,
bust_measuring,0,278,breast_measuring
black_sarong,0,278,
beige_pants,0,278,
beelzebub_(helltaker),4,278,
artoria_pendragon_(lancer_alter)_(royal_icing)_(fate)_(cosplay),0,278,
amaryllis_gumi,3,278,"amaryllis,amaryllis_class"
@@ -19624,6 +19696,7 @@ shigunyan,1,274,
scissorhold,0,274,headscissors
salamence,4,274,
opagi,1,274,
noise,0,274,
nirap,1,274,
nikku_(ra),1,274,
morio_(poke_orio),1,274,
@@ -19979,6 +20052,7 @@ soulcalibur_vi,3,267,
soukou_kihei_votoms,3,267,armored_trooper_votoms
shiranui_mai_(cosplay),0,267,
shirako_miso,1,267,
shatter,0,267,
samsung_sam,4,267,"sam_samsung,samanta_(samsung),samantha_samsung"
ripping,0,267,
omniscient_reader's_viewpoint,3,267,
@@ -22527,6 +22601,7 @@ judy_hopps,4,225,
johnny_(from_scratch),1,225,johnny_(artist)
jittsu,1,225,
holoforce,0,225,
holding_pot,0,225,
hino_minato_(spec.c),1,225,
heart_hair,0,225,
head_on_arm,0,225,
@@ -23040,6 +23115,7 @@ mikimoto_haruhiko,1,218,
mightyena,4,218,
mahou_shoujo_lyrical_nanoha_innocent,3,218,
magic_trick,0,218,
low_braid,0,218,
lee-enfield,0,218,
kujo_holy,4,218,kuujou_holly
kikkoumon,0,218,
@@ -24173,6 +24249,7 @@ caspar_von_bergliez,4,204,
brave_sword_x_blaze_soul,3,204,
bloom2425,1,204,
black_bird,0,204,
beige_shorts,0,204,
beanstalk_(arknights),4,204,
aruka_(alka_p1),1,204,arai3648
arnval,4,204,
@@ -25368,6 +25445,7 @@ acryl,1,191,
yurichtofen,1,190,
yoshiku_(oden-usagi),1,190,sakai_yoshikuni
yamato_junji,1,190,
watery_eyes,0,190,
wasabi_(legemd),1,190,
waktaverse,3,190,
valkyrie_(vnd),4,190,
@@ -26363,6 +26441,7 @@ breakdance,0,181,
bouncing_pecs,0,181,
bird_hair_ornament,0,181,
billy_the_kid_(fate),4,181,billy_the_kid_(fate/grand_order)
beige_footwear,0,181,
battle_damage,0,181,
atsumi_yoshioka,1,181,
arisaka_mashiro,4,181,
@@ -27815,6 +27894,7 @@ etan14,1,168,
encasement,0,168,
dress_aside,0,168,
dewgong,4,168,
dark_sky,0,168,
code:_nemesis_(elsword),4,168,
chibikko_(morihito),4,168,
bottle_cap,0,168,
@@ -27922,6 +28002,7 @@ breast_fondle,0,167,
blue-eyes_white_dragon,4,167,
black_eyeshadow,0,167,
binggong_asylum,1,167,zhixue
beige_headwear,0,167,
bakuretsu_hunters,3,167,sorcerer_hunters
back_to_the_future,3,167,
atlantic_puffin_(kemono_friends),4,167,
@@ -33459,6 +33540,7 @@ billy_herrington,4,129,
bilibili_xiaolu,1,129,
beru,1,129,
berserker_(granblue_fantasy),4,129,
beige_scarf,0,129,
bedside,0,129,
barbatos_(genshin_impact),4,129,
aurica_nestmile,4,129,orika_nestmil
@@ -33701,6 +33783,7 @@ takamiya_ren,1,127,
suwakana,1,127,
sugi87,1,127,
sudowoodo,4,127,
sucking,0,127,
studiolg,1,127,
street_fighter_ex_(series),3,127,"street_fighter_ex,street_fighter_ex2,street_fighter_ex3"
stomach_day,0,127,
@@ -34650,6 +34733,7 @@ viridi,4,122,nachure
violette,4,122,
usagino_suzu,1,122,
umiu_geso,1,122,
two-tone_neckwear,0,122,
tora_jun,1,122,
tokiwata_soul,1,122,
tights_day,0,122,
@@ -34824,6 +34908,7 @@ calvin_klein,0,122,
brown_camisole,0,122,
bow_swimsuit,0,122,
blue_vert,1,122,
beige_legwear,0,122,
bakeneko,0,122,
bai_linqin,1,122,
avengers:_infinity_war,3,122,
@@ -38835,6 +38920,7 @@ ko-on_(ningen_zoo),1,104,
kiriko_(overwatch),4,104,
khalitzburg,1,104,
kayune_niu,1,104,
karaage,0,104,
kanoe_(gallery_walhalla),1,104,
kaguura_(kagu),1,104,
kagari_(rewrite),4,104,
@@ -39943,6 +40029,7 @@ braco,1,100,
bollard,0,100,
blue_petals,0,100,
blue_door,1,100,
beige_border,0,100,
bartolomeobari,1,100,
azit_(down),1,100,
autocannon,0,100,
@@ -42602,6 +42689,7 @@ borumete,1,91,
blassreiter,3,91,
black_wrist_cuffs,0,91,
belfast_(the_noble_attendant)_(azur_lane),4,91,
beige_blouse,0,91,
bat-eared_fox_(kemono_friends),4,91,
bangom_r,1,91,
baldr_(series),3,91,
@@ -45657,6 +45745,7 @@ floatzel,4,82,
file_cabinet,0,82,
fikkyun,1,82,
fever-san,1,82,
feet_together,0,82,
faucre_the_evil_overlord,4,82,faucre
eye_poke,0,82,
extra_hands,0,82,
@@ -49312,6 +49401,7 @@ horizon_zero_dawn,3,73,
honoka_(summer_angel_on_the_shore)_(doa),4,73,
homil22,1,73,
hollow_mouth,0,73,
holding_neckwear,0,73,
hoerutarou,1,73,
hobbang,1,73,
hiyori-o,1,73,
@@ -51730,6 +51820,7 @@ canada,0,68,
c_(theta),1,68,
bzs_(kage_no_shinobu),1,68,"kage_no_shinobu,yin_gren"
butterfly_swords,0,68,
burn_mark,0,68,
bunnelby,4,68,
botamochi_(exwelder),1,68,
bmo,4,68,
@@ -52791,6 +52882,7 @@ binzoko_megane_(san-inch),1,66,
bianco_(mapolo),1,66,
ben_10:_alien_force,3,66,
bellows_camera,0,66,
beige_gloves,0,66,
beehive,0,66,
beegle,1,66,
beast_ball,0,66,
@@ -56232,6 +56324,7 @@ broken_pillar,0,60,
broken_heart_print,0,60,
broken_arrow,0,60,
braum_(league_of_legends),4,60,
boss,0,60,
bokujou_monogatari:_yasuragi_no_ki,3,60,harvest_moon:_tree_of_tranquility
boku_girl,3,60,
blue_(happinesscharge_precure!),4,60,blue_(precure)
@@ -56871,6 +56964,7 @@ another_story,1,59,
ankoro_mochi,1,59,
angelene,4,59,
ange_serena,4,59,
ancient,0,59,
anba_kohaku,1,59,
amoonguss,4,59,
amazu_(kurozu),1,59,sin_kurozu
@@ -57089,6 +57183,7 @@ potion_lilac,1,58,
pota_(bluegutty),1,58,
porocha,1,58,
polka_dot_pants,0,58,
polka_dot_neckwear,0,58,
plaque,0,58,
planetes,3,58,
pinoaisu,1,58,
@@ -59589,6 +59684,7 @@ victor_(tama_e_akira),1,54,
verse,1,54,
vergil_mon,1,54,
venus_rumble,3,54,
vapors,0,54,
van_fanel,4,54,
vampire_princess_miyu,3,54,
vaike_(fire_emblem),4,54,wyck
@@ -65580,6 +65676,7 @@ groose,4,47,
green_rope,0,47,
gravity_suit,0,47,
gradient_sarong,0,47,
gradient_neckwear,0,47,
gorou_naoki,1,47,ohutongoro
google_(asdek18),1,47,
gonzozeppeli,1,47,bellend
@@ -99901,100 +99998,3 @@ sengoku_kakeru,4,23,
sendai_(azur_lane),4,23,
senatorwong,3,23,
sen_no_maken_to_tate_no_otome,3,23,
semicircular_eyewear,0,23,
seira_orgel,4,23,
seigaaaa,1,23,
seal_costume,0,23,
sea_bishop,4,23,
sd_command_chronicles,3,23,
scyze,1,23,
school_shock,3,23,
scavenger_(survive)_(arknights),4,23,
scamp_(scamp_f16),1,23,
sawatari_honoka,4,23,
sawaki_rinna,4,23,
sawa30_(tan-g85mw),1,23,
sauron,4,23,
satsuki_g,1,23,
satou_youko,1,23,
satomune_s,1,23,
satomi_(stpri),4,23,
sato_zero915,1,23,
sasha_kaidanovsky,4,23,
sasaki33916,1,23,
sasagawa_kureo,1,23,
sarutobi_hiruzen,4,23,
sarisa,4,23,
sankusa,1,23,
sanju,4,23,
sand_girl_(last_origin),4,23,gs-10_sand_girl
sanada_yukariko,4,23,
san_diego_(sandy_claus)_(azur_lane),4,23,san_diego_(sandy_claus!)_(azur_lane)
samosuke,1,23,
samart_normal,1,23,
salt-apple,1,23,
sale_(jojo),4,23,
sakurapain6918,1,23,
sakurano_ru_(vtuber),4,23,
sakuramx,1,23,
sakurako_(blue_archive),4,23,
sakurahime,4,23,
sakuragi_hiroyuki,1,23,
sakura_no_sei_(onmyoji),4,23,
sakura_kiri,4,23,
sako_makoto,4,23,
sako_(criminal_girls),4,23,
sakino_(sanodon),1,23,
saki_saki_(kanojo_mo_kanojo),4,23,
sakasa_gurasan,1,23,
sakaki_chihiro,1,23,
saiunkoku_monogatari,3,23,
saito_himea,4,23,
saite_jewel_(idolmaster),0,23,saite_jewel
saimin_class,3,23,
saikin_imouto_no_yousuga_chotto_okashiindaga,3,23,"recently,_my_sister_is_unusual,recently_my_sister_is_unusual"
saika_s._falnese,4,23,
saggitary,1,23,
saeki_hina,4,23,
saddle_shoes,0,23,
sadan1317,1,23,
sachiko_(osomatsu-san),4,23,
sacchin_(yama),1,23,
saburou_(minami_makoto),1,23,
sabra_greengold,4,23,
sa_haru,1,23,
s_a_k_u,1,23,
ryuuichirou_(haineken),1,23,
ryukow_masseau,1,23,
ryouga_(fm59),1,23,
ryokotyu,1,23,
ryo_(piggerworld),1,23,
rushou_kei,1,23,
rush_sykes,4,23,
ruruguno_janus_enfinus,4,23,
rumlockerart,1,23,
rui_li,1,23,
rui_(bomberman),4,23,
rugrats,3,23,
ruebird,1,23,
rubin,1,23,
rou_honoo,1,23,
rotroto,1,23,
rotasu,1,23,
roselle_gustav,4,23,
rose_to_tasogare_no_kojou,3,23,
rose_(rose_to_tasogare_no_kojou),4,23,
rosalina_(cosplay),0,23,
rorinko,1,23,
roribo_rucha_hashira,1,23,
rooibos,1,23,
ronnie_z,1,23,
rom_sen,1,23,
rokumen_saikoro,1,23,
roguetwo,1,23,
rofuro-e,1,23,
roddick_farrence,4,23,
rock_pigeon_(kemono_friends),4,23,
robot_(manga),3,23,
robert_m,1,23,
robbie_(zelda),4,23,
Can't render this file because it is too large.