diff --git a/ui/index.html b/ui/index.html index 1f7ae34e..05c4e68f 100644 --- a/ui/index.html +++ b/ui/index.html @@ -277,9 +277,11 @@ and selecting the desired modifiers.

Click "Image Settings" for additional settings like seed, image size, number of images to generate etc.

Enjoy! :) +
+
diff --git a/ui/media/css/main.css b/ui/media/css/main.css index f2c91f01..46a8a971 100644 --- a/ui/media/css/main.css +++ b/ui/media/css/main.css @@ -468,6 +468,7 @@ div.img-preview img { background: var(--accent-color); border: var(--primary-button-border); color: rgb(255, 221, 255); + padding: 3pt 6pt; } .secondaryButton { background: rgb(132, 8, 0); diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 72e3901a..db913a2a 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -61,6 +61,7 @@ let promptStrengthContainer = document.querySelector('#prompt_strength_container let initialText = document.querySelector("#initial-text") let previewTools = document.querySelector("#preview-tools") let clearAllPreviewsBtn = document.querySelector("#clear-all-previews") +let saveAllImagesBtn = document.querySelector("#save-all-images") let maskSetting = document.querySelector('#enable_mask') @@ -1160,6 +1161,21 @@ clearAllPreviewsBtn.addEventListener('click', (e) => { shiftOrConfirm(e, "Clear taskEntries.forEach(removeTask) })}) +saveAllImagesBtn.addEventListener('click', (e) => { + document.querySelectorAll(".imageTaskContainer").forEach(container => { + let req = htmlTaskMap.get(container) + container.querySelectorAll(".imgContainer img").forEach(img => { + if (img.closest('.imgItem').style.display === 'none') { + // console.log('skipping hidden image', img) + return + } + + onDownloadImageClick(req, img) + // console.log(req) + }) + }) +}) + stopImageBtn.addEventListener('click', (e) => { shiftOrConfirm(e, "Stop all the tasks?", async function(e) { await stopAllTasks() })}) diff --git a/ui/media/js/utils.js b/ui/media/js/utils.js index 69801571..50f5f162 100644 --- a/ui/media/js/utils.js +++ b/ui/media/js/utils.js @@ -20,19 +20,6 @@ function getNextSibling(elem, selector) { } } -function findClosestAncestor(element, selector) { - if (!element || !element.parentNode) { - // reached the top of the DOM tree, return null - return null; - } else if (element.parentNode.matches(selector)) { - // found an ancestor that matches the selector, return it - return element.parentNode; - } else { - // continue searching upwards - return findClosestAncestor(element.parentNode, selector); - } -} - /* Panel Stuff */