aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-04 22:25:52 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-01-04 22:25:52 +0000
commit99b67cff0b48c4a1ad6e14d9cc591b11db6e293c (patch)
tree7f4cef739036d9eae1ee3e825f6f10c5199ad0e4 /modules
parentb663ee2cff6831354e1b5326800c8d1bf300cafe (diff)
downloadstable-diffusion-webui-gfx803-99b67cff0b48c4a1ad6e14d9cc591b11db6e293c.tar.gz
stable-diffusion-webui-gfx803-99b67cff0b48c4a1ad6e14d9cc591b11db6e293c.tar.bz2
stable-diffusion-webui-gfx803-99b67cff0b48c4a1ad6e14d9cc591b11db6e293c.zip
make hires fix not do anything if the user chooses the second pass resolution to be the same as first pass resolution
Diffstat (limited to 'modules')
-rw-r--r--modules/processing.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/modules/processing.py b/modules/processing.py
index f28e7212..7e853287 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -683,16 +683,9 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
self.truncate_x = 0
self.truncate_y = 0
+
def init(self, all_prompts, all_seeds, all_subseeds):
if self.enable_hr:
- if not state.processing_has_refined_job_count:
- if state.job_count == -1:
- state.job_count = self.n_iter
-
- shared.total_tqdm.updateTotal((self.steps + (self.hr_second_pass_steps or self.steps)) * state.job_count)
- state.job_count = state.job_count * 2
- state.processing_has_refined_job_count = True
-
if self.hr_resize_x == 0 and self.hr_resize_y == 0:
self.extra_generation_params["Hires upscale"] = self.hr_scale
self.hr_upscale_to_x = int(self.width * self.hr_scale)
@@ -722,6 +715,22 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
self.truncate_x = (self.hr_upscale_to_x - target_w) // opt_f
self.truncate_y = (self.hr_upscale_to_y - target_h) // opt_f
+ # special case: the user has chosen to do nothing
+ if self.hr_upscale_to_x == self.width and self.hr_upscale_to_y == self.height:
+ self.enable_hr = False
+ self.denoising_strength = None
+ self.extra_generation_params.pop("Hires upscale", None)
+ self.extra_generation_params.pop("Hires resize", None)
+ return
+
+ if not state.processing_has_refined_job_count:
+ if state.job_count == -1:
+ state.job_count = self.n_iter
+
+ shared.total_tqdm.updateTotal((self.steps + (self.hr_second_pass_steps or self.steps)) * state.job_count)
+ state.job_count = state.job_count * 2
+ state.processing_has_refined_job_count = True
+
if self.hr_second_pass_steps:
self.extra_generation_params["Hires steps"] = self.hr_second_pass_steps