From 93bfd7f85bcd84ed4c47ca3e39e5f4b81a75e5f9 Mon Sep 17 00:00:00 2001 From: DenOfEquity <166248528+DenOfEquity@users.noreply.github.com> Date: Sun, 18 Aug 2024 03:34:11 +0100 Subject: [PATCH] invalidate cond cache if distilled CFG changed (#1240) * Update processing.py add distilled_cfg_scale to params that invalidate cond cache * Update ui.py distilled CFG and CFG step size 0.1 (from 0.5) --- modules/processing.py | 1 + modules/ui.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/processing.py b/modules/processing.py index eb7f3450..bcb41827 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -419,6 +419,7 @@ class StableDiffusionProcessing: return ( required_prompts, + self.distilled_cfg_scale, steps, hires_steps, use_old_scheduling, diff --git a/modules/ui.py b/modules/ui.py index b62f45ec..2fde22bf 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -307,9 +307,9 @@ def create_ui(): elif category == "cfg": with gr.Row(): - distilled_cfg_scale = gr.Slider(minimum=0.0, maximum=30.0, step=0.5, label='Distilled CFG Scale', value=3.5, elem_id="txt2img_distilled_cfg_scale") + distilled_cfg_scale = gr.Slider(minimum=0.0, maximum=30.0, step=0.1, label='Distilled CFG Scale', value=3.5, elem_id="txt2img_distilled_cfg_scale") with gr.Row(): - cfg_scale = gr.Slider(minimum=1.0, maximum=30.0, step=0.5, label='CFG Scale', value=7.0, elem_id="txt2img_cfg_scale") + cfg_scale = gr.Slider(minimum=1.0, maximum=30.0, step=0.1, label='CFG Scale', value=7.0, elem_id="txt2img_cfg_scale") cfg_scale.change(lambda x: gr.update(interactive=(x != 1)), inputs=[cfg_scale], outputs=[toprow.negative_prompt], queue=False, show_progress=False) elif category == "checkboxes":