From d73f5f6ff6315c37d585ca9379ad86f3d55360b5 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Tue, 19 Sep 2023 15:14:58 -0400 Subject: [PATCH] allow zero denoising --- modules/processing.py | 3 +++ modules/ui.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/processing.py b/modules/processing.py index 90c4038af..f325e6000 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -965,6 +965,9 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): if (self.hr_upscale_to_x == self.width and self.hr_upscale_to_y == self.height) or self.hr_upscaler is None or self.hr_upscaler == 'None': self.is_hr_pass = False return + if self.denoising_strength == 0: + self.is_hr_pass = False + return self.is_hr_pass = True if not shared.state.processing_has_refined_job_count: if shared.state.job_count == -1: diff --git a/modules/ui.py b/modules/ui.py index 8da53b22a..898da57d1 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -392,7 +392,7 @@ def create_ui(startup_timer = None): with FormGroup(): with FormRow(elem_id="sampler_selection_txt2img_alt_row1"): latent_index = gr.Dropdown(label='Secondary sampler', elem_id="txt2img_sampling_alt", choices=[x.name for x in modules.sd_samplers.samplers], value='Default', type="index") - denoising_strength = gr.Slider(minimum=0.05, maximum=1.0, step=0.01, label='Denoising strength', value=0.5, elem_id="txt2img_denoising_strength") + denoising_strength = gr.Slider(minimum=0.0, maximum=1.0, step=0.05, label='Denoising strength', value=0.5, elem_id="txt2img_denoising_strength") with FormRow(elem_id="txt2img_hires_finalres", variant="compact"): hr_final_resolution = FormHTML(value="", elem_id="txtimg_hr_finalres", label="Upscaled resolution", interactive=False) with FormRow(elem_id="txt2img_hires_fix_row1", variant="compact"): @@ -678,7 +678,7 @@ def create_ui(startup_timer = None): with FormGroup(visible=show_denoise.value, elem_id=f"{tab}_denoise_group") as denoise_group: with FormRow(): - denoising_strength = gr.Slider(minimum=0.05, maximum=1.0, step=0.01, label='Denoising strength', value=0.75, elem_id="img2img_denoising_strength") + denoising_strength = gr.Slider(minimum=0.0, maximum=1.0, step=0.05, label='Denoising strength', value=0.75, elem_id="img2img_denoising_strength") refiner_start = gr.Slider(minimum=0.0, maximum=1.0, step=0.05, label='Denoise start', value=0.0, elem_id="img2img_refiner_start") with FormGroup(visible=show_advanced.value, elem_id=f"{tab}_advanced_group") as advanced_group: