DominikDoom / a1111-sd-webui-tagcomplete

Booru style tag autocompletion for AUTOMATIC1111's Stable Diffusion web UI
MIT License
2.54k stars 306 forks source link

Embeddings Dont work anymore #100

Closed Flonixcorn closed 1 year ago

Flonixcorn commented 1 year ago

after newest update embeddings autocomplete doesnt work anymore, no errors

DominikDoom commented 1 year ago

See #99, update your webui. Although it should work with the fallback. Does it print a hint about it in the terminal?

Flonixcorn commented 1 year ago

Everything up to date to the last corners

image

Already up to date. venv "X:\AI\StableDiffusion\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] Commit hash: 5cf2f3992998339a508850f44a7b690159110eb5 Installing requirements for Web UI Installing requirements for scikit_learn

####################################################################################################### Initializing Dreambooth If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] Dreambooth revision: 4ca69a904f5ddd5651d87032b3dca515eea505ba SD-WebUI revision: 5cf2f3992998339a508850f44a7b690159110eb5

Checking Dreambooth requirements... [+] bitsandbytes version 0.35.0 installed. [+] diffusers version 0.10.2 installed. [+] transformers version 4.25.1 installed. [+] xformers version 0.0.14.dev0 installed. [+] torch version 1.12.1+cu113 installed. [+] torchvision version 0.13.1+cu113 installed.

#######################################################################################################

Installing requirements for dataset-tag-editor [onnxruntime-gpu]

Launching Web UI with arguments: --xformers --no-half SD-Webui API layer loaded Loading config from: X:\AI\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion!!SD2.0\SD2.1\v2-1_768-nonema-pruned.yaml LatentDiffusion: Running in v-prediction mode DiffusionWrapper has 865.91 M params. Loading weights [e1542d5a] from X:\AI\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion!!SD2.0\SD2.1\v2-1_768-nonema-pruned.ckpt Applying xformers cross attention optimization. Model loaded. Textual inversion embeddings loaded(92): AnalogEmbeddingV1, AnalogEmbeddingV2, AnalogEmbeddingV3, AnalogEmbeddingV4, AnalogEmbeddingV5, AnalogEmbeddingV6, ANimeFiredragonGIrl, ANimeFiredragonGIrlv2, AnimeScreenCap768, AnimeScreenCap-90, anthro, Art by Smoose-22, CandyPunk-90, CarHelper, CGI_AnimationV2-185, CGI_AnimationV2-245, CGI_AnimationV2-215, ChemPunk-96, Cinema768-Digital, cspv1, CutAway-420, CutAway-460, CutAway-500, DaveSpaceOne, dblx, dtekv1, dtekv2, dtekv3, flonixsdviewalternative, flonixsdviewv1, flonixsdviewv2, flonixsdviewv3, flonixsdviewv4, flonixsdviewv4test, FloralMarble, HeartArt, highoctane_car-2000, HorrorByDave, HyperFluid-300, HyperFluid, HyperNuke, InkPunk768, InkPunk768_2, InkPunkHeavy768, InkPunkHeavy768_2, InkPunkLandscapes768, InkPunkLandscapes768_2, InkPunkLite768, InkPunkLite768_2, JenniferLawrence, JenniferLawrencev2, Kipaki-100, Kipaki-125, Kipaki-150, knollingcase768, MagicLightv1, midjourney, midjourney768, mjart, MJPapercut768, Neg_Facelift768, PhotoHelper, PhotoHelper768, RainAndMonsters768, RenderStyle768, samdoesart768, samdoesart768v2, samdoesart768v3, samdoesart768v4, samdoesart768v5, samdoesart768v6, SamDoesArts768, samdoesarts768bad, SamDoesArtv7, ScaryMonstersV2, SCG768, SCG768v4-100, SCG768v4-200, SCG768v4-Portrait-beta, sideviewv3, starwarstest, testmixembed, ThisHonor, venomv1, VikingPunk, vray-render, wcat8-v1-1000, wcat8-v1-2000, Zootopia, Zootopiav2, Zootopiav3, Zootopiav4 Textual inversion embeddings skipped(13): AIsideview, bad_prompt_version2, dm-s1, sad_atmospheric, samdoesart, samdoesarts, sideviewv2, sideviewv4-200, sideviewv4, Style-Autumn512, Style-Glorious512, Style-Psycho, Style-Winter512 Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch().

DominikDoom commented 1 year ago

