diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-30 08:42:40 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-30 08:42:40 +0000 |
commit | d1f098540ad1dbc2abb8d04322634efba650b631 (patch) | |
tree | 2c5cd3088177c938d643ed5430f7e2c38cdc2209 /modules/modelloader.py | |
parent | 2552204fcb04c13af93749bd125d086ba148517c (diff) | |
download | stable-diffusion-webui-gfx803-d1f098540ad1dbc2abb8d04322634efba650b631.tar.gz stable-diffusion-webui-gfx803-d1f098540ad1dbc2abb8d04322634efba650b631.tar.bz2 stable-diffusion-webui-gfx803-d1f098540ad1dbc2abb8d04322634efba650b631.zip |
remove unwanted formatting/functionality from the PR
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r-- | modules/modelloader.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/modelloader.py b/modules/modelloader.py index b3e6dc36..1106aeb7 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -25,8 +25,10 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None if ext_filter is None: ext_filter = [] + try: places = [] + if command_path is not None and command_path != model_path: pretrained_path = os.path.join(command_path, 'experiments/pretrained_models') if os.path.exists(pretrained_path): @@ -34,7 +36,9 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None places.append(pretrained_path) elif os.path.exists(command_path): places.append(command_path) + places.append(model_path) + for place in places: if os.path.exists(place): for file in os.listdir(place): @@ -47,14 +51,17 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None continue if file not in output: output.append(full_path) + if model_url is not None and len(output) == 0: if download_name is not None: dl = load_file_from_url(model_url, model_path, True, download_name) output.append(dl) else: output.append(model_url) - except: + + except Exception: pass + return output |