aboutsummaryrefslogtreecommitdiffstats
path: root/modules/processing.py
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-06-02 11:58:10 +0000
committerAarni Koskela <akx@iki.fi>2023-06-02 12:07:10 +0000
commit51864790fd72386fbbbb015d24a43ce501ecaa4b (patch)
treea114dc065c25ec267043f35dea735f8e3097e9a0 /modules/processing.py
parent3e995778fc525ff15d56c1472c1a1bc701019ec5 (diff)
downloadstable-diffusion-webui-gfx803-51864790fd72386fbbbb015d24a43ce501ecaa4b.tar.gz
stable-diffusion-webui-gfx803-51864790fd72386fbbbb015d24a43ce501ecaa4b.tar.bz2
stable-diffusion-webui-gfx803-51864790fd72386fbbbb015d24a43ce501ecaa4b.zip
Simplify a bunch of `len(x) > 0`/`len(x) == 0` style expressions
Diffstat (limited to 'modules/processing.py')
-rw-r--r--modules/processing.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/processing.py b/modules/processing.py
index 362ab4c2..9ebdb549 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -975,7 +975,8 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
latent_scale_mode = shared.latent_upscale_modes.get(self.hr_upscaler, None) if self.hr_upscaler is not None else shared.latent_upscale_modes.get(shared.latent_upscale_default_mode, "nearest")
if self.enable_hr and latent_scale_mode is None:
- assert len([x for x in shared.sd_upscalers if x.name == self.hr_upscaler]) > 0, f"could not find upscaler named {self.hr_upscaler}"
+ if not any(x.name == self.hr_upscaler for x in shared.sd_upscalers):
+ raise Exception(f"could not find upscaler named {self.hr_upscaler}")
x = create_random_tensors([opt_C, self.height // opt_f, self.width // opt_f], seeds=seeds, subseeds=subseeds, subseed_strength=self.subseed_strength, seed_resize_from_h=self.seed_resize_from_h, seed_resize_from_w=self.seed_resize_from_w, p=self)
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))