From c09aab0d0da60a7bcd1e8af597deb4f2371a9a2e Mon Sep 17 00:00:00 2001
From: anapnoe <124302297+anapnoe@users.noreply.github.com>
Date: Tue, 24 Sep 2024 02:43:58 +0300
Subject: [PATCH] Remove ExtraNetworks from im2img Backend
---
.../html/templates/template-about.html | 28 +++++++------------
extensions-builtin/anapnoe-sd-uiux/style.css | 1 +
modules/ui.py | 4 +--
3 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/extensions-builtin/anapnoe-sd-uiux/html/templates/template-about.html b/extensions-builtin/anapnoe-sd-uiux/html/templates/template-about.html
index 72f1b158..1066b76e 100644
--- a/extensions-builtin/anapnoe-sd-uiux/html/templates/template-about.html
+++ b/extensions-builtin/anapnoe-sd-uiux/html/templates/template-about.html
@@ -11,33 +11,25 @@
framework. These optimizations include:
+
+ - Removing redundant Checkpoints and "Extra Networks" (Textual Inversion, Lora, and Hypernetworks)
+ from img2img to reduce duplicated images and event listeners.
+ - Eradicating inline event listeners from "Extra Networks" cards and action buttons.
+ - Applying an event delegation pattern to further streamline the code by consolidating event
+ handling for "Extra Networks" cards and action buttons.
- Replacing all default Gradio stylesheets in the DOM with an optimized version that promote
better visual coherence across components.
- Eliminating inline styles and Svelte classes from the DOM to minimize clutter and improve
efficiency.
- - Removing unnecessary "img2img Extra Networks" from the DOM to reduce duplicated images and event
- listeners.
- - Eradicating inline event listeners from "txt2img Extra Networks" cards and action buttons.
- - Applying an event delegation pattern to further streamline the code by consolidating event
- handling for "txt2img Extra Networks" cards and action buttons.
- Although the current optimizations provide significant benefits, they are still applied after the
- DOM has been loaded. A more effective approach would be to eliminate these unnecessary elements
- entirely from the backend. This is an area for improvement and will be address in the future
- releases of
- Stable Diffusion web
- UI-UX.
+ The current optimizations significantly reduce DOM memory usage and improve loading speed.
+ Nevertheless, there is still potential for further enhancements, which will be explored in
+ upcoming releases of the Stable Diffusion Web UI-UX.
-
- Any extensions that replicate "Extra Network Cards" will not be officially supported.
- However, if certain extensions hold significant value for your workflow, you can initiate a discussion.
- If the community expresses interest and support for these optimizations,
- I will be willing to submit pull requests to the extension's author to implement them.
-
+ -->
diff --git a/extensions-builtin/anapnoe-sd-uiux/style.css b/extensions-builtin/anapnoe-sd-uiux/style.css
index 30be971c..efbd76e3 100644
--- a/extensions-builtin/anapnoe-sd-uiux/style.css
+++ b/extensions-builtin/anapnoe-sd-uiux/style.css
@@ -849,6 +849,7 @@ label > span + div,
padding: 0;
position: relative;
pointer-events: all;
+ flex-grow: 0;
}
*.gradio-dropdown label>span {
diff --git a/modules/ui.py b/modules/ui.py
index f48638f6..02bdfa45 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -861,8 +861,8 @@ def create_ui():
paste_button=toprow.paste, tabname="img2img", source_text_component=toprow.prompt, source_image_component=None,
))
- extra_networks_ui_img2img = ui_extra_networks.create_ui(img2img_interface, [img2img_generation_tab], 'img2img')
- ui_extra_networks.setup_ui(extra_networks_ui_img2img, output_panel.gallery)
+ #extra_networks_ui_img2img = ui_extra_networks.create_ui(img2img_interface, [img2img_generation_tab], 'img2img')
+ #ui_extra_networks.setup_ui(extra_networks_ui_img2img, output_panel.gallery)
extra_tabs.__exit__()