a1111-sd-webui-tagcomplete

Booru style tag autocompletion for AUTOMATIC1111's Stable Diffusion web UI

MIT License

Stars
2.4K

Bot releases are visible (Hide)

a1111-sd-webui-tagcomplete - Release 3.0.0 - Adaptive completion / frequency sorting Latest Release

Published by DominikDoom 6 months ago

This is a major feature release that adds adaptive sorting to Tag Autocomplete.

In simple terms, the more you use a tag, the higher it will rank, meaning it gets pushed to the top of the list over time. You will have to type less to reach your favorite tags, even if their post count is much lower than other matches for your search term. It also works for all other completion types TAC supports, such as Loras, embeddings and wildcards.

This is a big change in how Tag Autocomplete shows its results, which is why it was "in beta" for quite a while. While I have used it for months already without issue, there might still be some oversights, so if you happen to encounter any problems with it, feel free to open an issue.

A tag sorted higher due to frequency will be marked with the ✨ symbol. It can also be reset at any time:
image

"solo" ranks higher than "sole_female"/"1girl":
image

"standing" ranks first despite a much lower post count:
image

Also works for embeddings:
image

And for lora:
image

New settings:
image

New settings:

As usual, the feature is very customizable through a number of settings (also shown in the example images):

  • Locally record tag usage and sort frequent tags higher
    • Turns the feature on/off
  • Function to use for frequency sorting
    • This determines how strong the influence of usage count on the sort order should be.
  • Minimum number of uses for a tag to be considered frequent
    • As the name suggests, usages lower than this will just be ignored.
  • Maximum days since last use for a tag to be considered frequent
    • This will not consider tags you haven't used for a long time to prevent having to manually reset them. It will continue as normal from the old count after you first use it again.
  • Maximum number of recommended tags
    • Caps the maximum number of recommendations at the set value to prevent them from completely displacing normal results (especially relevant for Extra Networks, as they have no inherent post count).
  • Frequency sorting matches aliases for frequent tags
    • Normally, aliases are ignored during frequency sorting since they would often get in the way of the wanted result (due to the main tag the alias links to ranking higher again, e.g. with the "solo" example).
a1111-sd-webui-tagcomplete - Release 2.12.0

Published by DominikDoom 6 months ago

