diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-19 06:09:00 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-19 06:09:18 +0000 |
commit | df6fffb054f8d3444baa887151a4874506a68be1 (patch) | |
tree | 6b2ab174215a1525a62d1fdd9fd46f7c61302e1d /modules/modelloader.py | |
parent | 379fd6204dfc27e16acc03f705ecd9ff23c2d1c0 (diff) | |
download | stable-diffusion-webui-gfx803-df6fffb054f8d3444baa887151a4874506a68be1.tar.gz stable-diffusion-webui-gfx803-df6fffb054f8d3444baa887151a4874506a68be1.tar.bz2 stable-diffusion-webui-gfx803-df6fffb054f8d3444baa887151a4874506a68be1.zip |
change upscalers to download models into user-specified directory (from commandline args) rather than the default models/<...>
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r-- | modules/modelloader.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/modelloader.py b/modules/modelloader.py index 2a479bcb..be23071a 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -47,7 +47,7 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None if model_url is not None and len(output) == 0: if download_name is not None: from basicsr.utils.download_util import load_file_from_url - dl = load_file_from_url(model_url, model_path, True, download_name) + dl = load_file_from_url(model_url, places[0], True, download_name) output.append(dl) else: output.append(model_url) @@ -144,7 +144,10 @@ def load_upscalers(): for cls in reversed(used_classes.values()): name = cls.__name__ cmd_name = f"{name.lower().replace('upscaler', '')}_models_path" - scaler = cls(commandline_options.get(cmd_name, None)) + commandline_model_path = commandline_options.get(cmd_name, None) + scaler = cls(commandline_model_path) + scaler.user_path = commandline_model_path + scaler.model_download_path = commandline_model_path or scaler.model_path datas += scaler.scalers shared.sd_upscalers = sorted( |