aboutsummaryrefslogtreecommitdiffstats
path: root/modules/upscaler.py
diff options
context:
space:
mode:
authorMilly <milly.ca@gmail.com>2022-10-06 18:36:08 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2022-10-09 09:46:07 +0000
commit0609ce06c0778536cb368ac3867292f87c6d9fc7 (patch)
treedf441f6536cbbdec40e3f4cc8781d1d82e419620 /modules/upscaler.py
parenta65a45272e8f26ee3bc52a5300b396266508a9a5 (diff)
downloadstable-diffusion-webui-gfx803-0609ce06c0778536cb368ac3867292f87c6d9fc7.tar.gz
stable-diffusion-webui-gfx803-0609ce06c0778536cb368ac3867292f87c6d9fc7.tar.bz2
stable-diffusion-webui-gfx803-0609ce06c0778536cb368ac3867292f87c6d9fc7.zip
Removed duplicate definition model_path
Diffstat (limited to 'modules/upscaler.py')
-rw-r--r--modules/upscaler.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/upscaler.py b/modules/upscaler.py
index d9d7c5e2..34672be7 100644
--- a/modules/upscaler.py
+++ b/modules/upscaler.py
@@ -36,10 +36,11 @@ class Upscaler:
self.half = not modules.shared.cmd_opts.no_half
self.pre_pad = 0
self.mod_scale = None
- if self.name is not None and create_dirs:
+
+ if self.model_path is not None and self.name:
self.model_path = os.path.join(models_path, self.name)
- if not os.path.exists(self.model_path):
- os.makedirs(self.model_path)
+ if self.model_path and create_dirs:
+ os.makedirs(self.model_path, exist_ok=True)
try:
import cv2