diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-18 07:26:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-18 07:26:35 +0000 |
commit | 97e1cf69c04a3c62aa1bb19a14ffc948d9cc6c4e (patch) | |
tree | 7a24bdd31580fe0e4bf8d4205b57b55df0a2568d /modules/modelloader.py | |
parent | 484948f5c0b755a921c02cccbcacb2684a86a814 (diff) | |
parent | bb431df52bf3dc5e233e42907f2d8f56e4fb6c0c (diff) | |
download | stable-diffusion-webui-gfx803-97e1cf69c04a3c62aa1bb19a14ffc948d9cc6c4e.tar.gz stable-diffusion-webui-gfx803-97e1cf69c04a3c62aa1bb19a14ffc948d9cc6c4e.tar.bz2 stable-diffusion-webui-gfx803-97e1cf69c04a3c62aa1bb19a14ffc948d9cc6c4e.zip |
Merge branch 'dev' into master
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r-- | modules/modelloader.py | 9 |
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 = [] |