diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-06-09 19:31:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-09 19:31:49 +0000 |
commit | b8d7506ebe8c27119b5cc105f9d518b35028a0f3 (patch) | |
tree | 632ca2fa3621eda23a5b0e1d078c4cbe669e7d55 | |
parent | f9606b8826cb3e0467312c317c4a7b504e2bb6a2 (diff) | |
parent | d75ed52bfc07746c28ecd3bc35d76c2a6e1ce6ea (diff) | |
download | stable-diffusion-webui-gfx803-b8d7506ebe8c27119b5cc105f9d518b35028a0f3.tar.gz stable-diffusion-webui-gfx803-b8d7506ebe8c27119b5cc105f9d518b35028a0f3.tar.bz2 stable-diffusion-webui-gfx803-b8d7506ebe8c27119b5cc105f9d518b35028a0f3.zip |
Merge pull request #11123 from akx/dont-die-on-bad-symlink-lora
Don't die when a LoRA is a broken symlink
-rw-r--r-- | extensions-builtin/Lora/lora.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/extensions-builtin/Lora/lora.py b/extensions-builtin/Lora/lora.py index af93991c..34ff57dd 100644 --- a/extensions-builtin/Lora/lora.py +++ b/extensions-builtin/Lora/lora.py @@ -448,7 +448,11 @@ def list_available_loras(): continue
name = os.path.splitext(os.path.basename(filename))[0]
- entry = LoraOnDisk(name, filename)
+ try:
+ entry = LoraOnDisk(name, filename)
+ except OSError: # should catch FileNotFoundError and PermissionError etc.
+ errors.report(f"Failed to load LoRA {name} from {filename}", exc_info=True)
+ continue
available_loras[name] = entry
|