|
1 | 1 | # Stable Diffusion WebUI UX |
2 | | -A bespoke, highly adaptable, blazing fast user interface for Stable Diffusion, utilizing the powerful [Gradio](https://www.gradio.app/) library. This cutting-edge browser interface offers an unparalleled level of customization and optimization for users, setting it apart from other web interfaces. |
| 2 | +A bespoke, highly adaptable, blazing fast user interface for Stable Diffusion, engineered for unmatched user experience and performance. |
3 | 3 |
|
4 | | -[🌟 Your Support Makes a Difference! 🌟](https://buymeacoffee.com/dayanbayah) |
| 4 | +[💖 Your Support Makes a Difference! 💖](https://buymeacoffee.com/dayanbayah) |
5 | 5 |
|
6 | | - |
7 | | - |
8 | | -## Optimizations |
9 | | -- **Redundant Checkpoints & Extra Networks**: Removing redundant Checkpoints and "Extra Networks" (Textual Inversion, Lora, and Hypernetworks) from img2img to reduce duplicated images and event listeners. |
10 | | -- **Inline Event Listeners**: Eradicating inline event listeners from "Extra Networks" cards and action buttons. |
11 | | -- **Event Delegation Pattern**: Applying an event delegation pattern to further streamline the code by consolidating event handling for "Extra Networks" cards and action buttons. |
12 | | -- **Optimized Stylesheets**: Enhanced visual coherence by substituting all default Gradio stylesheets in the DOM with an optimized version. |
13 | | -- **Inline Styles & Svelte Classes**: Improved efficiency by eliminating unnecessary inline styles and Svelte classes. |
| 6 | + |
14 | 7 |
|
15 | 8 | ## Features Overview |
16 | 9 | - **Mobile Responsive Design**: Optimal display and usability across various devices. |
17 | 10 | - **Versatile Micro-Template Engine**: Leverage for enhanced functionality through other extensions. |
18 | 11 | - **Customizable Theme Styles**: User-friendly interface for theme customization. |
| 12 | +- **Styles Manager**: Versatile database-driven styles management. |
| 13 | +- **Image Browser**: High-performance database-powered image navigation. |
| 14 | +- **Civitai Images**: Ultra-fast virtualized browser for Civitai images. |
| 15 | +- **Civitai Models**: Ultra-fast virtualized browser for Civitai models. |
19 | 16 | - **Built-in Console Log**: Debugging capabilities for developers. |
20 | 17 | - **Production and Development Modes**: Dynamically compile the web UI UX using Vite directly from the interface. |
21 | 18 | - **Ignore Overrides Option**: Flexibility to maintain original settings when necessary. |
22 | 19 | - **Enhanced Usability for Sliders**: Input range sliders support tick marks for improved interaction. |
23 | 20 | - **Toggle Input Modes**: Switch between slider and numeric input modes for a compact interface. |
24 | 21 | - **Compatible with Gradio 3 and 4**: Works seamlessly with both Gradio 3 and Gradio 4 frameworks. |
25 | 22 |
|
26 | | -## Seamless UI Integration with Extensions |
| 23 | +### Seamless UI Integration with Extensions |
27 | 24 | - **Infinite Image Browsing Extension** |
28 | 25 | - **Deforum Extension** |
29 | 26 | - **Prompt-All-In-One Extension** |
30 | 27 | - **Aspect-Ratio-Helper Extension** |
31 | | - |
32 | | -## Todo |
33 | | -- Separate and organize CSS into individual files (in progress). |
34 | | -- Create documentation for developers on how to incorporate their components into various areas of the UI/UX. |
35 | | -- Implement fullscreen gallery functionality. |
36 | | -- Fork the Gradio project and contribute to enhancing their components. |
37 | 28 |
|
| 29 | +## Optimizations |
| 30 | +- **Redundant Checkpoints & Extra Networks**: Removed redundant Checkpoints and Extra Networks (Textual Inversion, LoRA, Hypernetworks) from txt2img/img2img tabs. → Implemented single-instance infinite scroll to progressively load optimized assets + metadata from SQLite DB. |
| 31 | +- **Inline Event Listeners**: Eradicating inline event listeners from "Extra Networks" cards and action buttons. |
| 32 | +- **Event Delegation Pattern**: Applying an event delegation pattern to further streamline the code by consolidating event handling for "Extra Networks" cards and action buttons. |
| 33 | +- **Optimized Stylesheets**: Enhanced visual coherence by substituting all default Gradio stylesheets in the DOM with an optimized version. |
| 34 | +- **Inline Styles & Svelte Classes**: Improved efficiency by eliminating unnecessary inline styles and Svelte classes. |
| 35 | +- **Database-Powered**: SQLite implementation enables rapid indexing/searching across: Extra Networks, Image Browser and Styles Manager. |
| 36 | +- **Virtualized Grid**: Dynamic virtualized grid with memory/DOM efficiency for: Checkpoints, Textual Inversions, LoRA, Hypernetworks, Image Browser, Styles Manager, Civitai Images & Models. |
38 | 37 |
|
39 | | -## Advanced Theme Style Configurator (in progress)(upcoming feature) |
40 | | -A sophisticated theme editor allowing you to personalize any aspect of the UI-UX. Tailor the visual experience of the user interface with the Advanced Theme Style configurator. |
| 38 | +### Performance Comparison: UI vs UX |
| 39 | +| Core Metrics | SD web UI | SD web UI UX | Δ (%) | Key Improvements | |
| 40 | +|-----------------|-----------:|-------------:|-----------:|:-----------------| |
| 41 | +| **JS Heap** | 96,945,380 | 55,048,600 | **-43.2%** | **Memory Efficiency**: 43% ↓ JS heap memory | |
| 42 | +| **Documents** | 109 | 134 | **+22.9%** | **Resource Management**: Optimized overhead | |
| 43 | +| **Nodes** | 53,895 | 41,542 | **-22.9%** | **DOM Efficiency**: 23% ↓ nodes despite 23% ↑ documents | |
| 44 | +| **Listeners** | 8,195 | 4,178 | **-49.0%** | **Event Handling**: 49% ↓ listeners | |
41 | 45 |
|
42 | | -[🌟 Get early access to Advanced Theme Style Configurator! 🌟](https://buymeacoffee.com/dayanbayah) |
| 46 | +| **Visual Comparison** | | |
| 47 | +|---|---| |
| 48 | +|  |  | |
| 49 | +| *Automatic1111 - Stable Diffusion web UI* | *Anapnoe - Stable Diffusion web UI UX* | |
43 | 50 |
|
44 | | - |
| 51 | +### Performance Comparison: Forge vs UX Forge |
| 52 | +| Core Metrics | SD web UI Forge | SD web UI UX Forge | Δ (%) | Key Improvements | |
| 53 | +|-----------------|-----------------:|-------------------:|------------:|:-----------------| |
| 54 | +| **JS Heap** | 56,121,196 | 45,049,884 | **-19.7%** | **Memory Efficiency**: 19% ↓ JS heap memory | |
| 55 | +| **Documents** | 21 | 111 | **+428.6%** | **Resource Management**: Optimized overhead | |
| 56 | +| **Nodes** | 46,943 | 43,651 | **-7.0%** | **DOM Efficiency**: 7% ↓ nodes despite 428% ↑ documents | |
| 57 | +| **Listeners** | 10,562 | 7,495 | **-29.0%** | **Event Handling**: 29% ↓ listeners | |
| 58 | + |
| 59 | +| **Visual Comparison** | | |
| 60 | +|---|---| |
| 61 | +|  |  | |
| 62 | +| *lllyasviel - Stable Diffusion web UI Forge* | *Anapnoe - Stable Diffusion web UI UX Forge* | |
| 63 | + |
| 64 | +⚠️ *Baseline metrics reflect measurements with **all additional webui extensions disabled** - particularly relevant for SD Forge's extensive collection - to ensure balanced comparisons; enabling these extensions raises event listeners beyond 16,000 and introduces significant test-run performance variability.* |
| 65 | + |
| 66 | + |
| 67 | +### 🚀 Scalable Event Handling & DOM Optimization |
| 68 | +SD webUI UX implements **event delegation** + **virtualized grid** for O(1) performance scaling. |
45 | 69 |
|
| 70 | +**Stable Diffusion web UI & web UI Forge Constraints**: |
| 71 | +- **DOM Bloat**: Loads all assets → 10k LoRAs create 60k+ DOM nodes (10k images + 50k+ container elements) |
| 72 | +- **Listener Overload**: ~5 listeners per asset → 50k+ listeners for 10K LoRAs |
| 73 | +- **O(n) Scaling**: Linear performance degradation ***(Checkpoints, Textual Inversions, LoRAs, Hypernetworks)*** |
46 | 74 |
|
47 | | -## Workspaces UI-UX (in progress)(upcoming feature) |
| 75 | +**Stable Diffusion web UI UX & web UI UX Forge optimized Architecture**: |
| 76 | +- **Virtualized Grid**: Renders only visible assets (~15 items in default viewport) |
| 77 | +- **Event Delegation**: Single listener handles all interactions |
| 78 | +- **DOM Recycling**: Dynamic pool manages thumbnail elements |
| 79 | + |
| 80 | +🎯 **Performance Outcome**: |
| 81 | +- Flat memory profile (≈50MB heap regardless of model assets library size) |
| 82 | +- O(1) event handling complexity |
| 83 | +- Instant scrolling with 100K+ assets |
| 84 | + |
| 85 | +## Installation |
| 86 | +- **Open the Extensions tab in SD-webui.** |
| 87 | +- **Select the Install from URL option.** |
| 88 | +- **Enter `https://github.com/anapnoe/sd-webui-ux.git`** |
| 89 | +- **Click on the Install button.** |
| 90 | +- **Wait for the installation to complete and click on Apply and restart UI.** |
| 91 | + |
| 92 | +## Todo |
| 93 | +- [ ] Separate and organize CSS into individual files (in progress). |
| 94 | +- [ ] Create documentation for component integration into UI/UX. |
| 95 | +- [ ] Automatically update the Image Browser's SQLite database when files added or removed. |
| 96 | +- [ ] Improve Civitai Models download manager. |
| 97 | +- [ ] Add virtualization for **Tree View** component. |
| 98 | +- [ ] Develop framework-specific npm packages for the UI/UX Dynamic Virtualized Grid component, supporting React, Vue, Svelte, Solid, and Qwik. |
| 99 | + |
| 100 | +## Workspaces UI-UX (in progress)(early access) |
48 | 101 | The workspaces extension empowers you to create customized views and organize them according to your unique preferences. With an intuitive drag-and-drop interface, you can design workflows that are perfectly tailored to your specific requirements, giving you ultimate control over your work environment. |
49 | 102 |
|
50 | 103 | [🌟 Get early access to Workspaces! 🌟](https://buymeacoffee.com/dayanbayah) |
51 | 104 |
|
52 | 105 |  |
53 | 106 |
|
| 107 | +## Advanced Theme Style Configurator (in progress)(upcoming) |
| 108 | +A sophisticated theme editor allowing you to personalize any aspect of the UI-UX. Tailor the visual experience of the user interface with the Advanced Theme Style configurator. |
| 109 | + |
| 110 | +[🌟 Get early access to Advanced Theme Style Configurator! 🌟](https://buymeacoffee.com/dayanbayah) |
| 111 | + |
| 112 | + |
| 113 | + |
54 | 114 |
|
55 | 115 | ## SD Features |
56 | 116 | [Detailed feature showcase with images](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features): |
|
0 commit comments