Giter Site home page Giter Site logo

a1111-sd-webui-tagcomplete's People

Contributors

azmodii avatar batvbs avatar bluelovers avatar ctwrs avatar derrian-distro avatar dominikdoom avatar for-acgn avatar hakaserver avatar halfmai avatar jibaku789 avatar kamilowaty122 avatar kinsmir avatar midcoastal avatar mmaker-gh avatar mulet-j avatar nocrypt avatar re-unknown avatar rkfg avatar sgmklp avatar shinshin86 avatar space-nuko avatar symbiomatrix avatar viyiviyi avatar yuxi-liu-wired avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

a1111-sd-webui-tagcomplete's Issues

Translation not working

  1. Download 82355cd as zip, extract to sd webui's extension folder \extensions\tag-complete\
  2. Create test.csv with content below and save with UTF-8 encoding, place it into \extensions\tag-complete\tags\
    solo,0,单人
    
  3. Change line 24 of \extensions\tag-complete\tags\config.json from "extraFile": "", to "extraFile": "test.csv",
  4. Launch sd webui and wait for tagcomplete loaded, then type sol in prompt textbox

Expected result:

0

Actual result:

1

Installed as Extension but it cant find correct directory, Docker

Hey again!

I installed this project as an extension under the directory /root/data/extensions/a1111-sd-webui-tagcomplete-main/* as instructed, /root/data is my webui root.

But I get this error when running the app RuntimeError: File at path /root/data/tmp/tagAutocompletePath.txt does not exist.
Not sure why it is searching within the ./tmp directory?

I am using the latest Automatic1111, and the latest of your code.
I also removed all the old files from your code before installing this one. Could there be any cached files left around?
Also cleared my cache just to be sure.

Thanks!

可以自己选择排序方式吗?

比如我想补全solo,但即使4个字母都打出来也没有出现想要的选项,得往下翻,可以自选怎么按照标签类型排序吗?
image

还有,可以按照字母顺序补全吗,比如我输入cat,补全就首选前三个字母是cat的
image

[我用google机翻了下tag,基本可以凑或用,中文好像得以utf-8保存,不然会乱码
danbooru.csv

Can't autocomplete Chinese characters

Normally, the tag autocomplete works perfectly
examples below use the word ninja (忍者)
normal_typing
But autocomplete dosen't show up after stop inputting Chinese characters
typing

Generally, Chinese native speakers use some kinds of input methods (or 输入法) as an assistance to input Chinese characters
After typing alphabet representations, one could choose right characters by pressing number keys or space (for current choice) or enter(for reserving inputted alphabets)
As shown above, autocomplete dosen't seem to work in these kinds of occasions. I vaguely remember that it was working few versions ago, but I'm not sure about how to test again

In additional, autocomplete for deleting seems to have similar problem
normal_delete
delete

Token of embedding that has some special characters can't be recognized

I got a embedding in png format, its token is something like emb_1.5

This embedding can't be recognized and not shown in the tag drop down list when type < (yes, it can be used correctly and recognized by the Train tab), I don't know how to change the token, changing the filename is not working, only emb_1.5 can active that embedding

I'm not sure legal characters for token of embedding, maybe other characters also triggers this bug but I don't know

p.s. Can you tell me about the <embedding name> thing? I think I saw this angle brackets syntax somewhere before but I can't find it now in wiki of a1111's webui here or here, did this syntax removed or something? Or is this a tagcomplete feature?

Left and right arrow shouldn't focus the autocomplete popup

Any time I'm trying to correct a spelling mistake with left and right arrow it focuses the popup instead.

I would expect that the up and down arrow keys would function to select from the autocomplete popup. Not the left and right arrows.

[Feature Request] Only autocomplete if a certain model is used

As the title states, I assume this script is only meant to be used with a certain stable diffusion model, so it would probably be good to add support for via the config file, specifying whitelisted models (aka models that accept these kind of tags) and only autocomplete IF one of these models are being used.

If due to my ignorance, or lack of knowledge this is supposed to be used with all sorts of models, then you can close this issue :)

(possible regression bug) Tag list not shown in `(<tag>)`, `[<tag>]`, `(<tag>:1.2)` syntax

Tagcomplete version: 92a0820

  1. Editing tag in weight parenthesis and no tag list shown, different from the demo here.

  2. Editing tag in simple weight syntax ((<tag>), [<tag>]) and no tag list shown unless blanks before and after the tag.
    When edit cat in (cat) (alias of (cat:1.1)), it searchs (cat) exactly, only tags like chen_(cat) matches but cat_ears do not.
    An1

    discussion: tag can and many of them do have parenthesis, but that's not needed when speaking of searching at most of times, for example cat have hundreds of related tags while (cat) is a valid tag component too but have only 9 matches out of 10k tags.
    So maybe it's safe (or to say tolerable) to ignore parenthesis of user input?

[Feature Request] Replace wildcard tokens

Do you think you can make this script work with the wildcard tokens from this script as well?
The idea is twofold:
First, after typing __ (two underscores), you get a list of all available .txt files. Selecting one completes the token.
Then, the list changes from available token names to the items of that list. Selecting one replaces the token with the item.

So, as an example:

  • Entering __ shows a list of the wildcard files, like artist, adjective, style,...
  • Selecting adjective replaces the __ with __adjective__
  • A list of the content of adjective.txt is shown: angry,beautiful,dark,...
  • Selecting ´beautiful´ replaces the __adjective__ with beautiful

Error running on colab webui automatic111 as an extension.

Quick Description how I got this error.

I installed this as instructed in the readme as an extension. Then once the webui is in final stages of loading up this error pops up. (note that the webui still functions and I can produce images, just the extention keeps spitting out errors constantly, the error following is the first error I get").

Error Log

Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
File "/content/stable-diffusion-webui/modules/scripts.py", line 168, in load_scripts
exec(compiled, module.dict)
File "/content/stable-diffusion-webui/extensions/tag-autocomplete/scripts/tag_autocomplete_helper.py", line 24, in
TAGS_PATH = get_tags_base_path()
File "/content/stable-diffusion-webui/extensions/tag-autocomplete/scripts/tag_autocomplete_helper.py", line 18, in get_tags_base_path
if (script_path.is_relative_to(EXT_PATH)):
AttributeError: 'PosixPath' object has no attribute 'is_relative_to'

My guess on what this could be

Looking at the error message I think the issue is script_path is not initialized. I looked at the code and the following is where its initialized.

def get_tags_base_path():
script_path = Path(scripts.basedir())
if (script_path.is_relative_to(EXT_PATH)):

Request: Scrollable tag lists (no, not a dupe of #27)

As non-native english speakers, we're not sure what we want or the exact spelling at most of the times, that's why showAllResults is set to true by default in chinese translate version

The typical usage is, user type few characters they remember and scroll down hundreds times to find out the exact word they want, or google if not found then

So the dropdown list with many result would be more convenient to use by supporting scroll actions (page up/page down/home/end)

[Feature Request] Automatically initialize wildcard list

The wildcard embedding works great, but is it possible for the available wildcard lists to be located by looking through the directory? I can't really think of a reason why you would not want a list to show up, and it makes adding a bunch of lists more of a hassle.

Autocomplete not working, generating error in dev console

I followed the instructions and ensured everything is in it's proper directory, but the autocompletes appear to not be turned on at all. I am receiving this error:

Cannot read properties of null (reading 'children') TypeError: Cannot read properties of null (reading 'children') at updateOnBackgroundChange ((index):773:45) at (index):910:5 at runCallback ((index):82:9) at Array.forEach (<anonymous>) at executeCallbacks ((index):88:11) at MutationObserver.<anonymous> ((index):93:9) runCallback @ (index):84 executeCallbacks @ (index):88 (anonymous) @ (index):93

I'm 99% sure the error is related to the above. I made sure and disabled plugins as well to rule them out.

The plugin "iCloud Passwords", the Apple password manager, breaks this plugin, fyi.

Feature Request: Ask A111 to add this as an extension

A111 now has the ability to have scripts and javascript to be added as an extension without having to have scripts and javascript populate outside of [basedir]/extensions/extension-name

It also offers the ability to update from github from inside A111.

I've done a quick test of your script loaded as an extension and as far as I can tell it all works like normal.

You might want to consider asking Automatic1111 to add your script to the list located at: https://raw.githubusercontent.com/wiki/AUTOMATIC1111/stable-diffusion-webui/Extensions-index.md

Characters getting swallowed while typing

When showAllResults is true (as I said in #34 (comment), it's basically necessary for chinese users), characters maybe swallowed when typing, even with small resultStepLength (50 in my case)

Demo: when I try to type guro
An2

A possible and popular way to solve this is to delayed the keypress event handler until user stop typing, or handle it asynchronously

For example generate the dropdown list keypressHandlerDelay ms later after user stops typing, the default value of the delay could be 300 ms or something and can be changed in config.json

performance issues with wildcards

With a lot of wildcards performance drops massively.

I got it turned off for now, and works fine with regular tags.

I'm using the wildcards from the dump on https://rentry.org/sdupdates so 483.

More than a dozen slows things down, more than a couple hundred makes the webui unusable.

Broken with correct parenthesis

It's even working with very wrong syntax, but a simple parenthesis breaks it with the latest version a038664 🤔

An1

error in js console
1

Uncaught (in promise) TypeError: can't access property "style", y is null
    k http://127.0.0.1:7860/assets/index.6d1e8daf.js line 1704 > srcScript:1
3 [index.6d1e8daf.js line 1704 > srcScript:1:2468](http://127.0.0.1:7860/assets/index.6d1e8daf.js%20line%201704%20%3E%20srcScript)

Uncaught (in promise) TypeError: can't access property "length", x[2] is undefined
    tags http://127.0.0.1:7860/:2028
    autocomplete http://127.0.0.1:7860/:2028
    <anonymous> http://127.0.0.1:7860/:2343
    dbTimeOut http://127.0.0.1:7860/:1752
11 [127.0.0.1:7860:2028:26](http://127.0.0.1:7860/)

No longer autocompleting since v1.2.2

I can only get autocomplete to work up to v1.2.2 but any version after that never brings anything up. Running the latest version of A111 via git pull on launch.

Not sure if related:
acConfig.activeIn is undefined TypeError: acConfig.activeIn is undefined <anonymous> http://127.0.0.1:7860/:1824 <anonymous> http://127.0.0.1:7860/:1814 runCallback http://127.0.0.1:7860/:82 executeCallbacks http://127.0.0.1:7860/:88 mutationObserver http://127.0.0.1:7860/:93 MutationCallback* http://127.0.0.1:7860/:92 EventListener.handleEvent* http://127.0.0.1:7860/:91

autocomplete not showing up

up dated the script to the newest version and now it is not working, regardless of the tick box saying auto complete on. no errors when running the script on start up.

Progressive auto-complete

(Copying from adieyal/sd-dynamic-prompts#20 (comment))

When writing a prompt, I can use the tab key to autocomplete wildcards. This is very useful, except it will auto-complete whichever one is the top one, rather than filling in only what is "common" to the current possibilities. This means I have to type out a considerable amount before I can auto-complete usefully.

For example, if the three files are "foofoo", "foobar" and "foobaz". I would expect the following:

  • f<TAB> becomes "foo"
  • foob<TAB> becomes "fooba"

Currently, f<TAB> would just autocomplete whichever happens to be first in the list of possibilities.

Additionally, this happens when auto-completing tags, not just wildcards, I just hadn't used tag autocomplete enough to notice it.

Have issue working with weight syntanx and editing prompt

  1. Interfere vanilla hotkey to chagne weight, i.e. select a word and press ctrl+↑ or ctrl+↓ to quick change weight of it. With tagcomplete runnig, this hotkey no longer works

    For example double click to select word dog in prompt girl, (sad:1.5), dog and press ctrl+↑, the prompt changes to girl, (sad:1.5), (dog:1.1) automatically, when tagcomplete is not installed

  2. Have problem showing complete drop list inside weight parenthesis when edit existed tag

    For example select dog in girl, (sad:1.5), dog and type runn to overwrite it, the tagcomplete list shows and I can tab to select running
    But select sad and type runn to overwrite it, no list shows.
    Select sad and type runn still no list show.
    Select sad and type runn the list shows but tab or click running nothing happens.

    demo
    An1

Typing issues using autocomplete

I've had to completely remove this since it's causing way too many issues with typing anything into text2img. It basically made me think my keyboard was broken since almost every word i typed would miss letters or miss spaces out. Not sure what is causing it but after removing it completely it has gone back to the way it was.

I really like this addon for A111 and it's been really useful to me in generating prompts but I wish we could perhaps choose what parts of the script are used. For example to be able to disable wildcards/embedding/etc so that the user can pick what they want. For example, i don't really use wildcards/embeddings most of the time if at all but I like using the danbooru/e621 auto complete tags and it gives me ideas when using it that I might not have thought about.

Obviously this is your project and I don't want to come across as being one of those users that demands things every day but I wanted to report what i've found.

Using https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/releases/tag/1.7.3
Firefox
Windows 10

config.json dosen't work?

I added the script on sd-webui and it work.
But I changed "tagFile" to customtags.csv and "maxResults" to 8 but there is no my custom tags csv and maxresults still is 5

Migrate to extension

This script is maybe the most helpfull that I ever installed. But the update is may be the weakest part. Migrate it as an extension could fix it at all.

Thanks for your work.

Error loading script

I use the colab version of lastben (https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb) Based on python3.7
Seems the extension can't read the correct path of the tag folder.
How to change the path?

Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 170, in load_scripts
exec(compiled, module.dict)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 77, in
write_tag_base_path()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 63, in write_tag_base_path
f.write(TAGS_PATH.relative_to(FILE_DIR).as_posix())
File "/usr/lib/python3.7/pathlib.py", line 900, in relative_to
.format(str(self), str(formatted)))
ValueError: '/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/tags' does not start with '/content/gdrive/MyDrive/sd/stable-diffusion'

Request: Scrollable tag lists

When autocompleting tags with this tool, it seems to max out at 5 or so tags. But if I search for Hair, I might want to scroll down with the down arrow and load more tags, if present. Maybe that option could be added somehow?

image

I need a hand to install the extension in colab

Hello i'm user https://colab.research.google.com/github/TheLastBen/fast-stable diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb

And I get this message
Captura de pantalla 2022-11-07 a las 14 10 35

Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 170, in load_scripts
exec(compiled, module.dict)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/tagcomplete/scripts/tag_autocomplete_helper.py", line 77, in
write_tag_base_path()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/tagcomplete/scripts/tag_autocomplete_helper.py", line 63, in write_tag_base_path
f.write(TAGS_PATH.relative_to(FILE_DIR).as_posix())
File "/usr/lib/python3.7/pathlib.py", line 900, in relative_to
.format(str(self), str(formatted)))
ValueError: '/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/tagcomplete/tags' does not start with '/content/gdrive/MyDrive/sd/stable-diffusion'

how can it work?

Autocomplete of wildcards and embeddings is not shown.

Normal tag autocompletion works fine, but wildcards and embedding autocomplete are not shown. In tags/temp , wc.txt and emb.txt are listed normally. I wonder if there is something I am missing.

Version used: 1.5.1

[Feature request] make autocomplete suffix (`, `) optional in config file

tagcomplete add comma when select a tag from result unless it's

However there're many situation that comma after a tag is not needed

  1. multiple tags in parenthesis for example complete (wet swimming:1.2)

  2. Some people suppose that even for novelai model, natural sentence works better than tag style when describe background and actions, I feels it's true so I use more natural sentences now, that's when the auto suffix is unnecessary or even bothering
    In this demo I have to press backspace many times to write a short sentence
    An1

  3. The smart detection is limited, , is not added to (<tag>:<number>), but still added to (<tag>) or [<tag>], it only works when editing too, writing (dog ears:1.2) character by character with tagcomplete you get (dog ears, :1.2)

  4. It's not needed in editing, change cat to cat ears in girl with cat and tail with tagcomplete
    the result will be girl with cat ears, and tail (note there are two space after ,)

Ctrl Up Keybind Breaks Input

The default keyboard shortcut of highlighting a tag, then pressing ctrl+up or control+down to increase or decrease emphasis breaks because the up and down arrows inputs get sent to the dropdown instead.

Menu does not showk when a () prompts exist

I had downloaded the latest version through the Git clone that puts it into the extensions folder.
Ever since it only works when there are no () prompts anywhere in the positive ones.

As soon as you add one at any spot it just breaks and does not show the menu anymore. And that's when you try and add one before or after a () prompt.

Not a cache issues since that's cleared. Originally i had it in my Stable Diffusion folder itself and that worked without issues. Those files are gone now since i replaced it with a fresh git clone into the extensions folder.
Also running this Locally on a Linux machine, if that matters.

Problem displaying tag in <li> if tag starts with <

Hello,

I was making a custom tags file, and added my embeddings (textual_inversion) as tags in the form "<name_embedded>" to enable autocompletion and stuff.

After editing my target csv file I noticed that the autocomplete function filters correctly but does not show the element in the list (the tag <name_embedded> appeared like '' )

I resolved the issue escaping the < and the > symbols with the html equivalent.

The line I edited

li.innerHTML = result[0];

was replaced with
li.innerHTML = result[0].replace('<','&lt;').replace('>','&gt;');
and the issue is solved.

I mean, I know that the custom script is based on danbooru tags but maybe the scripts need html escaping to avoid those types of issues.

Request: Allows auto completion using the TAB

English is not my native language; please excuse typing errors.
When autocompleting tags , I can only seem to use the arrow keys and enter or click the candidate with the mouse, I feel this is not very easy to use.
It might work better if you could just press TAB to complete the first candidate as soon as one is available, and would also be in line with most ides

Have problem detecting newlines in prompt

tagcomplete works perfectly everywhere in prompt in one line, for example cat, dog, girl

But with newlines (which is valid for webui), it has problem handling it

For example in prompt:

cat, dog,⛔
⛔girl

tagcomplete is not working in position of mark, while it's working in position of mark

cat, dog,✅girl

demo:
An1

Script doesn´t work for me

Javascript File is in the right place, and so is the "tags" Folder (btw both Version 1.4.2)

(index):80 Cannot read properties of null (reading 'querySelector') TypeError: Cannot read properties of null (reading 'querySelector')

Yet there is no popup or anything showing up when I load the Web-UI.

I even tried it with another Browser (default Firefox, other being Chrome) and the result is the same.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.