From 7dcc5b67f6d62b07b439aea98fc9b4a770641018 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Tue, 29 Jul 2025 06:04:14 -0400 Subject: [PATCH] fix yolo model refresh Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 7 ++++--- modules/postprocess/yolo.py | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47530a1f8..22c48e76c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Change Log for SD.Next -## Update for 2025-07-28 +## Update for 2025-07-29 -### Highlights for 2025-07-28 +### Highlights for 2025-07-29 Feature highlights include: - **ModernUI** has quite some redesign which should make it more user friendly and easier to navigate plus several new UI themes! @@ -32,7 +32,7 @@ For details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/master [ReadMe](https://github.com/vladmandic/automatic/blob/master/README.md) | [ChangeLog](https://github.com/vladmandic/automatic/blob/master/CHANGELOG.md) | [Docs](https://vladmandic.github.io/sdnext-docs/) | [WiKi](https://github.com/vladmandic/automatic/wiki) | [Discord](https://discord.com/invite/sd-next-federal-batch-inspectors-1101998836328697867) -### Details for 2025-07-28 +### Details for 2025-07-29 - **License** - SD.Next [license](https://github.com/vladmandic/sdnext/blob/dev/LICENSE.txt) switched from **aGPL-v3.0** to **Apache-v2.0** @@ -169,6 +169,7 @@ For details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/master - fix prompt encoding if prompts within batch have different segment counts - fix detailer min/max size - fix loopback script + - fix yolo refresh models - cleanup control infotext - allow upscaling with models that have implicit VAE processing - framepack improve offloading diff --git a/modules/postprocess/yolo.py b/modules/postprocess/yolo.py index f1291479c..35638df78 100644 --- a/modules/postprocess/yolo.py +++ b/modules/postprocess/yolo.py @@ -69,7 +69,7 @@ class YoloRestorer(Detailer): if name not in files: self.list[name] = os.path.join(shared.opts.yolo_dir, f) shared.log.info(f'Available Detailer: path="{shared.opts.yolo_dir}" items={len(list(self.list))} downloaded={downloaded}') - return self.list + return list(self.list) def dependencies(self): import installer @@ -412,9 +412,9 @@ class YoloRestorer(Detailer): enabled = gr.Checkbox(label="Enable detailer pass", elem_id=f"{tab}_detailer_enabled", value=False) merge = gr.Checkbox(label="Merge detailers", elem_id=f"{tab}_detailer_merge", value=shared.opts.detailer_merge, visible=True) with gr.Row(): - detailers = gr.Dropdown(label="Detailer models", elem_id=f"{tab}_detailers", choices=self.list, value=shared.opts.detailer_models, multiselect=True, visible=True) + detailers = gr.Dropdown(label="Detailer models", elem_id=f"{tab}_detailers", choices=list(self.list), value=shared.opts.detailer_models, multiselect=True, visible=True) detailers_text = gr.Textbox(label="Detailer list", elem_id=f"{tab}_detailers_text", placeholder="Comma separated list of detailer models", lines=2, visible=False, interactive=True) - refresh_btn = ui_common.create_refresh_button(detailers, self.enumerate, {}, elem_id=f"{tab}_detailers_refresh") + refresh_btn = ui_common.create_refresh_button(detailers, self.enumerate, lambda: {"choices": self.enumerate()}, 'yolo_refresh_models') ui_mode = ui_components.ToolButton(value=ui_symbols.view) ui_mode.click(fn=self.change_mode, inputs=[detailers, detailers_text], outputs=[detailers, detailers_text, refresh_btn]) with gr.Row():