diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-03-11 10:44:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 10:44:41 +0000 |
commit | 6705b1764adda07f5b053dafefdd17dccde8b901 (patch) | |
tree | 84bccfe51bc1e54fa4f9971adc168201cfc33bc7 | |
parent | 8ec0442dcd5e51059c2f7ae1572621135f75d858 (diff) | |
parent | d118cb6ea3f1a410b5e030519dc021eafc1d6b52 (diff) | |
download | stable-diffusion-webui-gfx803-6705b1764adda07f5b053dafefdd17dccde8b901.tar.gz stable-diffusion-webui-gfx803-6705b1764adda07f5b053dafefdd17dccde8b901.tar.bz2 stable-diffusion-webui-gfx803-6705b1764adda07f5b053dafefdd17dccde8b901.zip |
Merge pull request #8092 from infinitewarp/sort-upscalers
sort upscalers by name
-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..e351d808 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, UpscalerLanczos, UpscalerNearest, 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.lower() if not isinstance(x.scaler, (UpscalerNone, UpscalerLanczos, UpscalerNearest)) else "" + ) |