From 5c1a3d82d7a8cf9b8c7b1038a5bdb7baaa1953ae Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 26 Nov 2022 12:23:03 +0530 Subject: [PATCH 01/50] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 2038c15b..733cc66f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](Troubleshooting.md) +New! Stable Diffusion 2.0 is available in beta! + ---- ## Step 1: Download the installer @@ -28,7 +30,9 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **No Dependencies or Technical Knowledge Required**: 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! - **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features - Supports "*Text to Image*" and "*Image to Image*" +- **Stable Diffusion 2.0 support** - available in beta channel - **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder! +- **Auto scan for malicious models** - uses picklescan to prevent malicious models - **Live Preview**: See the image as the AI is drawing it - **Task Queue**: Queue up all your ideas, without waiting for the current task to finish - **In-Painting**: Specify areas of your image to paint into From f14afcd1295456982531cf58ced923b1e4149870 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 26 Nov 2022 12:44:19 +0530 Subject: [PATCH 02/50] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 733cc66f..01509a46 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](Troubleshooting.md) -New! Stable Diffusion 2.0 is available in beta! +New! Experimental support for Stable Diffusion 2.0 is available in beta! ---- @@ -30,7 +30,7 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **No Dependencies or Technical Knowledge Required**: 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! - **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features - Supports "*Text to Image*" and "*Image to Image*" -- **Stable Diffusion 2.0 support** - available in beta channel +- **Stable Diffusion 2.0 support (experimental)** - available in beta channel - **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder! - **Auto scan for malicious models** - uses picklescan to prevent malicious models - **Live Preview**: See the image as the AI is drawing it From 00276228cf05de8899424cbe2d91212737db77c4 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 28 Nov 2022 12:59:33 +0530 Subject: [PATCH 03/50] Make on_sd_start.sh executable --- scripts/on_sd_start.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/on_sd_start.sh diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh old mode 100644 new mode 100755 From e8bf3fd009e9f05c14326c8955e09306034da6c0 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 30 Nov 2022 15:51:31 +0530 Subject: [PATCH 04/50] Merge pull request #542 from patriceac/patch-1 Fix restoration of model and VAE --- ui/media/js/dnd.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index f344863b..6ca28f32 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -328,6 +328,7 @@ function getModelPath(filename, extensions) filename = filename.slice(0, filename.length - ext.length) } }) + return filename } const TASK_TEXT_MAPPING = { From 529169c4da252e7621d05b314820b01adec15de7 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 30 Nov 2022 15:53:30 +0530 Subject: [PATCH 05/50] Merge pull request #541 from patriceac/patch-2 Fix restoration of parallel output setting --- ui/media/js/dnd.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index 6ca28f32..fd6751bb 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -192,9 +192,9 @@ const TASK_MAPPING = { parse: (val) => val }, - numOutputsParallel: { name: 'Parallel Images', - setUI: (numOutputsParallel) => { - numOutputsParallelField.value = numOutputsParallel + num_outputs: { name: 'Parallel Images', + setUI: (num_outputs) => { + numOutputsParallelField.value = num_outputs }, readUI: () => parseInt(numOutputsParallelField.value), parse: (val) => val From f24d3d69af2670029021768e5683e2305ec34af0 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Wed, 7 Dec 2022 05:03:11 +0100 Subject: [PATCH 06/50] Fix download pictures (#616) Old link was broken. Apparently the "develop" branch was deleted. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01509a46..f195587f 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ New! Experimental support for Stable Diffusion 2.0 is available in beta! ## Step 1: Download the installer

- - + +

