artdwn/stable-diffusion-backup
Stable Diffusion web UI A browser interface based on Gradio library for Stable Diffusion. Features Detailed feature showcase with images: Original txt2img and img2img modes One click install and run script (but you still must install python and git) Outpainting Inpainting Color Sketch Prompt Matrix Stable Diffusion Upscale Attention, specify parts of text that the model should pay more attention to a man in a ((tuxedo)) - will pay more attention to tuxedo a man… See the full description on the dataset page: https://huggingface.co/datasets/artdwn/stable-diffusion-backup.
11.1k
1// Monitors the gallery and sends a browser notification when the leading image is new.2 3let lastHeadImg = null;4 5let notificationButton = null;6 7onAfterUiUpdate(function() {8 if (notificationButton == null) {9 notificationButton = gradioApp().getElementById('request_notifications');10 11 if (notificationButton != null) {12 notificationButton.addEventListener('click', () => {13 void Notification.requestPermission();14 }, true);15 }16 }17 18 const galleryPreviews = gradioApp().querySelectorAll('div[id^="tab_"] div[id$="_results"] .thumbnail-item > img');19 20 if (galleryPreviews == null) return;21 22 const headImg = galleryPreviews[0]?.src;23 24 if (headImg == null || headImg == lastHeadImg) return;25 26 lastHeadImg = headImg;27 28 // play notification sound if available29 gradioApp().querySelector('#audio_notification audio')?.play();30 31 if (document.hasFocus()) return;32 33 // Multiple copies of the images are in the DOM when one is selected. Dedup with a Set to get the real number generated.34 const imgs = new Set(Array.from(galleryPreviews).map(img => img.src));35 36 const notification = new Notification(37 'Stable Diffusion',38 {39 body: `Generated ${imgs.size > 1 ? imgs.size - opts.return_grid : 1} image${imgs.size > 1 ? 's' : ''}`,40 icon: headImg,41 image: headImg,42 }43 );44 45 notification.onclick = function(_) {46 parent.focus();47 this.close();48 };49});50 