Added:

  • Two new tag lists, thanks to @Nenotriple (#280)
    • English Dictionary words
    • Derpibooru (My Little Pony)
      • Note: Derpibooru has a different color scheme than the existing tag files. If you are updating from a previous version and want to use it, you need to remove the tac_colormap setting value from your webui's config.json to reset it, or add this to it yourself.
  • Allow custom modifier keys for list navigation, thanks to @Symbiomatrix (#276)

Fixed:

  • Hide loras according to settings, thanks to @rkfg (#272)
  • Embeddings can now be completed using their relative paths (not shown in the dropdown list) to better support subfolder organization. Thanks to @Symbiomatrix (#277)

Changed:

  • Danbooru tag data was updated from 2022 to 2023, thanks to @wtre59 (#274)

Full Changelog: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/compare/2.11.0...2.12.0

a1111-sd-webui-tagcomplete - Release 2.11.0

Published by DominikDoom 9 months ago

This release is for version parity with the main branch and contains all additions and bug fixes of the last few months.

Added:

  • Extra network model sort selection (e.g. sorting by newest instead of alphabetically), with the help of @Symbiomatrix (#236, #237)
  • Support for deepdanbooru-object-recognition textareas by @Jibaku789 (#261)
  • SFW version of e621 tags by @yuxi-liu-wired (#253)
  • Ability to search for & insert prompt style names as shown in the webui dropdown menu (#268)

Fixed:

  • Malformed YAML wildcards no longer stop the extension from loading (#240)
  • Wildcards containing $ signs are now inserted correctly (#247, #248)
  • Wildcards are no longer cut off after a colon in the inserted text (#267)

Changed:

  • Attempt to use built-in extra networks lists if available, with the help of @midcoastal (#255)
    • This reduces or removes the need to redundantly scan for files and improves startup time for large Lora collections.
  • If Lyco models are kept in their own folder, the extension will now still insert them with the <lora: prefix since modern webui versions don't use the <lyco: prefix anymore (#263)
    • A backwards compatibility option is provided for those using an old version with the third-party lycoris extension.

Full Changelog: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/compare/2.10.6...2.10.7

a1111-sd-webui-tagcomplete - Release 2.10.6

Published by DominikDoom about 1 year ago

Minor release containing two new options.

Added:

  • Option to include embeddings in the normal tag search (without needing the < prefix) (#230)
    • They are added before the normal tags if enabled. For quicker navigation in long lists, End and Home or whatever the JumpTo... keybinds are set to will select the first non-embedding result in the list depending on the direction.
  • Option to choose trigger keyword insertion position (#232)
    • Available are: "Start of prompt" (current behavior), "End of prompt" and "Before LORA/LyCO", which will insert it right in front of the currently completed Lora name.
a1111-sd-webui-tagcomplete - Release 2.10.5

Published by DominikDoom about 1 year ago

Minor release, including mostly bug fixes and support for new webui or third party features.

Added:

Fixed:

  • Result list no longer captures input if macOS cmd key is pressed (#222)
  • Force reload embeddings on temp file refresh, thanks to @Symbiomatrix (#223)
  • If the booru wiki links setting is enabled, it will now correctly remove translations before adding the link
  • Rework wildcard file content requests to use their own API endpoint instead of default gradio
    • This fixes an issue likely caused by relative paths & symlinks / junctions
a1111-sd-webui-tagcomplete - Hotfix 2.10.1

Published by DominikDoom about 1 year ago

Fixed:

  • Use built-in API endpoint (webui v1.1.0 and newer) for preview images to allow symlinks / external dirs (#217)
    • Will create direct blob urls as a fallback if the built-in endpoint isn't found for whatever reason
  • Look for GIF previews as well
a1111-sd-webui-tagcomplete - Release 2.10.0 - Extra Network live previews

Published by DominikDoom about 1 year ago

This release adds a small preview window for extra network completion that will show their respective card thumbnails.
With this, it's now possible to quickly compare similar Loras, embeddings or hypernetworks without having to stop typing to look them up in the webui menu. It's on by default, but can be disabled in the settings.

extra_live_preview

Added:

  • Live previews for extra networks & setting to enable/disable it
  • Option to keep internal wildcard file order instead of sorting alphabetically
    • This allows to preserve a custom order or otherwise special file structure that would be disturbed by sorting

Fixed:

  • Native Lora keyword lookup now works for arbitrarily deep subfolders instead of just one level
  • Loras in subfolders are sorted correctly by name again
    • As a bug since v2.8.0, they were sorted including their folder paths, even though these paths aren't shown in the results list.
    • This would lead to confusing situations where "subfolder/A_Lora" would come after "B_Lora" in the list, but still be displayed as just A_Lora without the prefix.
  • Model keyword hash cache lookup consistency fix, thanks to @bluelovers (#215)
a1111-sd-webui-tagcomplete - Release 2.9.0 - Dynamic Prompts YAML wildcard support

Published by DominikDoom about 1 year ago

This release adds support for the YAML wildcard format https://github.com/adieyal/sd-dynamic-prompts uses.

Added:

  • Support for sd-dynamic-prompt wildcards in YAML format

Fixed:

  • "Issue with tags found in file" error message caused by Umi AI completion support
  • Duplicate entries from wildcard files with the same name (or YAML wildcards with the same keys)
    • Previously, this would show duplicate entries in the completion dropdown and only show content from the first match.
    • Now the entries get grouped together, so if two files both specify the category "clothes", or two different "clothes.txt" wildcard files exist in different folders of the same level, it will concatenate them into one result.
a1111-sd-webui-tagcomplete - Release 2.8.0 - Feature additions for WebUI v1.5.0

Published by DominikDoom about 1 year ago

This release adds support for the new Lora functionality added in the v1.5.0 WebUI release.

Since the webui now provides a native option to manually add trigger words for Loras, these will be preferred over the model-keyword ones if they exist. To enable it, the option must still be changed from "Never" to "Only user list" or "Always", which is now also possible without model-keyword being installed.

Support for visually differentiating Loras for SDv1/v2/XL in the list like with embeddings isn't included for now, but I plan to add it eventually since this info is now much more accessible than before in the webui.

Added:

  • Support for parts of the new extra networks config UI
    • Use specified activation keywords if enabled in the tag autocomlete settings
    • Use preferred weight per file if set

Changed:

  • Trigger word completion now works without model-keyword, but only for the trigger words set in the extra networks config menu
    • Trying to auto-find unknown keywords will still require the list provided by model-keyword
a1111-sd-webui-tagcomplete - Hotfix 2.7.3

Published by DominikDoom about 1 year ago

Fixed

  • Error at startup if temp folder didn't exist yet (#203)
  • Another encoding error (#204)
a1111-sd-webui-tagcomplete - Hotfix 2.7.1

Published by DominikDoom about 1 year ago

Fixed

  • Error while writing hash cache file for loras with non-ASCII characters (model-keyword support)
  • If Lyco and Lora paths were identical, it would result in duplicate entries
    • This can for example happen if using the --lyco-patch-lora argument to replace built-in lora with the lycoris extension
    • Now skips Lyco loading in that case
a1111-sd-webui-tagcomplete - Release 2.7.0 - Lora / Lyco trigger word completion

Published by DominikDoom about 1 year ago

Adds support for automatically inserting known trigger words on autocompleting a Lora/Lyco that uses them.
It requires the https://github.com/mix1009/model-keyword extension to be installed to work, but it can be deactivated afterwards.

For more info, see the accompanying README section.

Added:

  • Trigger word insertion using the model-keyword extension lists
  • Separate option for adding commas and spaces

Changed:

  • Reworked settings to include more & better descriptions, using the newer webui OptionInfo features if available.
a1111-sd-webui-tagcomplete - Release 2.6.0 - Partial wildcard completion

Published by DominikDoom over 1 year ago

Some wildcards are organized in nested folders, like "hair/colors/light/..." or "clothing/male/casual/..." etc.

This was annoying to select so far, since you either had to scroll far down in the list or manually type in the path until the point where the subfolders start to differ and separate the wildcards into different categories.

With this release, it now both color-highlights the nested paths to easier discern the folder levels, as well as offer a partial path completion.
If all available options are nested paths, pressing Tab will not insert the full text anymore, but instead (depending on the settings) complete until the next / or until the first difference, then stop until the user clarifies or chooses the way forward.

Added:

Fixed:

  • Fallback for translation format
    • If the 3-column format is checked in the settings, but the file doesn't have that many columns, it will either choose the second column or "Not found" if that isn't there either (instead of the script silently breaking)
a1111-sd-webui-tagcomplete - Release 2.5.1 - Readme updates & path fixes

Published by DominikDoom over 1 year ago

The biggest change in this Mini-Release is the updated README. English is now up-to-date with all current options and features (and also got a new look to be less overwhelming), while Japanese and Chinese still lag behind. If you speak those languages, help translating would be much appreciated.

Also, finally a long-standing issue with Gradio security restrictions was fixed / worked around, which previously prevented the extension from working with a custom --data-dir specified in the webui launch args:
You will need to add the --gradio-allowed-path argument to your webui start script to make it work, else the helper will not throw the error anymore, but the server will still return 403 Unauthorized for any extension's JavaScript file or tags file the webui tries to load.

A word of caution if you share the webui on your local network or even as a public server:
The allowed path will be publicly exposed. A simple JavaScript fetch("file=path/to/file") can access any file contents in that directory and its subdirectories, as long as the filename is known. You need to be careful what you allow in there.
I suggest only allowing the install dir of tag autocomplete itself for base functionality, or if you use wildcard extensions and want to use the wildcard completion feature, the whole extensions dir at most.

a1111-sd-webui-tagcomplete - Release 2.5.0 - File refresh QoL

Published by DominikDoom over 1 year ago

To enable autocompletion for Loras, embeddings, hypernets, and wildcards, Tag Autocomplete writes some internal temporary files on startup after looking for these entries in your local files.

This release adds a new "fake" settings option with a refresh button that allows you to update those temp files without needing to restart the UI.
image
You can add it to your quicksettings list to have it available at all times, making it a nice Quality of Life feature if you add new Loras etc. often.

a1111-sd-webui-tagcomplete - Release 2.4.0 - Live translation feature WIP

Published by DominikDoom over 1 year ago

This release contains a WIP version of a live translation feature.
The option defaults to off, but you can activate it by choosing a translation file and checking "Show live tag translation below prompt".
It will not affect the normal functionality if it is off.

It looks like this:
image
Example with Chinese since the idea came from Chinese users and I already had translation files lying around from testing. But it should work for any language, although I didn't test it outside of Chinese.

Clicking on a detected tag will also select it in the prompt for quick editing.
image

Known issues:

The translation updates when the user types or pastes text, but not if the action happens programmatically (e.g. applying a style or loading from PNG Info / Image Browser). This can be worked around by typing something manually after the programmatic edit.

a1111-sd-webui-tagcomplete - Release 2.3.0 - Chants

Published by DominikDoom over 1 year ago

This release adds the "Chants" feature, along with various bug fixes for newer Gradio versions and extended third party support.

Chants are a new type of data the script can load and insert. They are basically longer presets, snippets, or even full prompts and function like shortcuts. There's a new demo-chants.json file included to get started, but for more info please have a look at the accompanying README section Chants.
Chants are unique in that they support different keywords for search, display, and insertion. That means you can create a very complex and long prompt, give it a unique and compact display name, and add as many search terms as you want that should correlate to it. The search terms can be completely different from the final prompt that gets inserted, so you can use them like shortcuts for your favorite prompt snippets.

Added:

Fixed:

  • Various fixes for Gradio 3.28.0
  • More fallbacks for Gradio 3.16.0 and older webui versions
  • Model black/whitelist change detection fixes
  • Dark mode detection fixes
  • Helper script now correctly follows symlinks for hypernets, lora and lycoris, like the webui itself does
  • Fix long results lists sometimes not scrolling to the top correctly on the first letter of a new tag/command
  • Fix for tag file change not registering without restart if changed in quicksettings
a1111-sd-webui-tagcomplete - Release 2.2.0 - LyCORIS support

Published by DominikDoom over 1 year ago

Added:

a1111-sd-webui-tagcomplete - Release 2.1.0

Published by DominikDoom over 1 year ago

This release mainly includes support for Gradio 3.23.0 used by the current webui version.

Added:

  • Completion popup moving with the cursor while you type (can be disabled in settings)
  • Customizable hotkey bindings (now also in settings)
  • Hypernet and Lora prefixes now also provide completion if they are typed out, not just for the <h: and <l: abbreviations
  • _ can now be used as a stand-in for spaces in Embedding, Hypernet and Lora names to enable typing out filenames containing spaces without the popup closing & trying to find a new tag.

Fixed:

  • Broken "Only show alias" option
  • Various fixes for Gradio 3.23.0
  • Uses built-in update event, which fixes a long-time noncritical browser console error
  • Pressing enter while no tag is selected will not block default behavior anymore

Changed:

  • Colors are now changed in the normal settings like the keymaps instead of a separate file, to prevent override when the extension gets updated through the webui
a1111-sd-webui-tagcomplete - Release 2.0.0

Published by DominikDoom over 1 year ago

This release doesn't add many new features, but includes a fairly big refactoring of the code base, which is why I decided to raise the main version number for it.

I took care to test all existing features, but it is still quite possible that this could break things, so feel free to open an issue if something doesn't work for you. This will also likely break backwards compatibility for some extra files, if you use any, as well as forks due to the large change in code structure.

Added

  • New code architecture that uses global lists to execute functions added to it
    • This enabled me to move all "extended" completion, like wildcards, embeddings, and UMI support to their own files.
    • The main code is now much less monolithic and a good bit shorter and more readable.
    • This is still all intended for internal use, but will make it much easier for me (or others) to add or maintain features with only minimal changes to the main file.
  • Small "quality tags" extra file, see the next section for more info
    • This serves as an example for the new extra file system and adds the common quality tags used by most anime based models.
    • It's the new default, but if you are updating from an older version, you have to manually select it in the settings.

Changed

  • The extra file system was reworked
    • Now only for adding new custom tags.
    • This also removed this setting's dangerous ability to hang the whole page if the chosen file was too large.
    • Extra files support all values of normal tags (including aliases), except not having a count but instead a descriptive meta text in column 3.
    • Added a new setting to choose if they should be added before or after the normal tags. They can "take away spots" of normal tags if you have limited your results.
  • Added pycache folder created next to the helper script to the gitignore.

Fixed

  • Completion after < now works if another < follows directly after it or after a space
    • Since < was originally only for embeddings, they were removed after inserting them. But with the new system for hypernets and loras, the < stay in the prompt.
    • This led to a semi-common situation of autocomplete not working if we want to insert another embedding, hypernet or lora before an existing one.
    • It was possible to work around by placing a comma, but very annoying. Now it should work in almost all situations, even if no space at all is left before it.
  • Wildcard completion now allows spaces in wildcard file names.
    • This is only relevant if we want to continue browsing the selected wildcard file to choose one of its contents, but failed before due to the parser not recognizing it as a continuous piece.
    • This only works for names enclosed in __, so wildcard file will work after choosing it in the completion, but manually typing it out letter by letter will still close it on a space.
  • Extra files now no longer hang the page if they are too big.
    • The old system performed a lookup for each tag in the main file per extra tag, since it was originally used for translations.
    • This resulted in a quadratic time complexity, which froze the page or whole browser for unsuspecting users that accidentally chose a large file.

Removed

  • "Only alias extra file" option
    • With the rework to extra files, this no longer had any purpose.