diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-13 05:16:37 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-13 05:16:37 +0000 |
commit | b08500cec8a791ef20082628b49b17df833f5dda (patch) | |
tree | 2d09f3ca93139f082b88463f3a2a43a4ac45526f /modules/esrgan_model.py | |
parent | 5ab7f213bec2f816f9c5644becb32eb72c8ffb89 (diff) | |
parent | 231562ea13e4f697953bdbabd6b76b22a88c587b (diff) | |
download | stable-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/esrgan_model.py')
-rw-r--r-- | modules/esrgan_model.py | 11 |
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)
|