aboutsummaryrefslogtreecommitdiff
path: root/modules/modelloader.py
diff options
context:
space:
mode:
authorVespinian <vespinian@proton.me>2023-03-11 12:33:35 -0500
committerVespinian <vespinian@proton.me>2023-03-11 12:33:35 -0500
commit46f9fe3cd6b7be712d85cdfc2cdff7ac3fe878b5 (patch)
treea134b22d856ab534c497b04c0d7ec87935cfcce7 /modules/modelloader.py
parent2174f58daee1e077eec1125e196d34cc93dbaf23 (diff)
parent94ffa9fc5386e51f20692ab46906135e8de33110 (diff)
Merge branch 'master' of https://github.com/AUTOMATIC1111/stable-diffusion-webui
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r--modules/modelloader.py8
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 ""
+ )