Remove ExtraNetworks from im2img Backend

This commit is contained in:
anapnoe
2024-09-24 02:43:58 +03:00
parent 2787f966e5
commit c09aab0d0d
3 changed files with 13 additions and 20 deletions
@@ -11,33 +11,25 @@
framework. These optimizations include:
</p>
<ul>
<li>Removing redundant Checkpoints and "Extra Networks" (Textual Inversion, Lora, and Hypernetworks)
from img2img to reduce duplicated images and event listeners.</li>
<li>Eradicating inline event listeners from "Extra Networks" cards and action buttons.</li>
<li>Applying an event delegation pattern to further streamline the code by consolidating event
handling for "Extra Networks" cards and action buttons.</li>
<li>Replacing all default Gradio stylesheets in the DOM with an optimized version that promote
better visual coherence across components.</li>
<li>Eliminating inline styles and Svelte classes from the DOM to minimize clutter and improve
efficiency.</li>
<li>Removing unnecessary "img2img Extra Networks" from the DOM to reduce duplicated images and event
listeners.</li>
<li>Eradicating inline event listeners from "txt2img Extra Networks" cards and action buttons.</li>
<li>Applying an event delegation pattern to further streamline the code by consolidating event
handling for "txt2img Extra Networks" cards and action buttons.</li>
</ul>
<p>
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
<a href="https://github.com/anapnoe/stable-diffusion-webui-ux" target="_blank">Stable Diffusion web
UI-UX</a>.
The current optimizations significantly reduce DOM memory usage and improve loading speed.</br>
Nevertheless, there is still potential for further enhancements, which will be explored in
upcoming releases of the <a href="https://github.com/anapnoe/stable-diffusion-webui-ux" target="_blank">Stable Diffusion Web UI-UX</a>.
</p>
<!-- <br>
<img alt="Anapnoe UI-UX default theme" src="./file=extensions-builtin/anapnoe-sd-uiux/html/images/anapnoe-ui-ux.png" lazy="true"/>
-->
<p>
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.
</p>
-->
</div>
</div>
<div class="flexbox col">
@@ -849,6 +849,7 @@ label > span + div,
padding: 0;
position: relative;
pointer-events: all;
flex-grow: 0;
}
*.gradio-dropdown label>span {
+2 -2
View File
@@ -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__()