From 611598d22fa6eed59ba96df78fc5f5aef352db4b Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 3 Nov 2023 18:12:07 -0400 Subject: [PATCH] cleanup --- modules/sd_models.py | 8 ++++---- modules/ui.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/sd_models.py b/modules/sd_models.py index f68d82f1e..dc33538a2 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -203,13 +203,13 @@ def list_models(): def update_model_hashes(): txt = [] lst = [ckpt for ckpt in checkpoints_list.values() if ckpt.hash is None] - shared.log.info(f'Models list: short hash missing for {len(lst)} out of {len(checkpoints_list)} models') + # shared.log.info(f'Models list: short hash missing for {len(lst)} out of {len(checkpoints_list)} models') for ckpt in lst: ckpt.hash = model_hash(ckpt.filename) - txt.append(f'Calculated short hash: {ckpt.title} {ckpt.hash}') - txt.append(f'Updated short hashes for {len(lst)} out of {len(checkpoints_list)} models') + # txt.append(f'Calculated short hash: {ckpt.title} {ckpt.hash}') + # txt.append(f'Updated short hashes for {len(lst)} out of {len(checkpoints_list)} models') lst = [ckpt for ckpt in checkpoints_list.values() if ckpt.sha256 is None or ckpt.shorthash is None] - shared.log.info(f'Models list: full hash missing for {len(lst)} out of {len(checkpoints_list)} models') + shared.log.info(f'Models list: hash missing={len(lst)} total={len(checkpoints_list)}') for ckpt in lst: ckpt.sha256 = hashes.sha256(ckpt.filename, f"checkpoint/{ckpt.name}") ckpt.shorthash = ckpt.sha256[0:10] if ckpt.sha256 is not None else None diff --git a/modules/ui.py b/modules/ui.py index f80ad290c..0edd90083 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -273,8 +273,7 @@ def create_toprow(is_img2img): negative_token_counter = gr.HTML(value="0/75", elem_id=f"{id_part}_negative_token_counter", elem_classes=["token-counter"]) negative_token_button = gr.Button(visible=False, elem_id=f"{id_part}_negative_token_button") with gr.Row(elem_id=f"{id_part}_styles_row"): - # prompt_styles = gr.Dropdown(label="Styles", elem_id=f"{id_part}_styles", choices=[style.name for style in modules.shared.prompt_styles.styles.values()], value=[], multiselect=True) - prompt_styles = gr.Dropdown(label="Styles", elem_id=f"{id_part}_styles", choices=['aaa'], value=[], multiselect=True) + prompt_styles = gr.Dropdown(label="Styles", elem_id=f"{id_part}_styles", choices=[style.name for style in modules.shared.prompt_styles.styles.values()], value=[], multiselect=True) prompt_styles_btn_refresh = ToolButton(symbols.refresh, elem_id=f"{id_part}_styles_refresh", visible=True) prompt_styles_btn_refresh.click(fn=lambda: gr.update(choices=[style.name for style in modules.shared.prompt_styles.styles.values()]), inputs=[], outputs=[prompt_styles]) prompt_styles_btn_select = gr.Button('Select', elem_id=f"{id_part}_styles_select", visible=False)