From aa62f6d8d44844df29814b204ec1ad3582ffb4f0 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Tue, 25 Jul 2023 07:53:44 -0400 Subject: [PATCH] fix refiner batch size --- .../stable-diffusion-webui-images-browser | 2 +- javascript/black-orange.css | 3 ++- javascript/style.css | 6 +++--- modules/processing.py | 2 ++ modules/processing_diffusers.py | 10 +++++----- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/extensions-builtin/stable-diffusion-webui-images-browser b/extensions-builtin/stable-diffusion-webui-images-browser index 6386e0c8f..b984cdd16 160000 --- a/extensions-builtin/stable-diffusion-webui-images-browser +++ b/extensions-builtin/stable-diffusion-webui-images-browser @@ -1 +1 @@ -Subproject commit 6386e0c8f5b5ca0b6f81836edc85f83d4a1d6781 +Subproject commit b984cdd1692f46006333ab92ef463cc35879f455 diff --git a/javascript/black-orange.css b/javascript/black-orange.css index 4785afdfd..f7459095a 100644 --- a/javascript/black-orange.css +++ b/javascript/black-orange.css @@ -118,7 +118,8 @@ svg.feather.feather-image, .feather .feather-image { display: none } #txtimg_hr_finalres { max-width: 200px; } #pnginfo_html2_info { margin-top: -18px; background-color: var(--input-background-fill); padding: var(--input-padding) } #txt2img_tools > div > button, #img2img_tools > div > button { filter: hue-rotate(180deg) saturate(0.5); } -#txt2img_tools, #img2img_tools { margin-top: -5px; margin-bottom: -5px; } +#txt2img_tools, #img2img_tools { margin-top: -4px; margin-bottom: -4px; } +#txt2img_styles_row { margin-top: -6px; } /* custom elements overrides */ #steps-animation, #controlnet { border-width: 0; } diff --git a/javascript/style.css b/javascript/style.css index 8f1279c19..f2fbcd3f2 100644 --- a/javascript/style.css +++ b/javascript/style.css @@ -103,9 +103,9 @@ button.custom-button{ #txt2img_gallery img, #img2img_gallery img, #extras_gallery img { object-fit: scale-down; width: -webkit-fill-available !important; } #txt2img_footer, #img2img_footer, #extras_footer { height: fit-content; } #txt2img_footer, #img2img_footer { height: fit-content; display: none; } -#txt2img_generate_box, #img2img_generate_box { gap: 0.5em; flex-wrap: wrap-reverse; } -#txt2img_actions_column, #img2img_actions_column { gap: 0.5em; } -#txt2img_generate_box > button, #img2img_generate_box > button { min-height: 36px; max-height: 42px; } +#txt2img_generate_box, #img2img_generate_box { gap: 0.5em; flex-wrap: wrap-reverse; height: fit-content; } +#txt2img_actions_column, #img2img_actions_column { gap: 0.5em; height: fit-content; } +#txt2img_generate_box > button, #img2img_generate_box > button { min-height: 42px; max-height: 42px; } #txt2img_generate_line2, #img2img_generate_line2 { display: flex; } #txt2img_generate_line2 > button, #img2img_generate_line2 > button, #extras_generate_box > button { height: 2.2em; line-height: 0; min-width: unset; display: block !important; } #txt2img_tools > div, #img2img_tools > div { justify-content: space-around; margin-top: 0.5em; margin-bottom: 0em; } diff --git a/modules/processing.py b/modules/processing.py index e820a967e..28e42da90 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -150,6 +150,7 @@ class StableDiffusionProcessing: self.is_hr_pass = False self.enable_hr = None self.refiner_denoise_start = 0 + self.ops = [] shared.opts.data['clip_skip'] = clip_skip @property @@ -480,6 +481,7 @@ def create_infotext(p: StableDiffusionProcessing, all_prompts, all_seeds, all_su "Denoise end": p.refiner_denoise_end if p.enable_hr else None, # restore_faces "Face restoration": shared.opts.face_restoration_model if p.restore_faces else None, + "Operations": ', '.join(p.ops), } token_merging_ratio = p.get_token_merging_ratio() token_merging_ratio_hr = p.get_token_merging_ratio(for_hr=True) if p.enable_hr else None diff --git a/modules/processing_diffusers.py b/modules/processing_diffusers.py index eab814867..260d57656 100644 --- a/modules/processing_diffusers.py +++ b/modules/processing_diffusers.py @@ -171,8 +171,8 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro for i in range(len(output.images)): pipe_args = set_pipeline_args( model=shared.sd_refiner, - prompt=[p.refiner_prompt] if len(p.refiner_prompt) > 0 else prompts, - negative_prompt=[p.refiner_negative] if len(p.refiner_negative) > 0 else negative_prompts, + prompt=[p.refiner_prompt] if len(p.refiner_prompt) > 0 else prompts[i], + negative_prompt=[p.refiner_negative] if len(p.refiner_negative) > 0 else negative_prompts[i], num_inference_steps=p.hr_second_pass_steps, eta=shared.opts.eta_ddim, strength=p.denoising_strength, @@ -184,10 +184,10 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro image=output.images[i], output_type='latent' if hasattr(shared.sd_refiner, 'vae') else 'np', ) - output = shared.sd_refiner(**pipe_args) # pylint: disable=not-callable + refiner_output = shared.sd_refiner(**pipe_args) # pylint: disable=not-callable if not shared.state.interrupted and not shared.state.skipped: - output.images = vae_decode(output.images, shared.sd_refiner) - results.append(output.images[i]) + refiner_images = vae_decode(refiner_output.images, shared.sd_refiner) + results.append(refiner_images[0]) if shared.opts.diffusers_move_refiner: shared.log.debug('Diffusers: Moving refiner model to CPU')