diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-09 22:40:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 22:40:51 +0300 |
commit | d6a9b22c195a0b4b9c6b04ccdfc59c18d099da7a (patch) | |
tree | 894f00b92caa229dbfaa2d07c16c25e0167412db /modules/realesrgan_model.py | |
parent | ccbb361845bfabfa3fc2c77bb234ea4be0781dd9 (diff) | |
parent | 3ba6c3c83c0983a025c7bddc08bb7f49481b3cbb (diff) |
Merge pull request #10232 from akx/eff
Fix up string formatting/concatenation to f-strings where feasible
Diffstat (limited to 'modules/realesrgan_model.py')
-rw-r--r-- | modules/realesrgan_model.py | 8 |
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(
|