## Step 2: Run the program From 75cb052cca1cd0e198d98ea0149415091bf63cbf Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 7 Dec 2022 12:27:40 +0530 Subject: [PATCH 07/50] Paint editor - translucent mask, more brush size options --- ui/media/js/image-editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/media/js/image-editor.js b/ui/media/js/image-editor.js index 68a00a19..39d97287 100644 --- a/ui/media/js/image-editor.js +++ b/ui/media/js/image-editor.js @@ -166,11 +166,12 @@ var IMAGE_EDITOR_SECTIONS = [ name: "brush_size", title: "Brush Size", default: 48, - options: [ 16, 24, 32, 48, 64 ], + options: [ 6, 12, 16, 24, 30, 40, 48, 64 ], initElement: (element, option) => { element.parentElement.style.flex = option element.style.width = option + "px" element.style.height = option + "px" + element.style['margin-right'] = '2px' element.style["border-radius"] = (option / 2).toFixed() + "px" } }, @@ -384,6 +385,7 @@ class ImageEditor { if (this.inpainter) { this.selectOption("color", IMAGE_EDITOR_SECTIONS.find(s => s.name == "color").options.indexOf("#ffffff")) + this.selectOption("opacity", IMAGE_EDITOR_SECTIONS.find(s => s.name == "opacity").options.indexOf(0.4)) } // initialize the right-side controls From b7aac1501d82dd0b9b74da6796f28489e0dec959 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 7 Dec 2022 13:11:49 +0530 Subject: [PATCH 08/50] Don't show prompt strength when the app starts --- ui/media/js/image-editor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/media/js/image-editor.js b/ui/media/js/image-editor.js index 39d97287..459d03e2 100644 --- a/ui/media/js/image-editor.js +++ b/ui/media/js/image-editor.js @@ -680,3 +680,5 @@ document.getElementById("init_image_button_draw").addEventListener("click", () = document.getElementById("init_image_button_inpaint").addEventListener("click", () => { imageInpainter.show() }) + +img2imgUnload() // no init image when the app starts From c568bca69eea62becb2e830644046c4971a12fc5 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Sun, 11 Dec 2022 02:31:23 +0100 Subject: [PATCH 09/50] Pause button --- ui/index.html | 2 ++ ui/media/css/main.css | 14 ++++++++++++++ ui/media/js/engine.js | 17 ++++++++++------- ui/media/js/main.js | 29 +++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/ui/index.html b/ui/index.html index d0aef771..a35504b2 100644 --- a/ui/index.html +++ b/ui/index.html @@ -29,6 +29,8 @@
+ +
Stable Diffusion is starting..
diff --git a/ui/media/css/main.css b/ui/media/css/main.css index 6390a229..5090d975 100644 --- a/ui/media/css/main.css +++ b/ui/media/css/main.css @@ -1138,3 +1138,17 @@ button#save-system-settings-btn { background: var(--background-color2); border-radius: var(--scrollbar-radius); } + +body.pause { + border: solid 12px var(--accent-color); +} + +body.wait-pause { + animation: blinker 2s linear infinite; +} + +@keyframes blinker { + 0% { border: solid 12px var(--accent-color); } + 50% { border: solid 12px var(--background-color1); } + 100% { border: solid 12px var(--accent-color); } +} diff --git a/ui/media/js/engine.js b/ui/media/js/engine.js index dd34ddb1..ed5ed2d5 100644 --- a/ui/media/js/engine.js +++ b/ui/media/js/engine.js @@ -10,8 +10,8 @@ const IDLE_COOLDOWN = 2500 // ms const CONCURRENT_TASK_INTERVAL = 500 // ms - /** Connects to an endpoint and resumes connexion after reaching end of stream until all data is received. - * Allows closing the connexion while the server buffers more data. + /** Connects to an endpoint and resumes connection after reaching end of stream until all data is received. + * Allows closing the connection while the server buffers more data. */ class ChunkedStreamReader { #bufferedString = '' // Data received waiting to be read. @@ -248,7 +248,7 @@ setServerStatus('busy', 'rendering..') break default: // Unavailable - console.error('Ping received an unexpedted server status. Status: %s', serverState.status) + console.error('Ping received an unexpected server status. Status: %s', serverState.status) setServerStatus('error', serverState.status.toLowerCase()) break } @@ -264,11 +264,11 @@ function isServerAvailable() { if (typeof serverState !== 'object') { - console.error('serverState not set to a value. Connexion to server could be lost...') + console.error('serverState not set to a value. Connection to server could be lost...') return false } if (Date.now() >= serverState.time + SERVER_STATE_VALIDITY_DURATION) { - console.warn('SERVER_STATE_VALIDITY_DURATION elapsed. Connexion to server could be lost...') + console.warn('SERVER_STATE_VALIDITY_DURATION elapsed. Connection to server could be lost...') return false } switch (serverState.status) { @@ -277,7 +277,7 @@ case ServerStates.online: return true default: - console.warn('Unexpedted server status. Server could be unavailable... Status: %s', serverState.status) + console.warn('Unexpected server status. Server could be unavailable... Status: %s', serverState.status) return false } } @@ -306,7 +306,7 @@ if (await healthCheck() && isServerAvailable()) { // Force a recheck of server status before failure... continue // Continue waiting if last healthCheck confirmed the server is still alive. } - throw new Error('Connexion with server lost.') + throw new Error('Connection with server lost.') } } if (Date.now() >= serverState.time + SERVER_STATE_VALIDITY_DURATION) { @@ -437,6 +437,9 @@ * @memberof Task */ async post(url, timeout=-1) { + if (typeof pauseClient != 'undefined' && pauseClient===true) { + await resumeClient() + } if(this.status !== TaskStatus.init && this.status !== TaskStatus.pending) { throw new Error(`Task status ${this.status} is not valid for post.`) } diff --git a/ui/media/js/main.js b/ui/media/js/main.js index d16b8b88..4ac29820 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -45,6 +45,8 @@ let streamImageProgressField = document.querySelector("#stream_image_progress") let makeImageBtn = document.querySelector('#makeImage') let stopImageBtn = document.querySelector('#stopImage') +let pauseBtn = document.querySelector('#pause') +let resumeBtn = document.querySelector('#resume') let imagesContainer = document.querySelector('#current-images') let initImagePreviewContainer = document.querySelector('#init_image_preview_container') @@ -1365,6 +1367,33 @@ function linkTabContents(tab) { tab.addEventListener("click", event => selectTab(tab.id)) } +let pauseClient = false + +function resumeClient() { + if (pauseClient) { + resumeBtn.style.display = "inline" + document.body.classList.remove('wait-pause') + document.body.classList.add('pause') + } + return new Promise(resolve => { + let playbuttonclick = function () { + resumeBtn.removeEventListener("click", playbuttonclick); + resumeBtn.style.display = "none" + pauseBtn.style.display = "inline" + document.body.classList.remove('pause') + pauseClient = false + resolve("resolved"); + } + resumeBtn.addEventListener("click", playbuttonclick) + }) +} + +pauseBtn.addEventListener("click", function () { + pauseClient = true + pauseBtn.style.display="none" + document.body.classList.add('wait-pause') +}) + document.querySelectorAll(".tab").forEach(linkTabContents) window.addEventListener("beforeunload", function(e) { From 38951f55811b72f0ca7b1c2cfda643e2e6706906 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Sun, 11 Dec 2022 02:49:49 +0100 Subject: [PATCH 10/50] Pause button - check whether function is defined before calling it --- ui/media/js/engine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/media/js/engine.js b/ui/media/js/engine.js index ed5ed2d5..11d88e3b 100644 --- a/ui/media/js/engine.js +++ b/ui/media/js/engine.js @@ -437,7 +437,7 @@ * @memberof Task */ async post(url, timeout=-1) { - if (typeof pauseClient != 'undefined' && pauseClient===true) { + if (typeof pauseClient != 'undefined' && pauseClient===true && typeof resumeClient === 'function') { await resumeClient() } if(this.status !== TaskStatus.init && this.status !== TaskStatus.pending) { From bd1bc789536658891ee6a13447f4040750c9fd7e Mon Sep 17 00:00:00 2001 From: JeLuF Date: Sun, 11 Dec 2022 14:57:01 +0100 Subject: [PATCH 11/50] Use onIdle(), move pause button, quick resume without using the promise --- ui/index.html | 8 +++++--- ui/media/css/main.css | 20 +++++++++++++++++--- ui/media/js/engine.js | 3 --- ui/media/js/main.js | 23 ++++++++++++++++------- 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/ui/index.html b/ui/index.html index 4868cad3..b5c0abcc 100644 --- a/ui/index.html +++ b/ui/index.html @@ -29,8 +29,6 @@
- -
Stable Diffusion is starting..
@@ -102,7 +100,11 @@ - +
+ + + +
diff --git a/ui/media/css/main.css b/ui/media/css/main.css index 51557000..1ef7bf18 100644 --- a/ui/media/css/main.css +++ b/ui/media/css/main.css @@ -191,15 +191,29 @@ code { background: rgb(132, 8, 0); border: 2px solid rgb(122, 29, 0); color: rgb(255, 221, 255); - width: 100%; height: 30pt; border-radius: 6px; - display: none; - margin-top: 2pt; + flex-grow: 2; } #stopImage:hover { background: rgb(177, 27, 0); } + +div#render-buttons { + gap: 3px; + margin-top: 4px; + display: none; +} +button#pause { + flex-grow: 1; + background: var(--accent-color); +} +button#resume { + flex-grow: 1; + background: var(--accent-color); + display: none; +} + .flex-container { display: flex; width: 100%; diff --git a/ui/media/js/engine.js b/ui/media/js/engine.js index 33b487ba..34420e3b 100644 --- a/ui/media/js/engine.js +++ b/ui/media/js/engine.js @@ -437,9 +437,6 @@ * @memberof Task */ async post(url, timeout=-1) { - if (typeof pauseClient != 'undefined' && pauseClient===true && typeof resumeClient === 'function') { - await resumeClient() - } if(this.status !== TaskStatus.init && this.status !== TaskStatus.pending) { throw new Error(`Task status ${this.status} is not valid for post.`) } diff --git a/ui/media/js/main.js b/ui/media/js/main.js index bc32e274..acb86211 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -47,6 +47,7 @@ let makeImageBtn = document.querySelector('#makeImage') let stopImageBtn = document.querySelector('#stopImage') let pauseBtn = document.querySelector('#pause') let resumeBtn = document.querySelector('#resume') +let renderButtons = document.querySelector('#render-buttons') let imagesContainer = document.querySelector('#current-images') let initImagePreviewContainer = document.querySelector('#init_image_preview_container') @@ -477,6 +478,10 @@ function makeImage() { async function onIdle() { const serverCapacity = SD.serverCapacity + if (pauseClient===true) { + await resumeClient() + } + for (const taskEntry of getUncompletedTaskEntries()) { if (SD.activeTasks.size >= serverCapacity) { break @@ -669,7 +674,7 @@ function onTaskCompleted(task, reqBody, instance, outputContainer, stepUpdate) { return } - stopImageBtn.style.display = 'none' + renderButtons.style.display = 'none' renameMakeImageButton() if (isSoundEnabled()) { @@ -754,7 +759,7 @@ async function onTaskStart(task) { ) setStatus('request', 'fetching..') - stopImageBtn.style.display = 'block' + renderButtons.style.display = 'flex' renameMakeImageButton() previewTools.style.display = 'block' } @@ -1405,17 +1410,12 @@ let pauseClient = false function resumeClient() { if (pauseClient) { - resumeBtn.style.display = "inline" document.body.classList.remove('wait-pause') document.body.classList.add('pause') } return new Promise(resolve => { let playbuttonclick = function () { resumeBtn.removeEventListener("click", playbuttonclick); - resumeBtn.style.display = "none" - pauseBtn.style.display = "inline" - document.body.classList.remove('pause') - pauseClient = false resolve("resolved"); } resumeBtn.addEventListener("click", playbuttonclick) @@ -1425,9 +1425,18 @@ function resumeClient() { pauseBtn.addEventListener("click", function () { pauseClient = true pauseBtn.style.display="none" + resumeBtn.style.display = "inline" document.body.classList.add('wait-pause') }) +resumeBtn.addEventListener("click", function () { + pauseClient = false + resumeBtn.style.display = "none" + pauseBtn.style.display = "inline" + document.body.classList.remove('pause') + document.body.classList.remove('wait-pause') +}) + document.querySelectorAll(".tab").forEach(linkTabContents) window.addEventListener("beforeunload", function(e) { From 1f44a283b37af7f090737a5b6126e350ed217ab6 Mon Sep 17 00:00:00 2001 From: Marc-Andre Ferland Date: Mon, 12 Dec 2022 02:47:42 -0500 Subject: [PATCH 12/50] Update 'release-notes' to use loadScript --- ui/plugins/ui/release-notes.plugin.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ui/plugins/ui/release-notes.plugin.js b/ui/plugins/ui/release-notes.plugin.js index cfe2b338..5212c085 100644 --- a/ui/plugins/ui/release-notes.plugin.js +++ b/ui/plugins/ui/release-notes.plugin.js @@ -43,22 +43,22 @@ `) - const markedScript = document.createElement('script') - markedScript.src = '/media/js/marked.min.js' - - markedScript.onload = async function() { + loadScript('/media/js/marked.min.js').then(async function() { let appConfig = await fetch('/get/app_config') + if (!appConfig.ok) { + console.error('[release-notes] Failed to get app_config.') + return + } appConfig = await appConfig.json() - let updateBranch = appConfig.update_branch || 'main' + const updateBranch = appConfig.update_branch || 'main' let releaseNotes = await fetch(`https://raw.githubusercontent.com/cmdr2/stable-diffusion-ui/${updateBranch}/CHANGES.md`) - if (releaseNotes.status != 200) { + if (!releaseNotes.ok) { + console.error('[release-notes] Failed to get CHANGES.md.') return } releaseNotes = await releaseNotes.text() news.innerHTML = marked.parse(releaseNotes) - } - - document.querySelector('body').appendChild(markedScript) + }) })() \ No newline at end of file From 8e6102ad9aaa1ebcf561d603ed83a9f6e3cb05eb Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 13 Dec 2022 12:02:43 +0530 Subject: [PATCH 13/50] removeTask() --- ui/media/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 8b721ff4..ebcfcd5b 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -825,7 +825,7 @@ function createTask(task) { let question = (task['isProcessing'] ? "Stop this task?" : "Remove this task?") shiftOrConfirm(e, question, async function(e) { if (task.batchesDone <= 0 || !task.isProcessing) { - taskEntry.remove() + removeTask(taskEntry) } abortTask(task) }) From 35571eb14dd518b113757f53c416c74017547a8e Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 13 Dec 2022 11:44:20 +0530 Subject: [PATCH 14/50] Don't hang the task if something other than the renderer fails (e.g. model loading) --- ui/sd_internal/task_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/sd_internal/task_manager.py b/ui/sd_internal/task_manager.py index 434394cf..a8c5a4b2 100644 --- a/ui/sd_internal/task_manager.py +++ b/ui/sd_internal/task_manager.py @@ -372,6 +372,8 @@ def thread_render(device): session_cache.keep(task.request.session_id, TASK_TTL) except Exception as e: task.error = e + task.response = {"status": 'failed', "detail": str(task.error)} + task.buffer_queue.put(json.dumps(task.response)) print(traceback.format_exc()) continue finally: From e73a514e2994688769514d0a32f33cc04f4f4e6f Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 14 Dec 2022 16:37:45 +0530 Subject: [PATCH 15/50] Revert a recent change to task error reporting, seems unstable --- ui/sd_internal/task_manager.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/sd_internal/task_manager.py b/ui/sd_internal/task_manager.py index a8c5a4b2..434394cf 100644 --- a/ui/sd_internal/task_manager.py +++ b/ui/sd_internal/task_manager.py @@ -372,8 +372,6 @@ def thread_render(device): session_cache.keep(task.request.session_id, TASK_TTL) except Exception as e: task.error = e - task.response = {"status": 'failed', "detail": str(task.error)} - task.buffer_queue.put(json.dumps(task.response)) print(traceback.format_exc()) continue finally: From 7965318d9fb83054d524dc0458c76b419ad10fca Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 14 Dec 2022 16:49:59 +0530 Subject: [PATCH 16/50] Update task_manager.py --- ui/sd_internal/task_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/sd_internal/task_manager.py b/ui/sd_internal/task_manager.py index 434394cf..a8c5a4b2 100644 --- a/ui/sd_internal/task_manager.py +++ b/ui/sd_internal/task_manager.py @@ -372,6 +372,8 @@ def thread_render(device): session_cache.keep(task.request.session_id, TASK_TTL) except Exception as e: task.error = e + task.response = {"status": 'failed', "detail": str(task.error)} + task.buffer_queue.put(json.dumps(task.response)) print(traceback.format_exc()) continue finally: From 34c00fb77f6e76d9575537eb755d844eb1c32880 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 14 Dec 2022 16:51:30 +0530 Subject: [PATCH 17/50] Fix: errors were overwritten by the time taken in the UI --- ui/media/js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index ebcfcd5b..f21494ba 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -627,7 +627,9 @@ function onTaskCompleted(task, reqBody, instance, outputContainer, stepUpdate) { time /= 1000 if (task.batchesDone == task.batchCount) { - task.outputMsg.innerText = `Processed ${task.numOutputsTotal} images in ${time} seconds` + if (!task.outputMsg.innerText.toLowerCase().includes('error')) { + task.outputMsg.innerText = `Processed ${task.numOutputsTotal} images in ${time} seconds` + } task.progressBar.style.height = "0px" task.progressBar.style.border = "0px solid var(--background-color3)" task.progressBar.classList.remove("active") From ef7e1575bd24aafab82559b15f6efe75259aab74 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Thu, 15 Dec 2022 16:44:43 +0100 Subject: [PATCH 18/50] Linux uses .zip, not .tar.xz (Fixes #657) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f195587f..5662ad4a 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ You don't need to install or struggle with Python, Anaconda, Docker etc. The ins 2. **Extract**: - For Windows: After unzipping the file, please move the `stable-diffusion-ui` folder to your `C:` (or any drive like D:, at the top root level), e.g. `C:\stable-diffusion-ui`. This will avoid a common problem with Windows (file path length limits). - - For Linux: After extracting the .tar.xz file, please open a terminal, and go to the `stable-diffusion-ui` directory. + - For Linux: After extracting the .zip file, please open a terminal, and go to the `stable-diffusion-ui` directory. 3. **Run**: - For Windows: `Start Stable Diffusion UI.cmd` by double-clicking it. From 62553dc0fa1974ca1ac34de37ce7c5875c8c38ec Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Fri, 16 Dec 2022 01:45:58 -0800 Subject: [PATCH 19/50] Fire an event upon tab change Fire an event upon tab change. --- ui/media/js/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index f21494ba..9c69bfd0 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1380,6 +1380,7 @@ function selectTab(tab_id) { tabInfo.tab.classList.toggle("active") tabInfo.content.classList.toggle("active") } + document.dispatchEvent(new CustomEvent('tabClick', { detail: tabInfo })) } function linkTabContents(tab) { var name = tab.id.replace("tab-", "") From 341c810bbbf3c0616098b1906d21ce7ad2f647c6 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Sat, 17 Dec 2022 00:29:54 +0100 Subject: [PATCH 20/50] Fix img resize issues, add redo/undo buttons --- ui/media/css/image-editor.css | 6 +++++- ui/media/js/image-editor.js | 28 +++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/ui/media/css/image-editor.css b/ui/media/css/image-editor.css index 87c0ac4a..5fa9e7c7 100644 --- a/ui/media/css/image-editor.css +++ b/ui/media/css/image-editor.css @@ -136,6 +136,10 @@ background: var(--background-color3); } +.editor-controls-right .image-editor-button { + margin-bottom: 4px; +} + #init_image_button_inpaint .input-toggle { position: absolute; left: 16px; @@ -208,4 +212,4 @@ } .image-editor-popup h4 { text-align: left; -} \ No newline at end of file +} diff --git a/ui/media/js/image-editor.js b/ui/media/js/image-editor.js index 459d03e2..e193bd33 100644 --- a/ui/media/js/image-editor.js +++ b/ui/media/js/image-editor.js @@ -105,7 +105,26 @@ const IMAGE_EDITOR_ACTIONS = [ icon: "fa-solid fa-xmark", handler: (editor) => { editor.ctx_current.clearRect(0, 0, editor.width, editor.height) - } + }, + trackHistory: true + }, + { + id: "undo", + name: "Undo", + icon: "fa-solid fa-rotate-left", + handler: (editor) => { + editor.history.undo() + }, + trackHistory: false + }, + { + id: "redo", + name: "Redo", + icon: "fa-solid fa-rotate-right", + handler: (editor) => { + editor.history.redo() + }, + trackHistory: false } ] @@ -436,13 +455,14 @@ class ImageEditor { return } - var max_size = Math.min(parseInt(window.innerWidth * 0.9), width, 768) if (width > height) { + var max_size = Math.min(parseInt(window.innerWidth * 0.9), width, 768) var multiplier = max_size / width width = (multiplier * width).toFixed() height = (multiplier * height).toFixed() } else { + var max_size = Math.min(parseInt(window.innerHeight * 0.9), height, 768) var multiplier = max_size / height width = (multiplier * width).toFixed() height = (multiplier * height).toFixed() @@ -525,7 +545,9 @@ class ImageEditor { } runAction(action_id) { var action = IMAGE_EDITOR_ACTIONS.find(a => a.id == action_id) - this.history.pushAction(action_id) + if (action.trackHistory) { + this.history.pushAction(action_id) + } action.handler(this) } setBrush(layer = null, options = null) { From 3b01e65e11c1b3695246ed922e96e83924f11216 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Sat, 17 Dec 2022 01:30:30 +0100 Subject: [PATCH 21/50] CSS only initimg hover, 'use as input' button --- ui/media/css/main.css | 12 ++++++++++++ ui/media/js/main.js | 22 +++++----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ui/media/css/main.css b/ui/media/css/main.css index f2123cb3..f8a52a3a 100644 --- a/ui/media/css/main.css +++ b/ui/media/css/main.css @@ -1068,7 +1068,19 @@ div.task-initimg > img { } div.task-fs-initimage { display: none; +# position: absolute; +} +div.task-initimg:hover div.task-fs-initimage { + display: block; position: absolute; + z-index: 9999; + box-shadow: 0 0 30px #000; + margin-top:-64px; +} +div.top-right { + position: absolute; + top: 8px; + right: 8px; } button#save-system-settings-btn { diff --git a/ui/media/js/main.js b/ui/media/js/main.js index f21494ba..022ebc97 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -743,23 +743,11 @@ async function onTaskStart(task) { /* Hover effect for the init image in the task list */ function createInitImageHover(taskEntry) { var $tooltip = $( taskEntry.querySelector('.task-fs-initimage') ) - $( taskEntry.querySelector('div.task-initimg > img') ).on('mouseenter', function() { - var img = this, - $img = $(img), - offset = $img.offset(); - - $tooltip - .css({ - 'top': offset.top, - 'left': offset.left, - 'z-index': 99999, - 'display': 'block' - }) - .append($img.clone().css({width:"", height:""})); - }) - $tooltip.on('mouseleave', function() { - $tooltip.empty().addClass('hidden'); - }); + var img = document.createElement('img') + img.src = taskEntry.querySelector('div.task-initimg > img').src + $tooltip.append(img) + $tooltip.append(`
`) + $tooltip.find('button').on('click', (e) => { onUseAsInputClick(null,img) } ) } function createTask(task) { From c240d6932a38f1079cc6942e5e7cdbd0d2dd8e3c Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 17 Dec 2022 10:13:23 +0530 Subject: [PATCH 22/50] Update CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index ede33e88..b6974e91 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,7 @@ - Support loading models in the safetensor format, for improved safety ### Detailed changelog +* 2.4.19 - 17 Dec 2022 - Add Undo/Redo buttons in the Image Editor. Thanks @JeLuf * 2.4.19 - 10 Dec 2022 - Show init img in task list * 2.4.19 - 7 Dec 2022 - Use pre-trained hypernetworks while generating images. Thanks @C0bra5 * 2.4.19 - 6 Dec 2022 - Allow processing new tasks first. Thanks @madrang From 1cae39b1053cc62c18775d01a5a83ea84c9f840c Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Sat, 17 Dec 2022 03:05:43 -0800 Subject: [PATCH 23/50] Fire an event when a collapsible is toggled Need an event to know that a collapsible got toggled to be able to resize the panels accordingly. Thanks! --- ui/media/js/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/media/js/utils.js b/ui/media/js/utils.js index 09e1e502..50f5f162 100644 --- a/ui/media/js/utils.js +++ b/ui/media/js/utils.js @@ -45,6 +45,7 @@ function toggleCollapsible(element) { handle.innerHTML = '➖' // minus } } + document.dispatchEvent(new CustomEvent('collapsibleClick', { detail: collapsibleHeader })) if (COLLAPSIBLES_INITIALIZED && COLLAPSIBLE_PANELS.includes(element)) { saveCollapsibles() From 127949c56b7a06c6e91013d81a65661a89e33fcd Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Sat, 17 Dec 2022 17:06:07 -0800 Subject: [PATCH 24/50] Allow empty prompts (image modifiers only) Allows empty prompts as long as there are image modifiers. This allows the user to craft prompts just by using image modifiers if they so wish. --- ui/media/js/main.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index ea3968ca..af7a7fd0 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -917,20 +917,29 @@ function getPrompts(prompts) { if (typeof prompts === 'undefined') { prompts = promptField.value } - if (prompts.trim() === '') { + if (prompts.trim() === '' && activeTags.length === 0) { return [''] } - prompts = prompts.split('\n') - prompts = prompts.map(prompt => prompt.trim()) - prompts = prompts.filter(prompt => prompt !== '') - - let promptsToMake = applyPermuteOperator(prompts) - promptsToMake = applySetOperator(promptsToMake) + let promptsToMake = [] + if (prompts.trim() !== '') { + prompts = prompts.split('\n') + prompts = prompts.map(prompt => prompt.trim()) + prompts = prompts.filter(prompt => prompt !== '') + + promptsToMake = applyPermuteOperator(prompts) + promptsToMake = applySetOperator(promptsToMake) + } const newTags = activeTags.filter(tag => tag.inactive === undefined || tag.inactive === false) if (newTags.length > 0) { const promptTags = newTags.map(x => x.name).join(", ") - promptsToMake = promptsToMake.map((prompt) => `${prompt}, ${promptTags}`) + if (promptsToMake.length > 0) { + promptsToMake = promptsToMake.map((prompt) => `${prompt}, ${promptTags}`) + } + else + { + promptsToMake.push(promptTags) + } } promptsToMake = applyPermuteOperator(promptsToMake) From 22ffd256190053852965b44dc5314a7feace9216 Mon Sep 17 00:00:00 2001 From: jsuelwald Date: Sun, 18 Dec 2022 07:20:42 +0100 Subject: [PATCH 25/50] Change time display on job Change "Processed 1 image in 150.65 seconds" to "Processed 1 Image in 2 minutes 30 seconds" to be consistent with the approx. time remaining while rendering --- ui/media/js/main.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index ea3968ca..5dc5139e 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -623,19 +623,18 @@ function onTaskCompleted(task, reqBody, instance, outputContainer, stepUpdate) { task['stopTask'].innerHTML = ' Remove' task['taskStatusLabel'].style.display = 'none' - let time = Date.now() - task.startTime - time /= 1000 + let time = millisecondsToStr( Date.now() - task.startTime ) if (task.batchesDone == task.batchCount) { if (!task.outputMsg.innerText.toLowerCase().includes('error')) { - task.outputMsg.innerText = `Processed ${task.numOutputsTotal} images in ${time} seconds` + task.outputMsg.innerText = `Processed ${task.numOutputsTotal} images in ${time}` } task.progressBar.style.height = "0px" task.progressBar.style.border = "0px solid var(--background-color3)" task.progressBar.classList.remove("active") setStatus('request', 'done', 'success') } else { - task.outputMsg.innerText += `Task ended after ${time} seconds` + task.outputMsg.innerText += `Task ended after ${time}` } if (randomSeedField.checked) { From 5e56a437efc22783b1e09a5ba1e809f529713f22 Mon Sep 17 00:00:00 2001 From: SpecificKnot <110454200+SpecificKnot@users.noreply.github.com> Date: Sun, 18 Dec 2022 20:48:19 +0000 Subject: [PATCH 26/50] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5662ad4a..9d270c66 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Stable Diffusion UI -### Easiest way to install and use [Stable Diffusion](https://github.com/CompVis/stable-diffusion) on your own computer. No dependencies or technical knowledge required. 1-click install, powerful features. +### The easiest way to install and use [Stable Diffusion](https://github.com/CompVis/stable-diffusion) on your own computer. No dependencies or technical knowledge required. 1-click install, powerful features. -[![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](Troubleshooting.md) +[![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting) New! Experimental support for Stable Diffusion 2.0 is available in beta! From 70e4bc4582de8ae6253a97cfb7614e615cff465d Mon Sep 17 00:00:00 2001 From: SpecificKnot <110454200+SpecificKnot@users.noreply.github.com> Date: Sun, 18 Dec 2022 20:52:38 +0000 Subject: [PATCH 27/50] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d270c66..391cf696 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,16 @@ [![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting) -New! Experimental support for Stable Diffusion 2.0 is available in beta! +### New: +Experimental support for Stable Diffusion 2.0 is available in beta! ---- ## Step 1: Download the installer +Click the download button for your operating system:

- +

From 00ec2b9d6fd53dee5214c37bae4b0ebe1be662e7 Mon Sep 17 00:00:00 2001 From: SpecificKnot <110454200+SpecificKnot@users.noreply.github.com> Date: Sun, 18 Dec 2022 21:13:12 +0000 Subject: [PATCH 28/50] README Updates Updates to README to make it easier to follow along. --- README.md | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 391cf696..b4c2cbd4 100644 --- a/README.md +++ b/README.md @@ -8,20 +8,27 @@ Experimental support for Stable Diffusion 2.0 is available in beta! ---- -## Step 1: Download the installer +## Step 1: Download and prepare the installer Click the download button for your operating system:

- +

-## Step 2: Run the program -- On Windows: Double-click `Start Stable Diffusion UI.cmd` -- On Linux: Run `./start.sh` in a terminal +# On Windows: +1. Unzip/extract the folder `stable-diffusion-ui` which should be in your downloads folder, unless you changed your default downloads destination. +2. Move the `stable-diffusion-ui` folder to your `C:` drive (or any other drive like D:, at the top root level). `C:\stable-diffusion-ui` or `D:\stable-diffusion-ui` as examples. This will avoid a common problem with Windows (file path length limits). +# On Linux: +1. Unzip/extract the folder `stable-diffusion-ui` which should be in your downloads folder, unless you changed your default downloads destination. +2. Open a terminal window, and navigate to the `stable-diffusion-ui` directory. -## Step 3: There is no step 3! -It's simple to get started. You don't need to install or struggle with Python, Anaconda, Docker etc. +## Step 2: Run the program +# On Windows: +Double-click `Start Stable Diffusion UI.cmd`. +If Windows SmartScreen prevents you from running the program click `More info` and then `Run anyway`. +# On Linux: +Run `./start.sh` (or `bash start.sh`) in a terminal. The installer will take care of whatever is needed. A friendly [Discord community](https://discord.com/invite/u9yhsFmEkB) will help you if you face any problems. @@ -76,17 +83,6 @@ Useful for judging (and stopping) an image quickly, without waiting for it to fi You don't need to install or struggle with Python, Anaconda, Docker etc. The installer will take care of whatever is needed. -# Installation -1. **Download** [for Windows](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.4.13/stable-diffusion-ui-windows.zip) or [for Linux](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.4.13/stable-diffusion-ui-linux.zip). - -2. **Extract**: - - For Windows: After unzipping the file, please move the `stable-diffusion-ui` folder to your `C:` (or any drive like D:, at the top root level), e.g. `C:\stable-diffusion-ui`. This will avoid a common problem with Windows (file path length limits). - - For Linux: After extracting the .zip file, please open a terminal, and go to the `stable-diffusion-ui` directory. - -3. **Run**: - - For Windows: `Start Stable Diffusion UI.cmd` by double-clicking it. - - For Linux: In the terminal, run `./start.sh` (or `bash start.sh`) - This will automatically install Stable Diffusion, set it up, and start the interface. No additional steps are needed. **To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages. From d03823fb205d30bf0566234d19d048a3e1aafdbf Mon Sep 17 00:00:00 2001 From: SpecificKnot <110454200+SpecificKnot@users.noreply.github.com> Date: Sun, 18 Dec 2022 21:16:32 +0000 Subject: [PATCH 29/50] Last minute changes --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b4c2cbd4..1f346982 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Experimental support for Stable Diffusion 2.0 is available in beta! ---- -## Step 1: Download and prepare the installer +# Step 1: Download and prepare the installer Click the download button for your operating system:

@@ -16,26 +16,27 @@ Click the download button for your operating system:

-# On Windows: +## On Windows: 1. Unzip/extract the folder `stable-diffusion-ui` which should be in your downloads folder, unless you changed your default downloads destination. -2. Move the `stable-diffusion-ui` folder to your `C:` drive (or any other drive like D:, at the top root level). `C:\stable-diffusion-ui` or `D:\stable-diffusion-ui` as examples. This will avoid a common problem with Windows (file path length limits). -# On Linux: +2. Move the `stable-diffusion-ui` folder to your `C:` drive (or any other drive like `D:`, at the top root level). `C:\stable-diffusion-ui` or `D:\stable-diffusion-ui` as examples. This will avoid a common problem with Windows (file path length limits). +## On Linux: 1. Unzip/extract the folder `stable-diffusion-ui` which should be in your downloads folder, unless you changed your default downloads destination. 2. Open a terminal window, and navigate to the `stable-diffusion-ui` directory. -## Step 2: Run the program -# On Windows: +# Step 2: Run the program +## On Windows: Double-click `Start Stable Diffusion UI.cmd`. If Windows SmartScreen prevents you from running the program click `More info` and then `Run anyway`. -# On Linux: +## On Linux: Run `./start.sh` (or `bash start.sh`) in a terminal. The installer will take care of whatever is needed. A friendly [Discord community](https://discord.com/invite/u9yhsFmEkB) will help you if you face any problems. +**To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages. ---- # Easy for new users, powerful features for advanced users -### Features: +## Features: - **No Dependencies or Technical Knowledge Required**: 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! - **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features - Supports "*Text to Image*" and "*Image to Image*" @@ -62,18 +63,18 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **Low Memory Usage**: Creates 512x512 images with less than 4GB of VRAM! - **Developer Console**: A developer-mode for those who want to modify their Stable Diffusion code, and edit the conda environment. -### Easy for new users: +## Easy for new users: ![Screenshot of the initial UI](media/shot-v10-simple.jpg?raw=true) -### Powerful features for advanced users: +## Powerful features for advanced users: ![Screenshot of advanced settings](media/shot-v10.jpg?raw=true) -### Live Preview +## Live Preview Useful for judging (and stopping) an image quickly, without waiting for it to finish rendering. ![live-512](https://user-images.githubusercontent.com/844287/192097249-729a0a1e-a677-485e-9ccc-16a9e848fabe.gif) -### Task Queue +## Task Queue ![Screenshot of task queue](media/task-queue-v1.jpg?raw=true) # System Requirements @@ -85,8 +86,6 @@ You don't need to install or struggle with Python, Anaconda, Docker etc. The ins This will automatically install Stable Diffusion, set it up, and start the interface. No additional steps are needed. -**To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages. - # How to use? Please use our [guide](https://github.com/cmdr2/stable-diffusion-ui/wiki/How-to-Use) to understand how to use the features in this UI. From 8f4e03550c11126f8b8b7a7203752f547f7a737e Mon Sep 17 00:00:00 2001 From: JeLuF Date: Mon, 19 Dec 2022 00:14:57 +0100 Subject: [PATCH 30/50] Add drag handle --- ui/media/css/main.css | 9 +++++++-- ui/media/js/main.js | 16 ++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ui/media/css/main.css b/ui/media/css/main.css index f8a52a3a..0f28ab6d 100644 --- a/ui/media/css/main.css +++ b/ui/media/css/main.css @@ -265,7 +265,7 @@ img { } .preview-prompt { font-size: 13pt; - margin-bottom: 10pt; + display: inline; } #coffeeButton { height: 23px; @@ -391,14 +391,18 @@ img { .imageTaskContainer > div > .collapsible-handle { display: none; } +.drag-handle { + margin-right: 6px; + cursor: move; +} .taskStatusLabel { - float: left; font-size: 8pt; background:var(--background-color2); border: 1px solid rgb(61, 62, 66); padding: 2pt 4pt; border-radius: 2pt; margin-right: 5pt; + display: inline; } .activeTaskLabel { background:rgb(0, 90, 30); @@ -448,6 +452,7 @@ img { font-size: 10pt; color: #aaa; margin-bottom: 5pt; + margin-top: 5pt; } .img-batch { display: inline; diff --git a/ui/media/js/main.js b/ui/media/js/main.js index ea3968ca..19e37347 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -783,6 +783,7 @@ function createTask(task) { taskEntry.id = `imageTaskContainer-${Date.now()}` taskEntry.className = 'imageTaskContainer' taskEntry.innerHTML = `
+
Enqueued
@@ -796,6 +797,13 @@ function createTask(task) {
` createCollapsibles(taskEntry) + let draghandle = taskEntry.querySelector('.drag-handle') + draghandle.addEventListener('mousedown', (e) => { taskEntry.setAttribute('draggable',true)}) + draghandle.addEventListener('mouseup', (e) => { taskEntry.setAttribute('draggable',false)}) + taskEntry.addEventListener('dragend', (e) => { taskEntry.setAttribute('draggable',false)}) + taskEntry.addEventListener('dragstart', function(e) { + e.dataTransfer.setData("text/plain", taskEntry.id); + }) if (task.reqBody.init_image !== undefined) { @@ -829,11 +837,7 @@ function createTask(task) { task.isProcessing = true taskEntry = imagePreview.insertBefore(taskEntry, previewTools.nextSibling) - taskEntry.draggable = true htmlTaskMap.set(taskEntry, task) - taskEntry.addEventListener('dragstart', function(ev) { - ev.dataTransfer.setData("text/plain", ev.target.id); - }) task.previewPrompt.innerText = task.reqBody.prompt if (task.previewPrompt.innerText.trim() === '') { @@ -841,12 +845,12 @@ function createTask(task) { } // Allow prompt text to be selected. - task.previewPrompt.addEventListener("mouseover", function() { +/* task.previewPrompt.addEventListener("mouseover", function() { taskEntry.setAttribute("draggable", "false"); }); task.previewPrompt.addEventListener("mouseout", function() { taskEntry.setAttribute("draggable", "true"); - }); + }); */ } function getCurrentUserRequest() { From 39350d554b3d8e26e18bddf48529e859182c30bc Mon Sep 17 00:00:00 2001 From: JeLuF Date: Mon, 19 Dec 2022 00:32:13 +0100 Subject: [PATCH 31/50] Remove old code --- ui/media/js/main.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 19e37347..936fbf8b 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -844,13 +844,6 @@ function createTask(task) { task.previewPrompt.innerHTML = ' ' // allows the results to be collapsed } - // Allow prompt text to be selected. -/* task.previewPrompt.addEventListener("mouseover", function() { - taskEntry.setAttribute("draggable", "false"); - }); - task.previewPrompt.addEventListener("mouseout", function() { - taskEntry.setAttribute("draggable", "true"); - }); */ } function getCurrentUserRequest() { From 57efe319597c80a41e3c32b1bed252e5f3a777f1 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Mon, 19 Dec 2022 00:42:48 +0100 Subject: [PATCH 32/50] Return empty list if hostname lookup fails --- ui/server.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/server.py b/ui/server.py index 2db312de..d69b03fb 100644 --- a/ui/server.py +++ b/ui/server.py @@ -314,9 +314,15 @@ def getUIPlugins(): return plugins def getIPConfig(): - ips = socket.gethostbyname_ex(socket.gethostname()) - ips[2].append(ips[0]) - return ips[2] + try: + ips = socket.gethostbyname_ex(socket.gethostname()) + ips[2].append(ips[0]) + return ips[2] + except Exception as e: + print(e) + print(traceback.format_exc()) + return [] + @app.get('/get/{key:path}') def read_web_data(key:str=None): From 39ccbbd72edd92490a5dc04ee4eef6ec11c1f852 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 19 Dec 2022 12:09:13 +0530 Subject: [PATCH 33/50] Update README.md --- README.md | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1f346982..5cba6228 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Stable Diffusion UI -### The easiest way to install and use [Stable Diffusion](https://github.com/CompVis/stable-diffusion) on your own computer. No dependencies or technical knowledge required. 1-click install, powerful features. +### The easiest way to install and use [Stable Diffusion](https://github.com/CompVis/stable-diffusion) on your own computer. Does not require technical knowledge, does not require pre-installed software. 1-click install, powerful features, friendly community. [![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting) @@ -33,36 +33,50 @@ Run `./start.sh` (or `bash start.sh`) in a terminal. The installer will take care of whatever is needed. A friendly [Discord community](https://discord.com/invite/u9yhsFmEkB) will help you if you face any problems. **To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages. +# Step 3: There is no Step 3. It's that simple! + ---- # Easy for new users, powerful features for advanced users ## Features: -- **No Dependencies or Technical Knowledge Required**: 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! +### User experience +- **Hassle-free installation** - No Dependencies or Technical Knowledge Required. 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! - **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features + +### Image generation - Supports "*Text to Image*" and "*Image to Image*" -- **Stable Diffusion 2.0 support (experimental)** - available in beta channel -- **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder! -- **Auto scan for malicious models** - uses picklescan to prevent malicious models -- **Live Preview**: See the image as the AI is drawing it -- **Task Queue**: Queue up all your ideas, without waiting for the current task to finish - **In-Painting**: Specify areas of your image to paint into - **Face Correction (GFPGAN) and Upscaling (RealESRGAN)** -- **Image Modifiers**: A library of *modifier tags* like *"Realistic"*, *"Pencil Sketch"*, *"ArtStation"* etc. Experiment with various styles quickly. - **Loopback**: Use the output image as the input image for the next img2img task - **Negative Prompt**: Specify aspects of the image to *remove*. - **Attention/Emphasis:** () in the prompt increases the model's attention to enclosed words, and [] decreases it - **Weighted Prompts:** Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2` - **Prompt Matrix:** (in beta) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting` - **Lots of Samplers:** ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms -- **Multiple Prompts File:** Queue multiple prompts by entering one prompt per line, or by running a text file - **NSFW Setting**: A setting in the UI to control *NSFW content* - **JPEG/PNG output** -- **Save generated images to disk** + +### Advanced features +- **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder! +- **Stable Diffusion 2.0 support (experimental)** - available in beta channel +- **Use custom VAE models** +- **Use pre-trained Hypernetworks** + +### Performance and security +- **Low Memory Usage**: Creates 512x512 images with less than 4GB of GPU RAM! +- **Multi-GPU support** - automatically spreads your tasks across multiple GPUs (if available), for faster performance! +- **Auto scan for malicious models** - uses picklescan to prevent malicious models - **Use CPU setting**: If you don't have a compatible graphics card, but still want to run it on your CPU. - **Auto-updater**: Gets you the latest improvements and bug-fixes to a rapidly evolving project. -- **Low Memory Usage**: Creates 512x512 images with less than 4GB of VRAM! - **Developer Console**: A developer-mode for those who want to modify their Stable Diffusion code, and edit the conda environment. +### Usability: +- **Live Preview**: See the image as the AI is drawing it +- **Task Queue**: Queue up all your ideas, without waiting for the current task to finish. +- **Image Modifiers**: A library of *modifier tags* like *"Realistic"*, *"Pencil Sketch"*, *"ArtStation"* etc. Experiment with various styles quickly. +- **Multiple Prompts File:** Queue multiple prompts by entering one prompt per line, or by running a text file +- **Save generated images to disk** + ## Easy for new users: ![Screenshot of the initial UI](media/shot-v10-simple.jpg?raw=true) From 600482e2d78ebd0f40a68a6e137a960d9b034786 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 19 Dec 2022 12:10:15 +0530 Subject: [PATCH 34/50] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5cba6228..8370d7ca 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **Multiple Prompts File:** Queue multiple prompts by entering one prompt per line, or by running a text file - **Save generated images to disk** +*(and lots more)* + ## Easy for new users: ![Screenshot of the initial UI](media/shot-v10-simple.jpg?raw=true) From 60b181a545ce23de6eef610152e834ec477371bd Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 19 Dec 2022 12:11:01 +0530 Subject: [PATCH 35/50] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8370d7ca..8476ca7b 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,11 @@ If Windows SmartScreen prevents you from running the program click `More info` a Run `./start.sh` (or `bash start.sh`) in a terminal. The installer will take care of whatever is needed. A friendly [Discord community](https://discord.com/invite/u9yhsFmEkB) will help you if you face any problems. -**To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages. # Step 3: There is no Step 3. It's that simple! +**To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages. + ---- # Easy for new users, powerful features for advanced users From 352dcfbe305d38df1a6385acb1bcde6a16759ed4 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 19 Dec 2022 12:20:46 +0530 Subject: [PATCH 36/50] Update README.md --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8476ca7b..8eae0095 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ The installer will take care of whatever is needed. A friendly [Discord communit # Easy for new users, powerful features for advanced users ## Features: ### User experience -- **Hassle-free installation** - No Dependencies or Technical Knowledge Required. 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! +- **Hassle-free installation**: No Dependencies or Technical Knowledge Required. 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! - **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features ### Image generation @@ -50,24 +50,26 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **Face Correction (GFPGAN) and Upscaling (RealESRGAN)** - **Loopback**: Use the output image as the input image for the next img2img task - **Negative Prompt**: Specify aspects of the image to *remove*. -- **Attention/Emphasis:** () in the prompt increases the model's attention to enclosed words, and [] decreases it -- **Weighted Prompts:** Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2` -- **Prompt Matrix:** (in beta) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting` +- **Attention/Emphasis**: () in the prompt increases the model's attention to enclosed words, and [] decreases it +- **Weighted Prompts**: Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2` +- **Prompt Matrix**: (in beta) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting` - **Lots of Samplers:** ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms - **NSFW Setting**: A setting in the UI to control *NSFW content* - **JPEG/PNG output** ### Advanced features - **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder! -- **Stable Diffusion 2.0 support (experimental)** - available in beta channel +- **Stable Diffusion 2.0 support (experimental)**: available in beta channel - **Use custom VAE models** - **Use pre-trained Hypernetworks** +- **UI Plugins**: Choose from a growing list of [community-generated UI plugins](https://github.com/cmdr2/stable-diffusion-ui/wiki/UI-Plugins), or write your own plugin to add features to the project! ### Performance and security - **Low Memory Usage**: Creates 512x512 images with less than 4GB of GPU RAM! -- **Multi-GPU support** - automatically spreads your tasks across multiple GPUs (if available), for faster performance! -- **Auto scan for malicious models** - uses picklescan to prevent malicious models - **Use CPU setting**: If you don't have a compatible graphics card, but still want to run it on your CPU. +- **Multi-GPU support**: automatically spreads your tasks across multiple GPUs (if available), for faster performance! +- **Auto scan for malicious models**: uses picklescan to prevent malicious models +- **Safetensors support**: Support loading models in the safetensor format, for improved safety - **Auto-updater**: Gets you the latest improvements and bug-fixes to a rapidly evolving project. - **Developer Console**: A developer-mode for those who want to modify their Stable Diffusion code, and edit the conda environment. @@ -77,6 +79,7 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **Image Modifiers**: A library of *modifier tags* like *"Realistic"*, *"Pencil Sketch"*, *"ArtStation"* etc. Experiment with various styles quickly. - **Multiple Prompts File:** Queue multiple prompts by entering one prompt per line, or by running a text file - **Save generated images to disk** +- **UI Themes** *(and lots more)* From 3007f00c9bb60f49371d54a6a5bf511189074208 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 19 Dec 2022 12:22:27 +0530 Subject: [PATCH 37/50] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8eae0095..e2bb4d87 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ The installer will take care of whatever is needed. A friendly [Discord communit ### Image generation - Supports "*Text to Image*" and "*Image to Image*" - **In-Painting**: Specify areas of your image to paint into +- **Simple Drawing Tool**: Draw basic images to guide the AI, without needing an external drawing program - **Face Correction (GFPGAN) and Upscaling (RealESRGAN)** - **Loopback**: Use the output image as the input image for the next img2img task - **Negative Prompt**: Specify aspects of the image to *remove*. From 9bbb25f16c478865185f651faaa949ca785daa92 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 19 Dec 2022 12:23:32 +0530 Subject: [PATCH 38/50] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e2bb4d87..a58c3713 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **Weighted Prompts**: Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2` - **Prompt Matrix**: (in beta) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting` - **Lots of Samplers:** ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms +- **1-click Upscale/Face Correction**: Upscale or correct an image after it has been generated +- **Make Similar Images**: Click to generate multiple variations of a generated image - **NSFW Setting**: A setting in the UI to control *NSFW content* - **JPEG/PNG output** From af090cb289cde8c4848dc574fa82d63a9ffbd1fb Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 19 Dec 2022 12:24:19 +0530 Subject: [PATCH 39/50] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a58c3713..e8446c76 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **JPEG/PNG output** ### Advanced features -- **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder! +- **Custom Models**: Use your own `.ckpt` or `.safetensors` file, by placing it inside the `models/stable-diffusion` folder! - **Stable Diffusion 2.0 support (experimental)**: available in beta channel - **Use custom VAE models** - **Use pre-trained Hypernetworks** From 27b8e173e8fd315c5ced5162ba4cf82cdc5dd589 Mon Sep 17 00:00:00 2001 From: SpecificKnot <110454200+SpecificKnot@users.noreply.github.com> Date: Mon, 19 Dec 2022 14:28:05 +0000 Subject: [PATCH 40/50] Changes to Front Docs --- CONTRIBUTING.md | 2 +- README.md | 68 ++++++++++++++++++++++++++-------------------- Troubleshooting.md | 1 - 3 files changed, 39 insertions(+), 32 deletions(-) delete mode 100644 Troubleshooting.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 229df851..02ce6fc6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Thanks # For developers: -If you would like to contribute to this project, there is a discord for dicussion: +If you would like to contribute to this project, there is a discord for discussion: [![Discord Server](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.com/invite/u9yhsFmEkB) ## Development environment for UI (frontend and server) changes diff --git a/README.md b/README.md index e8446c76..77ed3edd 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ If Windows SmartScreen prevents you from running the program click `More info` a ## On Linux: Run `./start.sh` (or `bash start.sh`) in a terminal. -The installer will take care of whatever is needed. A friendly [Discord community](https://discord.com/invite/u9yhsFmEkB) will help you if you face any problems. +The installer will take care of whatever is needed. If you face any problems, join the [Discord](https://discord.com/invite/u9yhsFmEkB) and ask fo assistance. # Step 3: There is no Step 3. It's that simple! @@ -40,29 +40,31 @@ The installer will take care of whatever is needed. A friendly [Discord communit # Easy for new users, powerful features for advanced users ## Features: + ### User experience -- **Hassle-free installation**: No Dependencies or Technical Knowledge Required. 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! -- **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features +- **Hassle-free installation**: No Dependencies such as Docker or Conda or Technical Knowledge is required. Just download and run! +- **Clutter-free UI**: A friendly and simple UI, while providing a lot of powerful features. ### Image generation -- Supports "*Text to Image*" and "*Image to Image*" -- **In-Painting**: Specify areas of your image to paint into -- **Simple Drawing Tool**: Draw basic images to guide the AI, without needing an external drawing program -- **Face Correction (GFPGAN) and Upscaling (RealESRGAN)** -- **Loopback**: Use the output image as the input image for the next img2img task +- **Supports**: "*Text to Image*" and "*Image to Image*". +- **In-Painting**: Specify areas of your image to paint into. +- **Simple Drawing Tool**: Draw basic images to guide the AI, without needing an external drawing program. +- **Face Correction (GFPGAN)** +- **Upscaling (RealESRGAN)** +- **Loopback**: Use the output image as the input image for the next img2img task. - **Negative Prompt**: Specify aspects of the image to *remove*. -- **Attention/Emphasis**: () in the prompt increases the model's attention to enclosed words, and [] decreases it -- **Weighted Prompts**: Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2` -- **Prompt Matrix**: (in beta) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting` -- **Lots of Samplers:** ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms -- **1-click Upscale/Face Correction**: Upscale or correct an image after it has been generated -- **Make Similar Images**: Click to generate multiple variations of a generated image -- **NSFW Setting**: A setting in the UI to control *NSFW content* -- **JPEG/PNG output** +- **Attention/Emphasis**: () in the prompt increases the model's attention to enclosed words, and [] decreases it. +- **Weighted Prompts**: Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2`. +- **Prompt Matrix**: (beta only) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting`. +- **Lots of Samplers**: ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms. +- **1-click Upscale/Face Correction**: Upscale or correct an image after it has been generated. +- **Make Similar Images**: Click to generate multiple variations of a generated image. +- **NSFW Setting**: A setting in the UI to control *NSFW content*. +- **JPEG/PNG output**: Multiple file formats. ### Advanced features - **Custom Models**: Use your own `.ckpt` or `.safetensors` file, by placing it inside the `models/stable-diffusion` folder! -- **Stable Diffusion 2.0 support (experimental)**: available in beta channel +- **Stable Diffusion 2.0 support (experimental)**: available in beta channel. - **Use custom VAE models** - **Use pre-trained Hypernetworks** - **UI Plugins**: Choose from a growing list of [community-generated UI plugins](https://github.com/cmdr2/stable-diffusion-ui/wiki/UI-Plugins), or write your own plugin to add features to the project! @@ -70,21 +72,23 @@ The installer will take care of whatever is needed. A friendly [Discord communit ### Performance and security - **Low Memory Usage**: Creates 512x512 images with less than 4GB of GPU RAM! - **Use CPU setting**: If you don't have a compatible graphics card, but still want to run it on your CPU. -- **Multi-GPU support**: automatically spreads your tasks across multiple GPUs (if available), for faster performance! -- **Auto scan for malicious models**: uses picklescan to prevent malicious models -- **Safetensors support**: Support loading models in the safetensor format, for improved safety +- **Multi-GPU support**: Automatically spreads your tasks across multiple GPUs (if available), for faster performance! +- **Auto scan for malicious models**: Uses picklescan to prevent malicious models. +- **Safetensors support**: Support loading models in the safetensor format, for improved safety. - **Auto-updater**: Gets you the latest improvements and bug-fixes to a rapidly evolving project. - **Developer Console**: A developer-mode for those who want to modify their Stable Diffusion code, and edit the conda environment. ### Usability: -- **Live Preview**: See the image as the AI is drawing it +- **Live Preview**: See the image as the AI is drawing it. - **Task Queue**: Queue up all your ideas, without waiting for the current task to finish. - **Image Modifiers**: A library of *modifier tags* like *"Realistic"*, *"Pencil Sketch"*, *"ArtStation"* etc. Experiment with various styles quickly. -- **Multiple Prompts File:** Queue multiple prompts by entering one prompt per line, or by running a text file -- **Save generated images to disk** -- **UI Themes** +- **Multiple Prompts File**: Queue multiple prompts by entering one prompt per line, or by running a text file. +- **Save generated images to disk**: Save your images to your PC! +- **UI Themes**: Customize the program to your liking. -*(and lots more)* +**(and a lot more)** + +---- ## Easy for new users: ![Screenshot of the initial UI](media/shot-v10-simple.jpg?raw=true) @@ -105,12 +109,10 @@ Useful for judging (and stopping) an image quickly, without waiting for it to fi 2. An NVIDIA graphics card, preferably with 4GB or more of VRAM. If you don't have a compatible graphics card, it'll automatically run in the slower "CPU Mode". 3. Minimum 8 GB of RAM and 25GB of disk space. -You don't need to install or struggle with Python, Anaconda, Docker etc. The installer will take care of whatever is needed. - -This will automatically install Stable Diffusion, set it up, and start the interface. No additional steps are needed. +---- # How to use? -Please use our [guide](https://github.com/cmdr2/stable-diffusion-ui/wiki/How-to-Use) to understand how to use the features in this UI. +Please refer to our [guide](https://github.com/cmdr2/stable-diffusion-ui/wiki/How-to-Use) to understand how to use the features in this UI. # Bugs reports and code contributions welcome If there are any problems or suggestions, please feel free to ask on the [discord server](https://discord.com/invite/u9yhsFmEkB) or [file an issue](https://github.com/cmdr2/stable-diffusion-ui/issues). @@ -126,4 +128,10 @@ If you have any code contributions in mind, please feel free to say Hi to us on # Disclaimer The authors of this project are not responsible for any content generated using this interface. -The license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation, or target vulnerable groups. For the full list of restrictions please read [the license](LICENSE). You agree to these terms by using this software. +The license of this software forbids you from: +- Sharing any content that violates any laws. +- Producing any harm to a person. +- Disseminating (spreading) any personal information that would be meant for harm. +- Spreading misinformation, or target vulnerable groups. + +For the full list of restrictions please read [the License](LICENSE). You agree to these terms by using this software. \ No newline at end of file diff --git a/Troubleshooting.md b/Troubleshooting.md deleted file mode 100644 index f190de20..00000000 --- a/Troubleshooting.md +++ /dev/null @@ -1 +0,0 @@ -Moved to https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting From e1875c872c615421b2ca9647d117e7e61a2d33d6 Mon Sep 17 00:00:00 2001 From: AssassinJN Date: Mon, 19 Dec 2022 13:44:15 -0500 Subject: [PATCH 41/50] classes for drag and drop Added classes for drag and drop. --- ui/media/css/main.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui/media/css/main.css b/ui/media/css/main.css index 1c624934..cef6f669 100644 --- a/ui/media/css/main.css +++ b/ui/media/css/main.css @@ -405,6 +405,22 @@ img { .imageTaskContainer > div > .collapsible-handle { display: none; } +.dropTargetBefore::before{ + content: ""; + border: 1px solid #fff; + margin-bottom: -2px; + display: block; + box-shadow: 0 0 5px #fff; + transform: translate(0px, -14px); +} +.dropTargetAfter::after{ + content: ""; + border: 1px solid #fff; + margin-bottom: -2px; + display: block; + box-shadow: 0 0 5px #fff; + transform: translate(0px, 14px); +} .drag-handle { margin-right: 6px; cursor: move; From 54f9e9bfe9baf15aca64b605ac9b7fc4e1b97c96 Mon Sep 17 00:00:00 2001 From: AssassinJN Date: Mon, 19 Dec 2022 13:45:42 -0500 Subject: [PATCH 42/50] adding drag and drop styles Add functions required for adding styles to imageTaskContainer to show where images will be dropped. --- ui/media/js/main.js | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 7cb2d73c..09204624 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -104,6 +104,31 @@ imagePreview.addEventListener('drop', function(ev) { } }) +let startX, startY; +imagePreview.addEventListener("dragover", (event) => { + imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => { + if(itc != event.target.closest(".imageTaskContainer")){ + itc.classList.remove('dropTargetBefore','dropTargetAfter'); + } + }); + if(event.target.closest(".imageTaskContainer")){ + if(startX && startY){ + console.log('x: '+startX+" : "+event.target.closest(".imageTaskContainer").offsetLeft); + console.log('y: '+startY+" : "+event.target.closest(".imageTaskContainer").offsetTop); + if(event.target.closest(".imageTaskContainer").offsetTop > startY){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetAfter'); + }else if(event.target.closest(".imageTaskContainer").offsetTop < startY){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetBefore'); + }else if (event.target.closest(".imageTaskContainer").offsetLeft > startX){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetAfter'); + }else if (event.target.closest(".imageTaskContainer").offsetLeft < startX){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetBefore'); + } + } + } +}); + + let showConfigToggle = document.querySelector('#configToggleBtn') // let configBox = document.querySelector('#config') // let outputMsg = document.querySelector('#outputMsg') @@ -803,12 +828,20 @@ function createTask(task) { ` createCollapsibles(taskEntry) + let draghandle = taskEntry.querySelector('.drag-handle') draghandle.addEventListener('mousedown', (e) => { taskEntry.setAttribute('draggable',true)}) draghandle.addEventListener('mouseup', (e) => { taskEntry.setAttribute('draggable',false)}) - taskEntry.addEventListener('dragend', (e) => { taskEntry.setAttribute('draggable',false)}) + taskEntry.addEventListener('dragend', (e) => { + taskEntry.setAttribute('draggable',false); + imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => { + itc.classList.remove('dropTargetBefore','dropTargetAfter'); + }); + }) taskEntry.addEventListener('dragstart', function(e) { e.dataTransfer.setData("text/plain", taskEntry.id); + startX = e.target.closest(".imageTaskContainer").offsetLeft; + startY = e.target.closest(".imageTaskContainer").offsetTop; }) From e47e54de3f513baca312cea993c6f4205a4df905 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Mon, 19 Dec 2022 20:34:06 +0100 Subject: [PATCH 43/50] Only activate the dragOver event listener when dragging tasks --- ui/media/js/main.js | 47 +++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 09204624..e903632b 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -104,29 +104,6 @@ imagePreview.addEventListener('drop', function(ev) { } }) -let startX, startY; -imagePreview.addEventListener("dragover", (event) => { - imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => { - if(itc != event.target.closest(".imageTaskContainer")){ - itc.classList.remove('dropTargetBefore','dropTargetAfter'); - } - }); - if(event.target.closest(".imageTaskContainer")){ - if(startX && startY){ - console.log('x: '+startX+" : "+event.target.closest(".imageTaskContainer").offsetLeft); - console.log('y: '+startY+" : "+event.target.closest(".imageTaskContainer").offsetTop); - if(event.target.closest(".imageTaskContainer").offsetTop > startY){ - event.target.closest(".imageTaskContainer").classList.add('dropTargetAfter'); - }else if(event.target.closest(".imageTaskContainer").offsetTop < startY){ - event.target.closest(".imageTaskContainer").classList.add('dropTargetBefore'); - }else if (event.target.closest(".imageTaskContainer").offsetLeft > startX){ - event.target.closest(".imageTaskContainer").classList.add('dropTargetAfter'); - }else if (event.target.closest(".imageTaskContainer").offsetLeft < startX){ - event.target.closest(".imageTaskContainer").classList.add('dropTargetBefore'); - } - } - } -}); let showConfigToggle = document.querySelector('#configToggleBtn') @@ -781,6 +758,28 @@ function createInitImageHover(taskEntry) { $tooltip.find('button').on('click', (e) => { onUseAsInputClick(null,img) } ) } +let startX, startY; +function onTaskEntryDragOver(event) { + imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => { + if(itc != event.target.closest(".imageTaskContainer")){ + itc.classList.remove('dropTargetBefore','dropTargetAfter'); + } + }); + if(event.target.closest(".imageTaskContainer")){ + if(startX && startY){ + if(event.target.closest(".imageTaskContainer").offsetTop > startY){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetAfter'); + }else if(event.target.closest(".imageTaskContainer").offsetTop < startY){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetBefore'); + }else if (event.target.closest(".imageTaskContainer").offsetLeft > startX){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetAfter'); + }else if (event.target.closest(".imageTaskContainer").offsetLeft < startX){ + event.target.closest(".imageTaskContainer").classList.add('dropTargetBefore'); + } + } + } +} + function createTask(task) { let taskConfig = '' @@ -837,8 +836,10 @@ function createTask(task) { imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => { itc.classList.remove('dropTargetBefore','dropTargetAfter'); }); + imagePreview.removeEventListener("dragover", onTaskEntryDragOver ); }) taskEntry.addEventListener('dragstart', function(e) { + imagePreview.addEventListener("dragover", onTaskEntryDragOver ); e.dataTransfer.setData("text/plain", taskEntry.id); startX = e.target.closest(".imageTaskContainer").offsetLeft; startY = e.target.closest(".imageTaskContainer").offsetTop; From 6036ccdc1cdca3dc6aa52f425f6d9694d22e87a6 Mon Sep 17 00:00:00 2001 From: SpecificKnot <110454200+SpecificKnot@users.noreply.github.com> Date: Tue, 20 Dec 2022 12:44:48 +0000 Subject: [PATCH 44/50] Style Adjustments Made a few adjustments to fit the needs of the project for new users. --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 77ed3edd..3ea38f3a 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ If Windows SmartScreen prevents you from running the program click `More info` a ## On Linux: Run `./start.sh` (or `bash start.sh`) in a terminal. -The installer will take care of whatever is needed. If you face any problems, join the [Discord](https://discord.com/invite/u9yhsFmEkB) and ask fo assistance. +The installer will take care of whatever is needed. If you face any problems, you can join the friendly [Discord community](https://discord.com/invite/u9yhsFmEkB) and ask for assistance. # Step 3: There is no Step 3. It's that simple! @@ -42,7 +42,7 @@ The installer will take care of whatever is needed. If you face any problems, jo ## Features: ### User experience -- **Hassle-free installation**: No Dependencies such as Docker or Conda or Technical Knowledge is required. Just download and run! +- **Hassle-free installation**: Does not require technical knowledge, does not require pre-installed software. Just download and run! - **Clutter-free UI**: A friendly and simple UI, while providing a lot of powerful features. ### Image generation @@ -109,6 +109,8 @@ Useful for judging (and stopping) an image quickly, without waiting for it to fi 2. An NVIDIA graphics card, preferably with 4GB or more of VRAM. If you don't have a compatible graphics card, it'll automatically run in the slower "CPU Mode". 3. Minimum 8 GB of RAM and 25GB of disk space. +You don't need to install or struggle with Python, Anaconda, Docker etc. The installer will take care of whatever is needed. + ---- # How to use? @@ -128,10 +130,11 @@ If you have any code contributions in mind, please feel free to say Hi to us on # Disclaimer The authors of this project are not responsible for any content generated using this interface. -The license of this software forbids you from: -- Sharing any content that violates any laws. -- Producing any harm to a person. -- Disseminating (spreading) any personal information that would be meant for harm. -- Spreading misinformation, or target vulnerable groups. +The license of this software forbids you from sharing any content that: +- Violates any laws. +- Produces any harm to a person or persons. +- Disseminates (spreads) any personal information that would be meant for harm. +- Spreads misinformation. +- Target vulnerable groups. For the full list of restrictions please read [the License](LICENSE). You agree to these terms by using this software. \ No newline at end of file From 4d7f6e42364ff497cc285a10c24bca76974acbdb Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 22 Dec 2022 10:32:40 +0530 Subject: [PATCH 45/50] Change version number in beta --- ui/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/index.html b/ui/index.html index 83ee96a6..d9b469da 100644 --- a/ui/index.html +++ b/ui/index.html @@ -25,7 +25,7 @@
From babdb5b7186ef733d6636afdc59dbe9e0f648681 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 22 Dec 2022 12:26:32 +0530 Subject: [PATCH 46/50] Prompt Matrix is in main --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ea38f3a..0115e43a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ The installer will take care of whatever is needed. If you face any problems, yo - **Negative Prompt**: Specify aspects of the image to *remove*. - **Attention/Emphasis**: () in the prompt increases the model's attention to enclosed words, and [] decreases it. - **Weighted Prompts**: Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2`. -- **Prompt Matrix**: (beta only) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting`. +- **Prompt Matrix**: Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting`. - **Lots of Samplers**: ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms. - **1-click Upscale/Face Correction**: Upscale or correct an image after it has been generated. - **Make Similar Images**: Click to generate multiple variations of a generated image. @@ -137,4 +137,4 @@ The license of this software forbids you from sharing any content that: - Spreads misinformation. - Target vulnerable groups. -For the full list of restrictions please read [the License](LICENSE). You agree to these terms by using this software. \ No newline at end of file +For the full list of restrictions please read [the License](LICENSE). You agree to these terms by using this software. From 0cd0d6aadf91bee8d1865c4da5567af72b596d95 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 22 Dec 2022 13:25:57 +0530 Subject: [PATCH 47/50] Update CHANGES.md --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b6974e91..21ed4500 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,9 @@ - Support loading models in the safetensor format, for improved safety ### Detailed changelog +* 2.4.20 - 22 Dec 2022 - `Pause All` button to pause all the pending tasks. Thanks @JeLuf +* 2.4.20 - 22 Dec 2022 - `Undo`/`Redo` buttons in the image editor. Thanks @JeLuf +* 2.4.20 - 22 Dec 2022 - Drag handle to reorder the tasks. This fixed a bug where the metadata was no longer selectable (for copying). Thanks @JeLuf * 2.4.19 - 17 Dec 2022 - Add Undo/Redo buttons in the Image Editor. Thanks @JeLuf * 2.4.19 - 10 Dec 2022 - Show init img in task list * 2.4.19 - 7 Dec 2022 - Use pre-trained hypernetworks while generating images. Thanks @C0bra5 From 6e07b2354f263a7138ecda26552d7354f082bbf2 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 22 Dec 2022 13:42:47 +0530 Subject: [PATCH 48/50] Fix an unnecessary error when a task header is clicked --- ui/media/js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index e903632b..95b93ce4 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -635,9 +635,9 @@ function onTaskCompleted(task, reqBody, instance, outputContainer, stepUpdate) { let time = millisecondsToStr( Date.now() - task.startTime ) if (task.batchesDone == task.batchCount) { - if (!task.outputMsg.innerText.toLowerCase().includes('error')) { + if (!task.outputMsg.innerText.toLowerCase().includes('error')) { task.outputMsg.innerText = `Processed ${task.numOutputsTotal} images in ${time}` - } + } task.progressBar.style.height = "0px" task.progressBar.style.border = "0px solid var(--background-color3)" task.progressBar.classList.remove("active") @@ -817,7 +817,7 @@ function createTask(task) {
Enqueued
-
+
${taskConfig}
From 21394b7d45e1d8a480ed709b17db2869280b1048 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 22 Dec 2022 15:22:25 +0530 Subject: [PATCH 49/50] Reduce the delay between clicking 'Make Image' and making the render call to the server. Was nearly 4-5 seconds, now it's about 250-300ms. This is a hacky workaround until a better solution is found --- ui/media/js/engine.js | 10 ++++++---- ui/media/js/main.js | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/media/js/engine.js b/ui/media/js/engine.js index 934ade4d..95725dfc 100644 --- a/ui/media/js/engine.js +++ b/ui/media/js/engine.js @@ -8,7 +8,7 @@ const SERVER_STATE_VALIDITY_DURATION = 90 * 1000 // ms - 90 seconds to allow ping to timeout more than once before killing tasks. const HEALTH_PING_INTERVAL = 5000 // ms const IDLE_COOLDOWN = 2500 // ms - const CONCURRENT_TASK_INTERVAL = 500 // ms + const CONCURRENT_TASK_INTERVAL = 100 // ms /** Connects to an endpoint and resumes connection after reaching end of stream until all data is received. * Allows closing the connection while the server buffers more data. @@ -839,6 +839,8 @@ * @memberof Task */ async post(timeout=-1) { + performance.mark('make-render-request') + console.log('delay between clicking and making the server request:', performance.measure('diff', 'click-makeImage', 'make-render-request').duration + ' ms') let jsonResponse = await super.post('/render', timeout) if (typeof jsonResponse?.task !== 'number') { console.warn('Endpoint error response: ', jsonResponse) @@ -1106,9 +1108,9 @@ idleEventPromise = makeQuerablePromise(eventSource.fireEvent(EVENT_IDLE, {capacity: serverCapacity, idle: true})) } // Calling idle could result in task being added to queue. - if (task_queue.size <= 0 && concurrent_generators.size <= 0) { - return asyncDelay(IDLE_COOLDOWN).then(() => idleEventPromise) - } + // if (task_queue.size <= 0 && concurrent_generators.size <= 0) { + // return asyncDelay(IDLE_COOLDOWN).then(() => idleEventPromise) + // } } if (task_queue.size < serverCapacity) { if (!idleEventPromise?.isPending) { diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 95b93ce4..5fd34844 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -429,6 +429,7 @@ function getUncompletedTaskEntries() { } function makeImage() { + performance.mark('click-makeImage') if (!SD.isServerAvailable()) { alert('The server is not available.') return From 5cb24f992cb6bddbc79c7d795b6b4d7b7b80b86b Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 22 Dec 2022 15:23:07 +0530 Subject: [PATCH 50/50] Bump version --- ui/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/index.html b/ui/index.html index d9b469da..89ece0b6 100644 --- a/ui/index.html +++ b/ui/index.html @@ -25,7 +25,7 @@