[Bug]: Stable diffusion model failed to load, exiting
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
it was working fine few hours ago but now it wont lunch

Steps to reproduce the problem
- Go to ....
- Press ....
- ...
What should have happened?
it should lunch
Commit where the problem happens
You are running torch 1.13.1+cu117. The program is tested to work with torch 2.0.0. To reinstall the desired version, run with commandline flag --reinstall-torch. Beware that this will cause a lot of large files to be downloaded, as well as there are reports of issues with training tab on the latest version. Use --skip-version-check commandline argument to disable this check. ============================================================================== [AddNet] Updating model hashes... 0it [00:00, ?it/s] [AddNet] Updating model hashes... 0it [00:00, ?it/s] ControlNet v1.1.125 ControlNet v1.1.125 [text2prompt] Following databases are available: all-mpnet-base-v2 : danbooru_strict Loading weights [0fc198c490] from C:\Users\PCMasterRace\stable-diffusion-webui\models\Stable-diffusion\AbyssOrangeMix2_hard.safetensors Creating model from config: C:\Users\PCMasterRace\stable-diffusion-webui\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Loading VAE weights specified in settings: C:\Users\PCMasterRace\stable-diffusion-webui\models\VAE\orangemix.vae.pt Error verifying pickled file from C:\Users\PCMasterRace\stable-diffusion-webui\models\VAE\orangemix.vae.pt: Traceback (most recent call last): File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra check_pt(filename, extra_handler) File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 90, in check_pt unpickler.load() File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load return TypedStorage(_internal=True) TypeError: TypedStorage.new() got an unexpected keyword argument '_internal' 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. loading stable diffusion model: AttributeError Traceback (most recent call last): File "C:\Users\PCMasterRace\stable-diffusion-webui\webui.py", line 195, in initialize modules.sd_models.load_model() File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 453, in load_model load_model_weights(sd_model, checkpoint_info, state_dict, timer) File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 338, in load_model_weights sd_vae.load_vae(model, vae_file, vae_source) File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_vae.py", line 145, in load_vae vae_dict_1 = load_vae_dict(vae_file, map_location=shared.weight_load_location) File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_vae.py", line 123, in load_vae_dict vae_ckpt = sd_models.read_state_dict(filename, map_location=map_location) File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 257, in read_state_dict sd = get_state_dict_from_checkpoint(pl_sd) File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 206, in get_state_dict_from_checkpoint pl_sd = pl_sd.pop("state_dict", pl_sd) AttributeError: 'NoneType' object has no attribute 'pop' Stable diffusion model failed to load, exiting Press any key to continue . . .
What platforms do you use to access the UI ?
Windows
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
You are running torch 1.13.1+cu117.
The program is tested to work with torch 2.0.0.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.
Use --skip-version-check commandline argument to disable this check.
==============================================================================
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
ControlNet v1.1.125
ControlNet v1.1.125
[text2prompt] Following databases are available:
all-mpnet-base-v2 : danbooru_strict
Loading weights [0fc198c490] from C:\Users\PCMasterRace\stable-diffusion-webui\models\Stable-diffusion\AbyssOrangeMix2_hard.safetensors
Creating model from config: C:\Users\PCMasterRace\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: C:\Users\PCMasterRace\stable-diffusion-webui\models\VAE\orangemix.vae.pt
Error verifying pickled file from C:\Users\PCMasterRace\stable-diffusion-webui\models\VAE\orangemix.vae.pt:
Traceback (most recent call last):
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
check_pt(filename, extra_handler)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
unpickler.load()
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'
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.
loading stable diffusion model: AttributeError
Traceback (most recent call last):
File "C:\Users\PCMasterRace\stable-diffusion-webui\webui.py", line 195, in initialize
modules.sd_models.load_model()
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 453, in load_model
load_model_weights(sd_model, checkpoint_info, state_dict, timer)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 338, in load_model_weights
sd_vae.load_vae(model, vae_file, vae_source)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_vae.py", line 145, in load_vae
vae_dict_1 = load_vae_dict(vae_file, map_location=shared.weight_load_location)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_vae.py", line 123, in load_vae_dict
vae_ckpt = sd_models.read_state_dict(filename, map_location=map_location)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 257, in read_state_dict
sd = get_state_dict_from_checkpoint(pl_sd)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 206, in get_state_dict_from_checkpoint
pl_sd = pl_sd.pop("state_dict", pl_sd)
AttributeError: 'NoneType' object has no attribute 'pop'
Stable diffusion model failed to load, exiting
Press any key to continue . . .
List of extensions
controlnet
Console logs
You are running torch 1.13.1+cu117.
The program is tested to work with torch 2.0.0.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.
Use --skip-version-check commandline argument to disable this check.
==============================================================================
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
ControlNet v1.1.125
ControlNet v1.1.125
[text2prompt] Following databases are available:
all-mpnet-base-v2 : danbooru_strict
Loading weights [0fc198c490] from C:\Users\PCMasterRace\stable-diffusion-webui\models\Stable-diffusion\AbyssOrangeMix2_hard.safetensors
Creating model from config: C:\Users\PCMasterRace\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: C:\Users\PCMasterRace\stable-diffusion-webui\models\VAE\orangemix.vae.pt
Error verifying pickled file from C:\Users\PCMasterRace\stable-diffusion-webui\models\VAE\orangemix.vae.pt:
Traceback (most recent call last):
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
check_pt(filename, extra_handler)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
unpickler.load()
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'
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.
loading stable diffusion model: AttributeError
Traceback (most recent call last):
File "C:\Users\PCMasterRace\stable-diffusion-webui\webui.py", line 195, in initialize
modules.sd_models.load_model()
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 453, in load_model
load_model_weights(sd_model, checkpoint_info, state_dict, timer)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 338, in load_model_weights
sd_vae.load_vae(model, vae_file, vae_source)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_vae.py", line 145, in load_vae
vae_dict_1 = load_vae_dict(vae_file, map_location=shared.weight_load_location)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_vae.py", line 123, in load_vae_dict
vae_ckpt = sd_models.read_state_dict(filename, map_location=map_location)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 257, in read_state_dict
sd = get_state_dict_from_checkpoint(pl_sd)
File "C:\Users\PCMasterRace\stable-diffusion-webui\modules\sd_models.py", line 206, in get_state_dict_from_checkpoint
pl_sd = pl_sd.pop("state_dict", pl_sd)
AttributeError: 'NoneType' object has no attribute 'pop'
Stable diffusion model failed to load, exiting
Press any key to continue . . .
Additional information
No response
Would just like to add to this, I have almost the same issue. SD loads for me but doesn't do anything, when I try to generate anything I get this:
TypeError: Expected state_dict to be dict-like, got <class 'NoneType'>
None of my textual inversions load except for easynegative. The rest are declared as malicious:
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.
Would love to know how to fix this, it was all working fine an hour ago.
Edit: FIXED. See below (just reinstalled torch).
I noticed that the log I get complains about an old version of torch, and an old version of xformers.
I can generate images, but there's no progress bar. Plus, it's not loading my textual inversions. Controlnet openpose errors as well.
same, is it update problems and it will be fixed in next update or i have to repair it at my own?
I deleted the \venv\ folder and I'm redownloading, I'll comment back if that fixes it.
Reinstalling torch did the trick for me. Edit web-ui user with:
set COMMANDLINE_ARGS="--reinstall-torch"
and let it do it's anything. Restart and everything seems back to normal for the time being.
Same problem, I'm new to it and don't really know what happened. I wanted to install A1111 and it installed itself today (or I did it myself when visiting A1111 page on github?) then I installed controlnet and have the same error. Should I uninstall anything (and how to do it?)
Also, do someone know where are face models stored? The ones that the program uses when clicking "restore faces". I had my favourite one and don't wanna lose it when uninstalling :(
Venv has finished re-downloading, I don't see any errors, and it's working again. Seems faster than before, actually!
Details from the System Info extension:
Torch: 2.0.0+cu118 autocast half
Libs: xformers: 0.0.17 accelerate: 0.18.0 transformers: 4.25.1
So re-downloading torch works, or just delete the whole venv folder and let it re-download if you're patient.
(edit: "down" to "finished" in first sentence.)
Same problem, I'm new to it and don't really know what happened. I wanted to install A1111 and it installed itself today (or I did it myself when visiting A1111 page on github?) then I installed controlnet and have the same error. Should I uninstall anything (and how to do it?)
Also, do someone know where are face models stored? The ones that the program uses when clicking "restore faces". I had my favourite one and don't wanna lose it when uninstalling :(
Check out Easy WebUI installer. It should download the face GANs etc. automatically. Other normal checkpoint / safetensor files go in the folder stable-diffusion-webui\models\Stable-diffusion.
Also, do someone know where are face models stored? The ones that the program uses when clicking "restore faces". I had my favourite one and don't wanna lose it when uninstalling :(
Check out Easy WebUI installer. It should download the face GANs etc. automatically. Other normal checkpoint / safetensor files go in the folder stable-diffusion-webui\models\Stable-diffusion.
I meant the face itself, sorry for not being clear. The model I used to generate it was realisticvision v1.3 Is it stored somewhere or how does it work that the program reuses the same person face etc when I click "restore face"? Or it takes the face from the last picture that saved there stable-diffusion-webui\outputs\txt2img-images with date folders?
Btw, I reinstalled the torch and the program works normally. Thanks!
I resolved the same problem this afternoon adding --disable-safe-unpickle in webui-user.bat
YES! Everything is back to working based off the comments above.
Check out Easy WebUI installer. It should download the face GANs etc. automatically. Other normal checkpoint / safetensor files go in the folder stable-diffusion-webui\models\Stable-diffusion.
I meant the face itself, sorry for not being clear. The model I used to generate it was realisticvision v1.3 Is it stored somewhere or how does it work that the program reuses the same person face etc when I click "restore face"? Or it takes the face from the last picture that saved there stable-diffusion-webui\outputs\txt2img-images with date folders?
(Sorry for the OT posts...) Restore faces uses a special model (https://github.com/TencentARC/GFPGAN) to try and detect faces in your image, and then improve them. It's actually not as necessary as it used to be, since most of the modern checkpoints generate pretty good faces now. But it usually doesn't hurt.
Like I said, WebUI Easy Installer will install everything needed automatically for you. And the required models should download automatically the first time you try and use "face restoration" even in regular WebUI. https://github.com/EmpireMediaScience/A1111-Web-UI-Installer
The model should end up being stored in \models\GFPGAN, three files: detection_Resnet50_Final.pth, GFPGANv1.4.pth, parsing_parsenet.pth, and that's it.
--disable-safe-unpickle
Yes same here work but error message for pix2pix : ValueError: too many values to unpack (expected 14)
--disable-safe-unpickle
Yes same here work but error message for pix2pix : ValueError: too many values to unpack (expected 14)
as far as I know (and I know little), pix2pix tab is a deprecated extension, beeing included somewhere in UI, try to disable that extension (and take my words with caution... I am a noob).
--disable-safe-unpickle
Yes same here work but error message for pix2pix : ValueError: too many values to unpack (expected 14)
as far as I know (and I know little), pix2pix tab is a deprecated extension, beeing included somewhere in UI, try to disable that extension (and take my words with caution... I am a noob).
Ok i don't use it so much so i can remove it thanks !
Venv has down re-downloading, I don't see any errors, and it's working again. Seems faster than before, actually!
Details from the System Info extension:
Torch: 2.0.0+cu118 autocast half
Libs: xformers: 0.0.17 accelerate: 0.18.0 transformers: 4.25.1
So re-downloading torch works, or just delete the whole venv folder and let it re-download if you're patient.
So i did a git pull tonight and it broke it for me aswell, with argument --disable-safe-unpickle it works. And since i have all my models in .safetensor format, the only problem it has its with embeddings and VAE's which it doesnt recognise/see because they are .pt or .ckpt because of the "Error verifying pickled file" error.
I deleted venv folder, redownloaded it and still same problem. I installed torch 2.0.0 +cu118 manually but when i open webui-user.bat it still says torch 1.13.1+cu117 tho i think this isnt the issue at hand (i remember trying to fix this but gave up on upgrading torch version)
Removing those .pt and .ckpt files from VAE and embedding fixes stuff. Any ideas?
I'm not sure what's going on here since everybody got those "potentially unsafe file" warnings, but re-downloading the \venv\ folder fixed it for me and others. That first warning could be a false positive, but if you're getting "potentially unsafe file" warnings on just some of your models even afterwards, they might have a pickle and be unsafe, in which case I'd try running without them. Are you still getting that with just official Stable Diffusion models like 2.1 (768)?
Most likely is a false positive because they are the only ones who are not .safetensors and the only things that i dont have with .safetensors are some VAE's and some Textual Embeddings like negatives, bad-artist, etc I have extension to change .ckpt models to .safetensors but im not aware of ways to change VAE's and Embeddings to .safetensors. Might be a good thing for the future aswell.
I had a glance at that log and it's complaining about your Torch version. Deleting \venv\ may be overkill but it will fix that problem :)
deleted venv and ran sd like normal, took longer than just reinstalling torch but it did the job
For AMD GPU reverted to previous version.
This should also be resolved by https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/5ab7f213bec2f816f9c5644becb32eb72c8ffb89
You should now be able to resolve the issue by either upgrading torch via --reinstall-torch or upgrading to https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/5ab7f213bec2f816f9c5644becb32eb72c8ffb89
The change was pushed to master, so you can just update as normal (e.g. git pull --ff-only)
This should also be resolved by 5ab7f21
You should now be able to resolve the issue by either upgrading torch via
--reinstall-torchor upgrading to 5ab7f21 The change was pushed to master, so you can just update as normal (e.g.git pull --ff-only)
I see there is a comment with "switch to torch 2.0.0 (except for AMD GPUs)". Last night i had this problem with torch and got 2.0.0...Should i reinstall the older version now? It doesnt seem to like the new 2.0.0 on my AMD GPU because the resolution i used to do before doesnt even compare to the errors i get now and i tried a lot of commands in webui-user.bat
FIXED on AMD GPU by uninstalling 2.0.0 and reinstalling older version.
I'm using 5ab7f21, tried reinstalling torch 2.0.0, also tried deleting the venv folder and reinstall... Still have the problem. I'm running on NV GPU. Brain hurts...
I'm using 5ab7f21, tried reinstalling torch 2.0.0, also tried deleting the venv folder and reinstall... Still have the problem. I'm running on NV GPU. Brain hurts...
same error
Duplicate of https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9986