diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-14 10:31:03 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-14 10:31:03 +0000 |
commit | b9abdb50a3684e2f7392bf68736ad1ec025045af (patch) | |
tree | b9e3ecb3983fb8727ae92672f7a52fba94a568e9 | |
parent | d7e9ac2aff6bfd3c03f9d50a98e31468fd34a77f (diff) | |
download | stable-diffusion-webui-gfx803-b9abdb50a3684e2f7392bf68736ad1ec025045af.tar.gz stable-diffusion-webui-gfx803-b9abdb50a3684e2f7392bf68736ad1ec025045af.tar.bz2 stable-diffusion-webui-gfx803-b9abdb50a3684e2f7392bf68736ad1ec025045af.zip |
add a possible fix for 'LatentDiffusion' object has no attribute 'lora_layer_mapping'
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | extensions-builtin/Lora/lora.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a7bf4c2f..881870bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * allow bf16 in safe unpickler (resolves problems with loading some loras)
* allow web UI to be ran fully offline
* fix localizations not working
+ * fix error for loras: 'LatentDiffusion' object has no attribute 'lora_layer_mapping'
## 1.2.0
diff --git a/extensions-builtin/Lora/lora.py b/extensions-builtin/Lora/lora.py index 6fa80006..b5d0c98f 100644 --- a/extensions-builtin/Lora/lora.py +++ b/extensions-builtin/Lora/lora.py @@ -133,6 +133,10 @@ def load_lora(name, filename): sd = sd_models.read_state_dict(filename)
+ # this should not be needed but is here as an emergency fix for an unknown error people are experiencing in 1.2.0
+ if not hasattr(shared.sd_model, 'lora_layer_mapping'):
+ assign_lora_names_to_compvis_modules(shared.sd_model)
+
keys_failed_to_match = {}
is_sd2 = 'model_transformer_resblocks' in shared.sd_model.lora_layer_mapping
|