Hmm, if it doesn't print about the fallback being used but doesn't work, that means the loop where it waits for all embeddings to be loaded is never exited for some reason. It worked for me when I tested it with my embeddings, but maybe I missed a combination. I'll have a look at it tomorrow.

Flonixcorn commented 1 year ago

Thanks!

DominikDoom commented 1 year ago

One more question, are you using a fork or private branch for the webui itself? I had a quick look and couldn't find the commit revision your log was referring to.

possibleimprobable commented 1 year ago

I have the same issue and my webui is cloned straight from automatic1111

DominikDoom commented 1 year ago

@Flonixcorn @And-OnceAgain I wasn't able to reproduce so far, but if my guess is right it might be related to files in the embedding folder that don't get put into either the loaded or skipped embeddings dict by the webui but get counted by my manual method. I just compare the counts to see when all embeddings have been validated/loaded by the webui, so a mismatch there would prevent it from loading. If possible, could you send me a zip of your embeddings folder or a complete file list?

possibleimprobable commented 1 year ago

Edit: If you're coming by looking for the same issue don't read what I wrote here I was impressively confused because I was describing the contents of a completely different extension than the one being discussed.

I've just done an uninstall+reinstall for the entire webui due to problems with dreambooth tearing a hole in spacetime, but just looking now and in my webui extensions tab it confirms that at least it thinks I have your extension installed. However. I just looked in the javascript folder and it's missing both "textAreas.js" and "tagAutocomplete.js". The script folder is missing "tag_autocomplete_helper.py". And if the tags folder is in the main directory folder, then that folder doesn't exist in my installation. Lastly the embeddings folder only has "Place Textual Inversion Embeddings Here.txt" and nothing else.

<3

possibleimprobable commented 1 year ago

Edit: same edit as above

I should mention my extensions folder does have the "stable-diffusion-webui-auto-tls-https" and inside it is the hidden ".git" folder, the "scripts folder", "install.py", "preload.py", and the readme. The scrips folder in there has "auto_tls.py". In case this is any help XD

DominikDoom commented 1 year ago

The two js files and the tags folder wouldn't be in the javascript/script folders of the root but in extensions/<whatever you called tag-autocomplete>/ If they aren't there either, the extension wasn't installed correctly.

Lastly the embeddings folder only has "Place Textual Inversion Embeddings Here.txt" and nothing else

If that's the case autocomplete obviously can't load any, are you sure you are talking about the same issue @Flonixcorn has?

Flonixcorn commented 1 year ago

So ive just uninstalled and reinstalled the extension, still doesnt see any embeddings and emb.txt is empty. Tho it had cached the settings ive used before somewhere?

KumiIT commented 1 year ago

same here, after the update (i do not update regularly) it stopped to appear after prompting "<".

DominikDoom commented 1 year ago

Tho it had cached the settings ive used before somewhere?

The extension uses the normal webui settings, which are stored in a config.json file in the webui root.

If the file stays empty but it doesn't output any error, I'm pretty sure it's stuck in the waiting loop like I first suspected. As I said above, would it be possible for you to send me your embeddings folder or a list of all files in it? Otherwise, I'm pretty much stuck at the moment on how to figure out why it's not loading for you. Works perfectly fine for me with both sd 2.x and 1.x embeddings.

