From 55049ba9d23c8d1abe0002e235f914c33443f30d Mon Sep 17 00:00:00 2001 From: Marc-Andre Ferland Date: Sat, 24 Dec 2022 04:42:43 -0500 Subject: [PATCH 1/4] Add a debounce delay to allow mobile to bouble tap. --- ui/media/js/main.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 5fd34844..2f46d1a1 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -828,12 +828,17 @@ 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); + draghandle.addEventListener('mousedown', (e) => { + taskEntry.setAttribute('draggable', true) + }) + // Add a debounce delay to allow mobile to bouble tap. + draghandle.addEventListener('mouseup', debounce((e) => { + taskEntry.setAttribute('draggable', false) + }, 2000)) + taskEntry.addEventListener('dragend', (e) => { + taskEntry.setAttribute('draggable', false); imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => { itc.classList.remove('dropTargetBefore','dropTargetAfter'); }); @@ -846,7 +851,6 @@ function createTask(task) { startY = e.target.closest(".imageTaskContainer").offsetTop; }) - if (task.reqBody.init_image !== undefined) { createInitImageHover(taskEntry) } From 04d67a24b6f8e001820e4d61d3300b77157f7cfb Mon Sep 17 00:00:00 2001 From: Marc-Andre Ferland Date: Sat, 24 Dec 2022 04:55:28 -0500 Subject: [PATCH 2/4] Don't allow the results to be collapsed when clicking draghandle --- ui/media/js/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 2f46d1a1..b518c8c1 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -837,6 +837,9 @@ function createTask(task) { draghandle.addEventListener('mouseup', debounce((e) => { taskEntry.setAttribute('draggable', false) }, 2000)) + draghandle.addEventListener('click', (e) => { + e.preventDefault() // Don't allow the results to be collapsed... + }) taskEntry.addEventListener('dragend', (e) => { taskEntry.setAttribute('draggable', false); imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => { From daec5e542604a06802d248107378d54dc6cc6cfc Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 24 Dec 2022 22:17:16 +0530 Subject: [PATCH 3/4] Changes to allow rolling back from the upcoming sdkit-based system --- scripts/on_sd_start.bat | 13 +++++++++++++ scripts/on_sd_start.sh | 9 +++++++++ ui/index.html | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 2bcf56d2..22e5d714 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -101,6 +101,19 @@ if NOT DEFINED test_sd2 set test_sd2=N @echo conda_sd_env_created >> ..\scripts\install_status.txt ) +@rem allow rolling back the sdkit-based changes +if exist "src-old" ( + if not exist "src" ( + rename "src-old" "src" + + if exist "ldm-old" ( + rd /s /q "ldm-old" + ) + + call pip uninstall -y sdkit stable-diffusion-sdkit + ) +) + set PATH=C:\Windows\System32;%PATH% @>nul findstr /m "conda_sd_gfpgan_deps_installed" ..\scripts\install_status.txt diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index 8682c5cc..353a315e 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -87,6 +87,15 @@ else echo conda_sd_env_created >> ../scripts/install_status.txt fi +# allow rolling back the sdkit-based changes +if [ -e "src-old" ] && [ ! -e "src" ]; then + mv src-old src + + if [ -e "ldm-old" ]; then rm -r ldm-old; fi + + pip uninstall -y sdkit stable-diffusion-sdkit +fi + if [ `grep -c conda_sd_gfpgan_deps_installed ../scripts/install_status.txt` -gt "0" ]; then echo "Packages necessary for GFPGAN (Face Correction) were already installed" else diff --git a/ui/index.html b/ui/index.html index 0eea18cc..46f367d5 100644 --- a/ui/index.html +++ b/ui/index.html @@ -25,7 +25,7 @@
From 9a975321db098857a604e4405383ead49a49ae57 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 24 Dec 2022 23:11:13 +0530 Subject: [PATCH 4/4] v2.5 changelog --- CHANGES.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 324bf261..c0a3877c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,22 @@ # What's new? +## v2.5 +### Major Changes +- **Nearly twice as fast** - significantly faster speed of image generation. We're now pretty close to automatic1111's speed. Code contributions are welcome to make our project even faster: https://github.com/easydiffusion/sdkit/#is-it-fast +- **Full support for Stable Diffusion 2.1** - supports loading v1.4 or v2.0 or v2.1 models seamlessly. No need to enable "Test SD2", and no need to add `sd2_` to your SD 2.0 model file names. +- **Memory optimized Stable Diffusion 2.1** - you can now use 768x768 models for SD 2.1, with the same low VRAM optimizations that we've always had for SD 1.4. +- **6 new samplers!** - explore the new samplers, some of which can generate great images in less than 10 inference steps! +- **Model Merging** - You can now merge two models (`.ckpt` or `.safetensors`) and output `.ckpt` or `.safetensors` models, optionally in `fp16` precision. Details: https://github.com/cmdr2/stable-diffusion-ui/wiki/Model-Merging +- **Fast loading/unloading of VAEs** - No longer needs to reload the entire Stable Diffusion model, each time you change the VAE +- **Database of known models** - automatically picks the right configuration for known models. E.g. we automatically detect and apply "v" parameterization (required for some SD 2.0 models), and "fp32" attention precision (required for some SD 2.1 models). +- **Color correction for img2img** - an option to preserve the color profile (histogram) of the initial image. This is especially useful if you're getting red-tinted images after inpainting/masking. +- **Three GPU Memory Usage Settings** - `High` (fastest, maximum VRAM usage), `Balanced` (default - almost as fast, significantly lower VRAM usage), `Low` (slowest, very low VRAM usage). The `Low` setting is applied automatically for GPUs with less than 4 GB of VRAM. +- **Save metadata as JSON** - You can now save the metadata files as either text or json files (choose in the Settings tab). +- **Major rewrite of the code** - The codebase has been rewritten almost entirely (except for our task manager), to make it more manageable and easier for new developers to contribute features to. We've seperated our core engine into a new project called `sdkit`, which allows anyone to easily integrate Stable Diffusion into their programming projects (via a simple `pip install sdkit`): https://github.com/easydiffusion/sdkit/ +- **Name change** - Last, and probably the least, the UI is now called "Easy Diffusion". It indicates the focus of this project - an easy way for people to play with Stable Diffusion. + +Our focus continues to remain on an easy installation experience, and an easy user-interface. While still remaining pretty powerful, in terms of features and speed. + ## v2.4 ### Major Changes - **Allow reordering the task queue** (by dragging and dropping tasks). Thanks @madrang