From 241b47fa726a4117b86ccf8e5afded4d479e6018 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 7 Sep 2023 09:22:43 -0400 Subject: [PATCH] fix en description style --- javascript/style.css | 6 ++++-- modules/modelloader.py | 3 ++- modules/sd_models.py | 3 ++- modules/shared.py | 8 ++++---- modules/ui_extra_networks.py | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/javascript/style.css b/javascript/style.css index b390cbafa..381598f15 100644 --- a/javascript/style.css +++ b/javascript/style.css @@ -236,7 +236,7 @@ table.settings-value-table td { padding: 0.4em; border: 1px solid #ccc; max-widt .extra-networks .custom-button { width: 120px; width: 100%; background: none; justify-content: left; text-align: left; padding: 2px 8px 2px 16px; text-indent: -8px; box-shadow: none; line-break: auto; } .extra-networks .custom-button:hover { background: var(--button-primary-background-fill) } .extra-network-cards { display: flex; flex-wrap: wrap; overflow-y: auto; overflow-x: hidden; align-content: flex-start; width: -webkit-fill-available; } -.extra-network-cards .card { height: fit-content; margin: 0.5em; position: relative; scroll-snap-align: start; scroll-margin-top: 0; } +.extra-network-cards .card { height: fit-content; margin: 0 0 0.5em 0.5em; position: relative; scroll-snap-align: start; scroll-margin-top: 0; } .extra-network-cards .card .overlay { position: absolute; bottom: 0; padding: 0.2em; z-index: 10; width: 100%; background: none; } .extra-network-cards .card:hover .overlay { background: rgba(0, 0, 0, 0.40); } .extra-network-cards .card .overlay .name { font-size: 1.1em; font-weight: bold; text-shadow: 1px 1px black; color: white; } @@ -249,7 +249,9 @@ table.settings-value-table td { padding: 0.4em; border: 1px solid #ccc; max-widt .extra-network-cards .card:hover .overlay .actions { display: block; } .extra-network-cards .card:hover .overlay .tags { display: block; } .extra-network-cards .card:hover .overlay .description { display: block; } -.extra-network-cards .card:hover .preview { box-shadow: none; } +.extra-network-cards .card:hover .preview { box-shadow: none; filter: grayscale(100%); } +#txt2img_description, #img2img_description { max-height: 63px; overflow-y: auto !important; } +#txt2img_description > label > textarea, #img2img_description > label > textarea { font-size: 0.9em } /* controlnet */ .controlnet_control_type .controlnet_control_type_filter_group .wrap:last-of-type { display: grid; grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); } diff --git a/modules/modelloader.py b/modules/modelloader.py index fc456882a..bb0639389 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -175,6 +175,7 @@ def download_diffusers_model(hub_id: str, cache_dir: str = None, download_config def load_diffusers_models(model_path: str, command_path: str = None): + t0 = time.time() import huggingface_hub as hf places = [] places.append(model_path) @@ -194,7 +195,7 @@ def load_diffusers_models(model_path: str, command_path: str = None): output.append(str(r.repo_id)) except Exception as e: shared.log.error(f"Error listing diffusers: {place} {e}") - shared.log.debug(f'Scanning diffusers cache: {model_path} {command_path} items={len(output)}') + shared.log.debug(f'Scanning diffusers cache: {model_path} {command_path} items={len(output)} time={time.time()-t0:.2f}s') return output diff --git a/modules/sd_models.py b/modules/sd_models.py index b59ae8681..3243d4951 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -144,6 +144,7 @@ def checkpoint_tiles(use_short=False): # pylint: disable=unused-argument def list_models(): + t0 = time.time() checkpoints_list.clear() checkpoint_aliases.clear() if shared.opts.sd_disable_ckpt or shared.backend == shared.Backend.DIFFUSERS: @@ -168,7 +169,7 @@ def list_models(): shared.opts.data['sd_model_checkpoint'] = checkpoint_info.title elif shared.cmd_opts.ckpt != shared.default_sd_model_file and shared.cmd_opts.ckpt is not None: shared.log.warning(f"Checkpoint not found: {shared.cmd_opts.ckpt}") - shared.log.info(f'Available models: {shared.opts.ckpt_dir} items={len(checkpoints_list)}') + shared.log.info(f'Available models: {shared.opts.ckpt_dir} items={len(checkpoints_list)} time={time.time()-t0:.2f}s') if len(checkpoints_list) == 0: if not shared.cmd_opts.no_download: diff --git a/modules/shared.py b/modules/shared.py index 3ca8b4607..ebc142a63 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -274,14 +274,14 @@ def list_themes(): def temp_disable_extensions(): disabled = [] - if opts.lyco_patch_lora and backend != Backend.DIFFUSERS: - if 'Lora' not in opts.disabled_extensions: - disabled.append('Lora') if backend == Backend.DIFFUSERS: for ext in ['sd-webui-controlnet', 'multidiffusion-upscaler-for-automatic1111', 'a1111-sd-webui-lycoris']: if ext not in opts.disabled_extensions: - log.warning(f'Diffusers disabling uncompatible extension: {ext}') disabled.append(ext) + log.warning(f'Diffusers disabling uncompatible extensions: {disabled}') + if opts.lyco_patch_lora and backend != Backend.DIFFUSERS: + if 'Lora' not in opts.disabled_extensions: + disabled.append('Lora') return disabled diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 5ccf2bde0..c3a6e2ad9 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -339,8 +339,8 @@ def create_ui(container, button, tabname, skip_indexing = False): with gr.Tabs(elem_id=tabname+"_extra_tabs"): button_refresh = ToolButton(symbols.refresh, elem_id=tabname+"_extra_refresh") button_close = ToolButton(symbols.close, elem_id=tabname+"_extra_close") - ui.search = gr.Textbox('', show_label=False, elem_id=tabname+"_extra_search", placeholder="Search...", elem_classes="textbox", lines=1) - ui.description = gr.TextArea('', show_label=False, elem_id=tabname+"_description", placeholder="Save/Replace Extra Network Description...", elem_classes="textbox", lines=1) + ui.search = gr.Textbox('', show_label=False, elem_id=tabname+"_extra_search", placeholder="Search...", elem_classes="textbox", lines=2) + ui.description = gr.Textbox('', show_label=False, elem_id=tabname+"_description", placeholder="Save/Replace Extra Network Description...", elem_classes="textbox", lines=2) ui.preview_target_filename = gr.Textbox('Preview save filename', elem_id=tabname+"_preview_filename", visible=False) ui.button_save_preview = gr.Button('Save preview', elem_id=tabname+"_save_preview", visible=False) ui.description_target_filename = gr.Textbox('Description save filename', elem_id=tabname+"_description_filename", visible=False)