diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-01 22:31:01 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-01 22:31:01 +0000 |
commit | 6970696789a2edad2f7470c462b73cf86aead166 (patch) | |
tree | f5dac8869a40daa9b270ae9a0f7a4407b57d5a24 /webui.py | |
parent | d5dfbc45a6056fa066e0b5b57f6c1d6a4c7a87b1 (diff) | |
download | stable-diffusion-webui-gfx803-6970696789a2edad2f7470c462b73cf86aead166.tar.gz stable-diffusion-webui-gfx803-6970696789a2edad2f7470c462b73cf86aead166.tar.bz2 stable-diffusion-webui-gfx803-6970696789a2edad2f7470c462b73cf86aead166.zip |
fix for torch 1.12.1 loading saved file from torch 1.11
Diffstat (limited to 'webui.py')
-rw-r--r-- | webui.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -730,6 +730,8 @@ class StableDiffusionModelHijack: data = torch.load(path)
param_dict = data['string_to_param']
+ if hasattr(param_dict, '_parameters'):
+ param_dict = getattr(param_dict, '_parameters') # fix for torch 1.12.1 loading saved file from torch 1.11
assert len(param_dict) == 1, 'embedding file has multiple terms in it'
emb = next(iter(param_dict.items()))[1].reshape(768)
self.word_embeddings[name] = emb
|