diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-10 13:51:04 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-10 13:51:04 +0000 |
commit | ce3f639ec8758ce2bc90483336361d2dc25acd3a (patch) | |
tree | 5f19d3e92ba8f22fbe6840311c1d7bdc45372e93 /modules/modelloader.py | |
parent | 0c3feb202c5714abd50d879c1db2cd9a71ce93e3 (diff) | |
download | stable-diffusion-webui-gfx803-ce3f639ec8758ce2bc90483336361d2dc25acd3a.tar.gz stable-diffusion-webui-gfx803-ce3f639ec8758ce2bc90483336361d2dc25acd3a.tar.bz2 stable-diffusion-webui-gfx803-ce3f639ec8758ce2bc90483336361d2dc25acd3a.zip |
add more stuff to ignore when creating model from config
prevent .vae.safetensors files from being listed as stable diffusion models
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r-- | modules/modelloader.py | 4 |
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: |