aboutsummaryrefslogtreecommitdiffstats
path: root/modules/esrgan_model.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-09 19:40:51 +0000
committerGitHub <noreply@github.com>2023-05-09 19:40:51 +0000
commitd6a9b22c195a0b4b9c6b04ccdfc59c18d099da7a (patch)
tree894f00b92caa229dbfaa2d07c16c25e0167412db /modules/esrgan_model.py
parentccbb361845bfabfa3fc2c77bb234ea4be0781dd9 (diff)
parent3ba6c3c83c0983a025c7bddc08bb7f49481b3cbb (diff)
downloadstable-diffusion-webui-gfx803-d6a9b22c195a0b4b9c6b04ccdfc59c18d099da7a.tar.gz
stable-diffusion-webui-gfx803-d6a9b22c195a0b4b9c6b04ccdfc59c18d099da7a.tar.bz2
stable-diffusion-webui-gfx803-d6a9b22c195a0b4b9c6b04ccdfc59c18d099da7a.zip
Merge pull request #10232 from akx/eff
Fix up string formatting/concatenation to f-strings where feasible
Diffstat (limited to 'modules/esrgan_model.py')
-rw-r--r--modules/esrgan_model.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/esrgan_model.py b/modules/esrgan_model.py
index 9a9c38f1..f4369257 100644
--- a/modules/esrgan_model.py
+++ b/modules/esrgan_model.py
@@ -156,13 +156,16 @@ class UpscalerESRGAN(Upscaler):
def load_model(self, path: str):
if "http" in path:
- filename = load_file_from_url(url=self.model_url, model_dir=self.model_path,
- file_name="%s.pth" % self.model_name,
- progress=True)
+ filename = load_file_from_url(
+ url=self.model_url,
+ model_dir=self.model_path,
+ file_name=f"{self.model_name}.pth",
+ progress=True,
+ )
else:
filename = path
if not os.path.exists(filename) or filename is None:
- print("Unable to load %s from %s" % (self.model_path, filename))
+ print(f"Unable to load {self.model_path} from {filename}")
return None
state_dict = torch.load(filename, map_location='cpu' if devices.device_esrgan.type == 'mps' else None)