AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
141.37k stars 26.72k forks source link

[Bug]: Extra networks not reading all embeds - EDIT: Textual inversion embeddings skipped loading for unknown reason #7206

Open Mousewrites opened 1 year ago

Mousewrites commented 1 year ago

Is there an existing issue for this?

What happened?

After the latest pull, the extra networks option no longer shows all installed embeds, even though they are all still working.

image

Note that the first embed it shows is Action Helper, where there's 3 before that, for instance.

It doesn't read the folders, but that's something that broke a few versions back, so I don't even care as much about those.

Steps to reproduce the problem

Open extra networks. See 'installed' embeds.

What should have happened?

Open extra networks. See actually 'installed' embeds.

Commit where the problem happens

Commit hash: 3cead6983e2618838696bbf9f0b9dbbbbdd07e30

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--xformers --api --no-half-vae

Additional information, context and logs

No response

mezotaken commented 1 year ago

What's the file extension for those which are not being loaded? Could you drop any of them on gdrive and link here?

Mousewrites commented 1 year ago

Same as the ones being loaded, pt files. Non-loading are a mix of some I've made, and some I've downloaded from civitai and HF. Loading ones are the same; some I made, some I downloaded. Not sure what the difference is

https://drive.google.com/drive/u/1/folders/17Ec4nJ8ywzBE1GyPH1Hy7LOeNZtOcBv1

mezotaken commented 1 year ago

image That's weird. Thumbs work too. image I have no idea how to reproduce it :/

Mousewrites commented 1 year ago

How bizarre! ok, if it's a just me thing, I'll do some cleanup, see if I can fix it, thanks for testing that out!

mezotaken commented 1 year ago

Check out with just a single "not loading" file. Feels like search feature just hiding them. But i don't get how could it happen.

mezotaken commented 1 year ago

Yep. You have a space in your search bar, i think. Nope, not it.

Mousewrites commented 1 year ago

No space in my search bar, just checked. However, I just noticed this in my command window image

So, it's skipping all those files, but I can't tell why. Tried opening a 2.1 checkpoint and relaunching, just to be sure (since that's what the 'Textual inversion embeddings skipped" message usually means, but getting the same thing. Going to pull all my embeds out, test with just a few as you suggested, but something Else is going on.

mezotaken commented 1 year ago

Wow. I just put all that were loading for you and they are not loading for me image

Mousewrites commented 1 year ago

Well that's something. I must have something installed/flipped from what yours is

Mousewrites commented 1 year ago

Just pulled all my extensions out, same issue, so it's not an extension.

mezotaken commented 1 year ago

image Those you can't can load are for sd 2.1. So it works fine. Obviously i can't load them because i load usual 1.5 with size of text embedding 768.

Now why it won't load for you with 2.1 - that's another question.

Mousewrites commented 1 year ago

Yes, but when I switch to sd 2.1 it doesn't load them

mezotaken commented 1 year ago

Sorry, i confused them. image So it looks like you switched from 2.1 model to 2.1 model. While those you can't load are actually for 1.4-1.5

mykeehu commented 1 year ago

After you switch to 2.1 or back, you can reload it by clicking the Refresh button.

mezotaken commented 1 year ago

So, do you have a definite 1.4 or 1.5 based model? Load it, refresh embeddings list and i'm sure all of those "not loaded" embeds will show up...

Mousewrites commented 1 year ago

It does not. I can load a 2.1 or 2.0 model, hit refresh, and it does not load those.

mezotaken commented 1 year ago

1.4 or 1.5 based model? Load it,

I can load a 2.1 or 2.0 model,

Those embeds are for 1.x models. image

Mousewrites commented 1 year ago

I understand what you are saying, but it's not loading the embeds for the correct version. If i'm in 1.5 pruned it gives me the same set as when I am in 2.1.

EDIT: it looks like there's something going on when I swap. After swapping back and forth from 2.1 to 1.5 a few times, it finally loaded the other embeds. So I guess it's doing the correct thing, and this is a symptom of some other issue I have going on.

Thank you for all your help.

mezotaken commented 1 year ago

So. For a fresh load of 1.5 it somehow has the expected size 1024 for embeddings, if i understand it correctly. https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/6cff4401824299a983c8e13424018efc347b4a2b/modules/textual_inversion/textual_inversion.py#L225-L226 Could you add following to the line 226 here? Just to make sure. I think it is connected to much more broad problem of disabled initialization of models. print(self.expected_shape)

The problem is: to get expected shape it straight up asks for a text embedding of a prompt ",". So if 1.5 is loaded, it should be 768 size. https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/6cff4401824299a983c8e13424018efc347b4a2b/modules/textual_inversion/textual_inversion.py#L135-L137

gitaiuser20 commented 1 year ago

i have the same issue, but for me when i switched to 2.1 then i got the missing embeddings but only those, i can't seem able to have all together at the same time