aboutsummaryrefslogtreecommitdiffstats
path: root/modules/modelloader.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-10 16:11:47 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-01-10 16:11:47 +0000
commit50fb20cedc8dcbf64f86aed6d6e89595d655e638 (patch)
tree236eb8959ed1f9ababd99bfbde7cc4580a641f50 /modules/modelloader.py
parenta0ef416aa769022ce9e97dcc87f88a0ae9e6cc58 (diff)
parent0f8603a55988d22616b17140e6c4a7e9d0736af5 (diff)
downloadstable-diffusion-webui-gfx803-50fb20cedc8dcbf64f86aed6d6e89595d655e638.tar.gz
stable-diffusion-webui-gfx803-50fb20cedc8dcbf64f86aed6d6e89595d655e638.tar.bz2
stable-diffusion-webui-gfx803-50fb20cedc8dcbf64f86aed6d6e89595d655e638.zip
Merge branch 'disable_initialization'
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r--modules/modelloader.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/modelloader.py b/modules/modelloader.py
index 6a1a7ac8..e9aa514e 100644
--- a/modules/modelloader.py
+++ b/modules/modelloader.py
@@ -10,7 +10,7 @@ from modules.upscaler import Upscaler
from modules.paths import script_path, models_path
-def load_models(model_path: str, model_url: str = None, command_path: str = None, ext_filter=None, download_name=None) -> list:
+def load_models(model_path: str, model_url: str = None, command_path: str = None, ext_filter=None, download_name=None, ext_blacklist=None) -> list:
"""
A one-and done loader to try finding the desired models in specified directories.
@@ -45,6 +45,8 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None
full_path = file
if os.path.isdir(full_path):
continue
+ if ext_blacklist is not None and any([full_path.endswith(x) for x in ext_blacklist]):
+ continue
if len(ext_filter) != 0:
model_name, extension = os.path.splitext(file)
if extension not in ext_filter: