aboutsummaryrefslogtreecommitdiffstats
path: root/modules/realesrgan_model.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-13 05:16:37 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-13 05:16:37 +0000
commitb08500cec8a791ef20082628b49b17df833f5dda (patch)
tree2d09f3ca93139f082b88463f3a2a43a4ac45526f /modules/realesrgan_model.py
parent5ab7f213bec2f816f9c5644becb32eb72c8ffb89 (diff)
parent231562ea13e4f697953bdbabd6b76b22a88c587b (diff)
downloadstable-diffusion-webui-gfx803-b08500cec8a791ef20082628b49b17df833f5dda.tar.gz
stable-diffusion-webui-gfx803-b08500cec8a791ef20082628b49b17df833f5dda.tar.bz2
stable-diffusion-webui-gfx803-b08500cec8a791ef20082628b49b17df833f5dda.zip
Merge branch '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(