aboutsummaryrefslogtreecommitdiffstats
path: root/modules/upscaler.py
diff options
context:
space:
mode:
authormissionfloyd <missionfloyd@users.noreply.github.com>2023-05-26 00:53:33 +0000
committerGitHub <noreply@github.com>2023-05-26 00:53:33 +0000
commit6645f23c4c715b1bc704c88a499b2f4224d7f1e6 (patch)
tree6aeb51e366254fe8993856a3db341690bb39dca5 /modules/upscaler.py
parent43bdaa2f0eda79c685792b06a2bd84c65806a48f (diff)
parenta6e653be26cc05f4438145fa0082816e9fbbf5fc (diff)
downloadstable-diffusion-webui-gfx803-6645f23c4c715b1bc704c88a499b2f4224d7f1e6.tar.gz
stable-diffusion-webui-gfx803-6645f23c4c715b1bc704c88a499b2f4224d7f1e6.tar.bz2
stable-diffusion-webui-gfx803-6645f23c4c715b1bc704c88a499b2f4224d7f1e6.zip
Merge branch 'dev' into reorder-hotkeys
Diffstat (limited to 'modules/upscaler.py')
-rw-r--r--modules/upscaler.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/upscaler.py b/modules/upscaler.py
index e2eaa730..7b1046d6 100644
--- a/modules/upscaler.py
+++ b/modules/upscaler.py
@@ -2,8 +2,6 @@ import os
from abc import abstractmethod
import PIL
-import numpy as np
-import torch
from PIL import Image
import modules.shared
@@ -36,6 +34,7 @@ class Upscaler:
self.half = not modules.shared.cmd_opts.no_half
self.pre_pad = 0
self.mod_scale = None
+ self.model_download_path = None
if self.model_path is None and self.name:
self.model_path = os.path.join(shared.models_path, self.name)
@@ -43,9 +42,9 @@ class Upscaler:
os.makedirs(self.model_path, exist_ok=True)
try:
- import cv2
+ import cv2 # noqa: F401
self.can_tile = True
- except:
+ except Exception:
pass
@abstractmethod
@@ -57,7 +56,7 @@ class Upscaler:
dest_w = int(img.width * scale)
dest_h = int(img.height * scale)
- for i in range(3):
+ for _ in range(3):
shape = (img.width, img.height)
img = self.do_upscale(img, selected_model)