mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-03-06 21:49:49 +00:00
fix an error loading Lora with empty values in metadata
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user