aboutsummaryrefslogtreecommitdiffstats
path: root/modules/modelloader.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-18 07:12:17 +0000
committerGitHub <noreply@github.com>2023-05-18 07:12:17 +0000
commit182330ae40c93b761fced8d03bbdd8523f1739d0 (patch)
treec95f2e531cc34475eb39266add6d12a2a5e1e2b3 /modules/modelloader.py
parent0d31f20cbd556ea4ba3d8ad9254bcce71c32088c (diff)
parent983f2c494ad8fed2f08193681ba0bf5dda01555a (diff)
downloadstable-diffusion-webui-gfx803-182330ae40c93b761fced8d03bbdd8523f1739d0.tar.gz
stable-diffusion-webui-gfx803-182330ae40c93b761fced8d03bbdd8523f1739d0.tar.bz2
stable-diffusion-webui-gfx803-182330ae40c93b761fced8d03bbdd8523f1739d0.zip
Merge branch 'dev' into ngrok-py
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r--modules/modelloader.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/modelloader.py b/modules/modelloader.py
index a70aa0e3..2a479bcb 100644
--- a/modules/modelloader.py
+++ b/modules/modelloader.py
@@ -1,4 +1,3 @@
-import glob
import os
import shutil
import importlib
@@ -40,7 +39,7 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None
if os.path.islink(full_path) and not os.path.exists(full_path):
print(f"Skipping broken symlink: {full_path}")
continue
- if ext_blacklist is not None and any([full_path.endswith(x) for x in ext_blacklist]):
+ if ext_blacklist is not None and any(full_path.endswith(x) for x in ext_blacklist):
continue
if full_path not in output:
output.append(full_path)
@@ -108,12 +107,12 @@ def move_files(src_path: str, dest_path: str, ext_filter: str = None):
print(f"Moving {file} from {src_path} to {dest_path}.")
try:
shutil.move(fullpath, dest_path)
- except:
+ except Exception:
pass
if len(os.listdir(src_path)) == 0:
print(f"Removing empty folder: {src_path}")
shutil.rmtree(src_path, True)
- except:
+ except Exception:
pass
@@ -127,7 +126,7 @@ def load_upscalers():
full_model = f"modules.{model_name}_model"
try:
importlib.import_module(full_model)
- except:
+ except Exception:
pass
datas = []