stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: Unable to load embeddings built in "Create Embeddings"
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
Error verifying pickled file from /Users/kyods/stable-diffusion-webui/embeddings/amyross.pt: Traceback (most recent call last): File "/Users/kyods/stable-diffusion-webui/modules/safe.py", line 135, in load_with_extra check_pt(filename, extra_handler) File "/Users/kyods/stable-diffusion-webui/modules/safe.py", line 93, in check_pt unpickler.load() File "/Users/kyods/stable-diffusion-webui/modules/safe.py", line 62, in find_class raise Exception(f"global '{module}/{name}' is forbidden") Exception: global 'torch._utils/_rebuild_device_tensor_from_numpy' is forbidden
The file may be malicious, so the program is not going to read it. You can skip this check with --disable-safe-unpickle commandline argument.
Error loading emedding amyross.pt: Traceback (most recent call last): File "/Users/kyods/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 134, in load_textual_inversion_embeddings process_file(fullfn, fn) File "/Users/kyods/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 104, in process_file if 'string_to_param' in data: TypeError: argument of type 'NoneType' is not iterable
Steps to reproduce the problem
- Go to the Train tab
- Press the "Embedding" dropdown
- Nothing happens.
What should have happened?
The embedding should be visible.
Commit where the problem happens
685f9631b56ff8bd43bce24ff5ce0f9a0e9af490
What platforms do you use to access UI ?
MacOS
What browsers do you use to access the UI ?
Apple Safari
Command Line Arguments
No response
Additional information, context and logs
No response
Same problem. Waiting for fix.
Same here
Do any of you want to test the patch I created here? My testing isn't done, but I can select my embedding and process now.
@BrentWilkins, I replaced safe.py
with your edited version in #5759, restarted the webui, and it did not make a difference for me. Did I miss a step?
I cannot reproduce the problem. Can it be some extension writing weird stuff to created embeddings?
I have just tested it again in both Safari and Firefox, private mode, with all the browser and SD extensions disabled (since I wasn't sure which ones you were referring to). I can create and select a hypernetwork (the training process itself fails to start, though, the same issue as in https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5684), but my custom embedding is still not visible in the drop-down list.
@BrentWilkins, I replaced
safe.py
with your edited version in #5759, restarted the webui, and it did not make a difference for me. Did I miss a step?
My validation failed after a day or two of running. I added another commit 4 days ago that has it all working on my system. I'm able to do textual inversions, have the progress saved to a PyTorch, and then use those to generate images. I'd try again if you don't have it working.
I cannot reproduce the problem. Can it be some extension writing weird stuff to created embeddings?
I initially wondered the same thing, so I tried another browser with no luck. safe.py
was trashing torch stuff that it needs to run.
I have just tested it again in both Safari and Firefox, private mode, with all the browser and SD extensions disabled (since I wasn't sure which ones you were referring to). I can create and select a hypernetwork (the training process itself fails to start, though, the same issue as in #5684), but my custom embedding is still not visible in the drop-down list.
Don't worry about web browser extensions, it is the web UI extensions (such as Dreambooth) that can be problematic. Also, disabling the web UI extensions is not enough - you will have to remove them from the extensions folder.
Fresh installation of Brave browser, all the built-in (don't use any other) web UI extensions removed from their folder, no improvement.
Do you have the latest web UI commits? If you haven't already git pull
to make sure you are up to date. If you are still getting an error, post the output here as it should differ slightly from what you had before.
Confirmed working with the latest commits. Thanks for the help!
Seems I'm still having the same issue even with the latest version.
Error loading embedding mwte.pt:
Traceback (most recent call last):
File "/Users/kelvinzhao/Documents/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 206, in load_from_dir
self.load_from_file(fullfn, fn)
File "/Users/kelvinzhao/Documents/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 164, in load_from_file
if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable
Seems I'm still having the same issue even with the latest version.
Error loading embedding mwte.pt: Traceback (most recent call last): File "/Users/kelvinzhao/Documents/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 206, in load_from_dir self.load_from_file(fullfn, fn) File "/Users/kelvinzhao/Documents/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 164, in load_from_file if 'string_to_param' in data: TypeError: argument of type 'NoneType' is not iterable
I don't remember how I got it to work exactly, but have you tried reinstalling stable-diffusion-webui from scratch? I think that's worth a shot.
I wouldn't recommend copying any changes manually without verifying you are applying them to the correct version. I pulled commit 3715ece0adce7bf7c5e9c5ab3710b2fdc3848f39 from the master branch last week or so and it works fine for me. I had played around with versions of PyTorch, and I got an error about the version with the latest code. I updated to these versions:
$ venv/bin/python -m pip freeze | grep torch
open-clip-torch @ git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
pytorch-lightning==1.7.6
torch==1.13.1
torchdiffeq==0.2.3
torchmetrics==0.11.1
torchsde==0.2.5
torchvision==0.14.1
I used something like this:
$ venv/bin/python -m pip install -U torch