aboutsummaryrefslogtreecommitdiffstats
path: root/modules/realesrgan_model.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-09 19:42:37 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-09 19:42:37 +0000
commitc8791c1d37502f162b8616b066303bfadc4a749b (patch)
tree6843c3505117f26549dfe1dc9cd40aacd5ccdfd3 /modules/realesrgan_model.py
parent6fbd85dd0c0dffc06560bff91f4c4b65e441ca5f (diff)
parent31397986e70d20e392d9c3ec70d3aef8ecc2c1ff (diff)
downloadstable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.tar.gz
stable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.tar.bz2
stable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.zip
Merge branch 'dev' into release_candidate
Diffstat (limited to 'modules/realesrgan_model.py')
-rw-r--r--modules/realesrgan_model.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/realesrgan_model.py b/modules/realesrgan_model.py
index d6079433..efd7fca5 100644
--- a/modules/realesrgan_model.py
+++ b/modules/realesrgan_model.py
@@ -28,9 +28,9 @@ class UpscalerRealESRGAN(Upscaler):
for scaler in scalers:
if scaler.local_data_path.startswith("http"):
filename = modelloader.friendly_name(scaler.local_data_path)
- local = next(iter([local_model for local_model in local_model_paths if local_model.endswith(filename + '.pth')]), None)
- if local:
- scaler.local_data_path = local
+ local_model_candidates = [local_model for local_model in local_model_paths if local_model.endswith(f"{filename}.pth")]
+ if local_model_candidates:
+ scaler.local_data_path = local_model_candidates[0]
if scaler.name in opts.realesrgan_enabled_models:
self.scalers.append(scaler)
@@ -47,7 +47,7 @@ class UpscalerRealESRGAN(Upscaler):
info = self.load_model(path)
if not os.path.exists(info.local_data_path):
- print("Unable to load RealESRGAN model: %s" % info.name)
+ print(f"Unable to load RealESRGAN model: {info.name}")
return img
upsampler = RealESRGANer(