aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_models.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-03-14 08:22:29 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-03-14 08:22:29 +0000
commit6a04a7f20fcc4a992ae017b06723e9ceffe17b37 (patch)
treee02d72a0341312d976ac19a8724944cecbd903d4 /modules/sd_models.py
parent8b35b64e110fc9f672f73f1cb0fc3ffc809a36c9 (diff)
downloadstable-diffusion-webui-gfx803-6a04a7f20fcc4a992ae017b06723e9ceffe17b37.tar.gz
stable-diffusion-webui-gfx803-6a04a7f20fcc4a992ae017b06723e9ceffe17b37.tar.bz2
stable-diffusion-webui-gfx803-6a04a7f20fcc4a992ae017b06723e9ceffe17b37.zip
fix an error loading Lora with empty values in metadata
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r--modules/sd_models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py
index 5f57ec0c..f0cb1240 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -225,7 +225,7 @@ def read_metadata_from_safetensors(filename):
res = {}
for k, v in json_obj.get("__metadata__", {}).items():
res[k] = v
- if isinstance(v, str) and v[0] == '{':
+ if isinstance(v, str) and v[0:1] == '{':
try:
res[k] = json.loads(v)
except Exception as e: