diff options
author | Brad Smith <bradster@infinitewarp.com> | 2023-02-24 19:22:58 +0000 |
---|---|---|
committer | Brad Smith <bradster@infinitewarp.com> | 2023-02-24 19:45:08 +0000 |
commit | b15bc73c99e6fbbeffdbdbeab39ba30276021d4b (patch) | |
tree | c6fac7015655f01a792f2f6a32068913d01bad77 /modules/modelloader.py | |
parent | 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 (diff) | |
download | stable-diffusion-webui-gfx803-b15bc73c99e6fbbeffdbdbeab39ba30276021d4b.tar.gz stable-diffusion-webui-gfx803-b15bc73c99e6fbbeffdbdbeab39ba30276021d4b.tar.bz2 stable-diffusion-webui-gfx803-b15bc73c99e6fbbeffdbdbeab39ba30276021d4b.zip |
sort upscalers by name
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r-- | modules/modelloader.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/modelloader.py b/modules/modelloader.py index fc3f6249..a7ac338c 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -6,7 +6,7 @@ from urllib.parse import urlparse from basicsr.utils.download_util import load_file_from_url from modules import shared -from modules.upscaler import Upscaler +from modules.upscaler import Upscaler, UpscalerNone from modules.paths import script_path, models_path @@ -169,4 +169,8 @@ def load_upscalers(): scaler = cls(commandline_options.get(cmd_name, None)) datas += scaler.scalers - shared.sd_upscalers = datas + shared.sd_upscalers = sorted( + datas, + # Special case for UpscalerNone keeps it at the beginning of the list. + key=lambda x: x.name if not isinstance(x.scaler, UpscalerNone) else "" + ) |