From 9d42d7d678fb7328bf90861217f97a04052fb363 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 7 Sep 2023 08:54:11 -0400 Subject: [PATCH] fix lyco patch and validate settings --- javascript/amethyst-nightfall.css | 2 +- javascript/black-orange.css | 2 +- javascript/black-teal.css | 2 +- javascript/extraNetworks.js | 4 ++-- javascript/light-teal.css | 2 +- javascript/midnight-barbie.css | 2 +- modules/shared.py | 1 + modules/ui.py | 5 +++-- 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/javascript/amethyst-nightfall.css b/javascript/amethyst-nightfall.css index 1a0621f84..ad370bb4d 100644 --- a/javascript/amethyst-nightfall.css +++ b/javascript/amethyst-nightfall.css @@ -120,7 +120,7 @@ svg.feather.feather-image, .feather .feather-image { display: none } #pnginfo_html2_info { margin-top: -18px; background-color: var(--input-background-fill); padding: var(--input-padding) } .gradio-button.tool { filter: hue-rotate(180deg) saturate(0.5); } #txt2img_tools, #img2img_tools { margin-top: -4px; margin-bottom: -4px; } -#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; } +#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; z-index: 200; } /* custom elements overrides */ #steps-animation, #controlnet { border-width: 0; } diff --git a/javascript/black-orange.css b/javascript/black-orange.css index 483e5c525..d98a42141 100644 --- a/javascript/black-orange.css +++ b/javascript/black-orange.css @@ -115,7 +115,7 @@ svg.feather.feather-image, .feather .feather-image { display: none } #pnginfo_html2_info { margin-top: -18px; background-color: var(--input-background-fill); padding: var(--input-padding) } .gradio-button.tool { filter: hue-rotate(180deg) saturate(0.5); } #txt2img_tools, #img2img_tools { margin-top: -4px; margin-bottom: -4px; } -#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; } +#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; z-index: 200; } /* custom elements overrides */ #steps-animation, #controlnet { border-width: 0; } diff --git a/javascript/black-teal.css b/javascript/black-teal.css index 3552d325f..207e5f2f8 100644 --- a/javascript/black-teal.css +++ b/javascript/black-teal.css @@ -122,7 +122,7 @@ svg.feather.feather-image, .feather .feather-image { display: none } #txt2img_settings { min-width: var(--left-column); max-width: var(--left-column); background-color: #111111; padding-top: 16px; } #pnginfo_html2_info { margin-top: -18px; background-color: var(--input-background-fill); padding: var(--input-padding) } #txt2img_tools, #img2img_tools { margin-top: -4px; margin-bottom: -4px; } -#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; } +#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; z-index: 200; } /* custom elements overrides */ #steps-animation, #controlnet { border-width: 0; } diff --git a/javascript/extraNetworks.js b/javascript/extraNetworks.js index f0e999ac5..4d833d8f9 100644 --- a/javascript/extraNetworks.js +++ b/javascript/extraNetworks.js @@ -179,7 +179,7 @@ function setupExtraNetworksForTab(tabname) { if (entries[0].intersectionRatio > 0) { if (window.opts.extra_networks_card_cover === 'cover') { en.style.transition = ''; - en.style.zIndex = 9999; + en.style.zIndex = 100; en.style.position = 'absolute'; en.style.right = 'unset'; en.style.width = 'unset'; @@ -187,7 +187,7 @@ function setupExtraNetworksForTab(tabname) { gradioApp().getElementById(`${tabname}_settings`).parentNode.style.width = 'unset'; } else if (window.opts.extra_networks_card_cover === 'sidebar') { en.style.transition = 'width 0.2s ease'; - en.style.zIndex = 9999; + en.style.zIndex = 100; en.style.position = 'absolute'; en.style.right = '0'; en.style.width = `${window.opts.extra_networks_sidebar_width}vw`; diff --git a/javascript/light-teal.css b/javascript/light-teal.css index eb9cd6aae..a7f285951 100644 --- a/javascript/light-teal.css +++ b/javascript/light-teal.css @@ -122,7 +122,7 @@ svg.feather.feather-image, .feather .feather-image { display: none } #txt2img_settings { min-width: var(--left-column); max-width: var(--left-column); background-color: #111111; padding-top: 16px; } #pnginfo_html2_info { margin-top: -18px; background-color: var(--input-background-fill); padding: var(--input-padding) } #txt2img_tools, #img2img_tools { margin-top: -4px; margin-bottom: -4px; } -#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; } +#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; z-index: 200; } /* custom elements overrides */ #steps-animation, #controlnet { border-width: 0; } diff --git a/javascript/midnight-barbie.css b/javascript/midnight-barbie.css index fc1e509b9..b2c7130a9 100644 --- a/javascript/midnight-barbie.css +++ b/javascript/midnight-barbie.css @@ -115,7 +115,7 @@ svg.feather.feather-image, .feather .feather-image { display: none } #pnginfo_html2_info { margin-top: -18px; background-color: var(--input-background-fill); padding: var(--input-padding) } .gradio-button.tool { filter: hue-rotate(120deg) saturate(0.5); } #txt2img_tools, #img2img_tools { margin-top: -4px; margin-bottom: -4px; } -#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; } +#txt2img_styles_row, #img2img_styles_row { margin-top: -6px; z-index: 200; } /* custom elements overrides */ #steps-animation, #controlnet { border-width: 0; } diff --git a/modules/shared.py b/modules/shared.py index e909bf314..3ca8b4607 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -428,6 +428,7 @@ options_templates.update(options_section(('system-paths', "System Paths"), { "ckpt_dir": OptionInfo(os.path.join(paths.models_path, 'Stable-diffusion'), "Path to directory with stable diffusion checkpoints"), "diffusers_dir": OptionInfo(os.path.join(paths.models_path, 'Diffusers'), "Path to directory with stable diffusion diffusers"), "vae_dir": OptionInfo(os.path.join(paths.models_path, 'VAE'), "Path to directory with VAE files"), + "sd_lora": OptionInfo("", "Add LoRA to prompt", gr.CheckboxGroup, {"choices": [], "visible": False}), "lora_dir": OptionInfo(os.path.join(paths.models_path, 'Lora'), "Path to directory with LoRA network(s)"), "lyco_dir": OptionInfo(os.path.join(paths.models_path, 'LyCORIS'), "Path to directory with LyCORIS network(s)"), "styles_dir": OptionInfo(os.path.join(paths.data_path, 'styles.csv'), "Path to user-defined styles file"), diff --git a/modules/ui.py b/modules/ui.py index 5ab6158f7..87c9cbb1b 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -966,11 +966,12 @@ def create_ui(startup_timer = None): def run_settings(*args): changed = [] - for key, value, comp in zip(opts.data_labels.keys(), args, components): - assert comp == dummy_component or opts.same_type(value, opts.data_labels[key].default), f"Bad value for setting {key}: {value}; expecting {type(opts.data_labels[key].default).__name__}" for key, value, comp in zip(opts.data_labels.keys(), args, components): if comp == dummy_component: continue + elif not opts.same_type(value, opts.data_labels[key].default): + log.error(f'Setting bad value: {key}={value} expecting={type(opts.data_labels[key].default).__name__}') + continue if opts.set(key, value): changed.append(key) if cmd_opts.use_directml: