lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
7.73k stars 741 forks source link

Textual inversion embeddings don't work anymore. Is the plan to deprecate them, or are they work-in-progress? #1835

Closed cmdr2 closed 2 weeks ago

cmdr2 commented 2 weeks ago

Hi,

Apologies if I missed anything. I noticed that the codepaths for loading embeddings was commented out in the "Free WebUI from its Prison" commit - https://github.com/lllyasviel/stable-diffusion-webui-forge/commit/bccf9fb23a2cbc9d42091a856b3d35b2c4414d51

This results in the user being unable to use embeddings, even for SD 1 and 2 models.

If I had to guess, it's probably because the embedding code relied on the older (ldm?) implementation (that was removed as a part of the recent changes).

I'm curious if the plan is to deprecate embeddings entirely, or is it just something that needs to be reworked?

Any hints for how we could make embeddings work again, with the new codebase? Happy to take a look if I can contribute code for it.

Thanks ~cmdr2

SvenErik1968 commented 2 weeks ago

As far as I know, embeddings do work, but you have to use SDXL embeddings with SDXL checkpoints, and SD 1.5 embeddings with SD 1.5 checkpoints. SD 1.5 embeddings do not work with SDXL checkpoints and vice versa...

Here I did a quick image using an SDXL checkpoint (babesBYSTABLEYOGI_xlV2) together with SDXL/Pony positive (Stable_Yogis_PDXL_Positives) and negative (Stable_Yogis_PDXL_Negatives-neg) embedding, and here you can see that it loaded and used the embeddings: SDXL_SDXL

Same image, seed and SDXL checkpoint (babesBYSTABLEYOGI_xlV2) together with SD 1.5 positive (epiCRealism) and negative (epiCNegative) embedding, and it did not load the embeddings: SDXL_SD1 5

cmdr2 commented 2 weeks ago

Thanks @SvenErik1968 . Which commit id of Forge are you using? It would be printed when Forge starts up. E.g.

Python 3.10.6
Version: f2.0.1v1.10.1-previous-529-g4236fbfb
Commit hash: 210af4f80406f78a67e1c35a64a6febdf1200a82

I'm using the latest commit from 2 days ago.

SvenErik1968 commented 2 weeks ago

I am using the latest version, I have git pull as the first line in my webui-user.bat file ;-)

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f2.0.1v1.10.1-previous-531-g210af4f8
Commit hash: 210af4f80406f78a67e1c35a64a6febdf1200a82
cmdr2 commented 2 weeks ago

Thanks, I'm an idiot. :)

I'd put the embeddings in a webui/models/embeddings folder, instead of the special webui/embeddings folder.

The embeddings folder location feels a bit inconsistent (compared to lora and other models), but maybe it's a legacy artifact from the early days of webui. Anyway, it works now, thanks for your help @SvenErik1968 and sorry for the false alarm!