syddharth commented 1 year ago
stopped working for me too, after the most recent extension update. :| (from #99 )
KumiIT commented 1 year ago

i check old version of auto111 and it triggered vvv in the console: tag_autocomplete_helper: Old webui version, using fallback for embedding completion. and the embeddings was working fine.

DominikDoom commented 1 year ago

Yeah that would mean it uses the fallback and just gets the files by name. But in turn it doesn't support the version differentiation between embeddings for 1.x and 2.x models.

@syddharth I didn't change anything in the embedding loading code since then except the fallback, so now I'm really confused what would cause this.

Is some error showing in the browser console for any of you?

syddharth commented 1 year ago

I have a total of 180 embeddings in the webui folder. While launching, console shows Textual inversion embeddings loaded(29), and Textual inversion embeddings skipped(151). the emb.txt file inside (extensions\a1111-sd-webui-tagcomplete\tags\temp) was empty.

KumiIT commented 1 year ago

I removed all my embeddings expect one, it works.

DominikDoom commented 1 year ago

@syddharth Are there any other files in the folder except the 180 embeddings?

@KumaDevIT if that worked it might be a "broken" embedding that is ignored by the webui but not me since I first only check for file extension

KumiIT commented 1 year ago

8 embeddings and it worked

syddharth commented 1 year ago

I think it's a broken embedding. I downloaded 50+ of embeddings today, removed them all, and the autocomplete now works with the embeddings from yesterday.

DominikDoom commented 1 year ago

I'm currently having a look if there is some way for me to tell when the webui has finished loading without comparing count, that would solve it. Otherwise, I might have to end up loading/checking the embeddings myself after all.

KumiIT commented 1 year ago

ok i did many test, and my first supposition is that it hate folders, without folders it works

DominikDoom commented 1 year ago

Folders would break it, yeah, it only expects files. But the webui itself also doesn't support subfolders for embeddings as far as I know

KumiIT commented 1 year ago

well ye but i wasn't aware, after 2.x come out i thought having models separate in their folder was somehow samish with embeddings, and didn't pay attention on loadings, hope was that the problem.

Flonixcorn commented 1 year ago

How can i find the "bad" embeddings awnd remove them?

DominikDoom commented 1 year ago

well ye but i wasn't aware, after 2.x come out i thought having models separate in their folder was somehow samish with embeddings, and didn't pay attention on loadings, hope was that the problem.

Just checked, that would result in a number mismatch as suspected since I mistakenly did scan for embeddings in subfolders but the webui doesn't load those. @syddharth do you also have subfolders which could cause this?

How can i find the "bad" embeddings awnd remove them?

I can't expect every user to do that, I rather need to find a workaround for the issue

Flonixcorn commented 1 year ago

Yea, so for me its gotta be bad embeddings, it loads 105 embeds and my embeds folder has 107 files! so 1 bad embed and the txt. You could check that somehow check how many loaded and how many files there are

DominikDoom commented 1 year ago

Yea, so for me its gotta be bad embeddings, it loads 105 embeds and my embeds folder has 107 files! so 1 bad embed and the txt. You could check that somehow check how many loaded and how many files there are

Aside from the txt file which I ignore already, is there a 0kb file? I know the webui skips those and I currently don't.

syddharth commented 1 year ago

Do not have subfolders, I am manually trying to find the broken one. Also I think the webui terminal skips embeddings according to the model loaded, it's skipping v2 embeddings when I use the 1.5 model and vice-versa.

DominikDoom commented 1 year ago

Yeah, that I already take into account of course. Infact it's how I differentiate between v1 and v2, by checking both the loaded and skipped ones. Problems are rather files that I think are valid (due to having a matching file extension), but not being loaded by the webui in either list, e.g. because they have a file size of 0.

Flonixcorn commented 1 year ago

Okay, so i removed most of my embeds and now it works, even though it sometimes doesnt show the dropdown, so i go < then it doesnt shot then < again and backspace and it takes a blink to show the dropdown

Flonixcorn commented 1 year ago

So i dont have any 0kb embeds and i cant seem to find the broken one, tho there has to be one

DominikDoom commented 1 year ago

even though it sometimes doesnt show the dropdown, so i go < then it doesnt shot then < again and backspace and it takes a blink to show the dropdown

That's a known issue I haven't gotten to fix yet since it's a bit tricky. The completion tries to detect changes in the prompt by comparing it with what was typed previously, it sometimes doesn't register a change if you type the same letter (in this case <) again right after deleting it.

Flonixcorn commented 1 year ago

well the wildcards work perfectly for me

Flonixcorn commented 1 year ago

Screenshot 2023-01-03 162600 Thats weird!, just "embedding" lol

Flonixcorn commented 1 year ago

Screenshot 2023-01-03 163005 Hm, even changed the name

DominikDoom commented 1 year ago

Huh, seems something got cut off there for some reason, which is why the name comparison to the loaded list fails. Just "Embedding" is the fallback for that. What is the candypunk file actually called in the folder? Also CandyPunk-90?

DominikDoom commented 1 year ago

AUTOMATIC has moved the model loaded callback after embedding load when I asked about a cleaner method, so it should now only write and load actually functioning embeddings and doesn't rely on waiting/trial and error anymore to guess if they're finished loading. See https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/8f96f9289981a66741ba770d14f3d27ce335a0fb

So this hopefully resolves the issue for you all if you update the webui and extension to the most recent version. Feel free to reopen if something still doesn't work out.

Flonixcorn commented 1 year ago

CandyPunk.png

its just called this

Flonixcorn commented 1 year ago

and its not a png based error as all other png embeds load fine and some .pt also just get called embeds

Huh, seems something got cut off there for some reason, which is why the name comparison to the loaded list fails. Just "Embedding" is the fallback for that. What is the candypunk file actually called in the folder? Also CandyPunk-90?