From ddf54d589e77959f5e7021b62a3f05e337e12057 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 27 May 2024 15:18:14 +0530 Subject: [PATCH 1/8] v3.0.8 - use sdkit 2.0.15.1, to enable SDXL Controlnets for img2img and inpainting, using diffusers 0.21.4 --- scripts/check_modules.py | 2 +- ui/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 00d2649f..bee4476e 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -22,7 +22,7 @@ modules_to_check = { "torch": ("1.11.0", "1.13.1", "2.0.0", "2.0.1"), "torchvision": ("0.12.0", "0.14.1", "0.15.1", "0.15.2"), "setuptools": "69.5.1", - "sdkit": "2.0.15", + "sdkit": "2.0.15.1", "stable-diffusion-sdkit": "2.1.5", "rich": "12.6.0", "uvicorn": "0.19.0", diff --git a/ui/index.html b/ui/index.html index 7abfa70c..77113985 100644 --- a/ui/index.html +++ b/ui/index.html @@ -35,7 +35,7 @@

Easy Diffusion - v3.0.7 + v3.0.8

From 723304204e1ae5c06d1077934746ba2be7457c41 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 27 May 2024 15:26:09 +0530 Subject: [PATCH 2/8] diffusers 0.21.4 --- scripts/check_modules.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index bee4476e..875a0688 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -22,7 +22,8 @@ modules_to_check = { "torch": ("1.11.0", "1.13.1", "2.0.0", "2.0.1"), "torchvision": ("0.12.0", "0.14.1", "0.15.1", "0.15.2"), "setuptools": "69.5.1", - "sdkit": "2.0.15.1", + "sdkit": "2.0.15.2", + "diffusers": "0.21.4", "stable-diffusion-sdkit": "2.1.5", "rich": "12.6.0", "uvicorn": "0.19.0", From ad649a8050970e76d901fcc3440bdcdc587d532a Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 28 May 2024 09:00:57 +0530 Subject: [PATCH 3/8] sdkit 2.0.15.3 - disable watermarking on SDXL ControlNets to avoid visual artifacts --- scripts/check_modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 875a0688..50ff90c2 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -22,7 +22,7 @@ modules_to_check = { "torch": ("1.11.0", "1.13.1", "2.0.0", "2.0.1"), "torchvision": ("0.12.0", "0.14.1", "0.15.1", "0.15.2"), "setuptools": "69.5.1", - "sdkit": "2.0.15.2", + "sdkit": "2.0.15.3", "diffusers": "0.21.4", "stable-diffusion-sdkit": "2.1.5", "rich": "12.6.0", From 44789bf16bb2bb32c7edfb8c360ea85adaa6a4c4 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 28 May 2024 18:45:08 +0530 Subject: [PATCH 4/8] sdkit 2.0.15.4 - Controlnet strength slider --- scripts/check_modules.py | 2 +- ui/easydiffusion/utils/save_utils.py | 1 + ui/index.html | 4 +++- ui/media/js/auto-save.js | 1 + ui/media/js/dnd.js | 10 ++++++++++ ui/media/js/main.js | 28 ++++++++++++++++++++++++++++ 6 files changed, 44 insertions(+), 2 deletions(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 50ff90c2..23dac713 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -22,7 +22,7 @@ modules_to_check = { "torch": ("1.11.0", "1.13.1", "2.0.0", "2.0.1"), "torchvision": ("0.12.0", "0.14.1", "0.15.1", "0.15.2"), "setuptools": "69.5.1", - "sdkit": "2.0.15.3", + "sdkit": "2.0.15.4", "diffusers": "0.21.4", "stable-diffusion-sdkit": "2.1.5", "rich": "12.6.0", diff --git a/ui/easydiffusion/utils/save_utils.py b/ui/easydiffusion/utils/save_utils.py index 457af921..e1b4d79a 100644 --- a/ui/easydiffusion/utils/save_utils.py +++ b/ui/easydiffusion/utils/save_utils.py @@ -31,6 +31,7 @@ TASK_TEXT_MAPPING = { "clip_skip": "Clip Skip", "use_controlnet_model": "ControlNet model", "control_filter_to_apply": "ControlNet Filter", + "control_alpha": "ControlNet Strength", "use_vae_model": "VAE model", "sampler_name": "Sampler", "width": "Width", diff --git a/ui/index.html b/ui/index.html index 77113985..a8c6685f 100644 --- a/ui/index.html +++ b/ui/index.html @@ -35,7 +35,7 @@

Easy Diffusion - v3.0.8 + v3.0.9

@@ -235,6 +235,8 @@
+
+
diff --git a/ui/media/js/auto-save.js b/ui/media/js/auto-save.js index 47a2885b..4ed28b89 100644 --- a/ui/media/js/auto-save.js +++ b/ui/media/js/auto-save.js @@ -57,6 +57,7 @@ const SETTINGS_IDS_LIST = [ "embedding-card-size-selector", "lora_model", "enable_vae_tiling", + "controlnet_alpha", ] const IGNORE_BY_DEFAULT = ["prompt"] diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index cf082406..0a547e55 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -309,6 +309,15 @@ const TASK_MAPPING = { readUI: () => controlImageFilterField.value, parse: (val) => val, }, + control_alpha: { + name: "ControlNet Strength", + setUI: (control_alpha) => { + controlAlphaField.value = control_alpha + updateControlAlphaSlider() + }, + readUI: () => parseFloat(controlAlphaField.value), + parse: (val) => parseFloat(val), + }, use_lora_model: { name: "LoRA model", setUI: (use_lora_model) => { @@ -587,6 +596,7 @@ const TASK_TEXT_MAPPING = { lora_alpha: "LoRA Strength", use_controlnet_model: "ControlNet model", control_filter_to_apply: "ControlNet Filter", + control_alpha: "ControlNet Strength", tiling: "Seamless Tiling", } function parseTaskFromText(str) { diff --git a/ui/media/js/main.js b/ui/media/js/main.js index ede271df..bff87b3b 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -51,6 +51,10 @@ const taskConfigSetup = { preserve_init_image_color_profile: "Preserve Color Profile", strict_mask_border: "Strict Mask Border", use_controlnet_model: "ControlNet Model", + control_alpha: { + label: "ControlNet Strength", + visible: ({ reqBody }) => !!reqBody?.use_controlnet_model, + }, }, pluginTaskConfig: {}, getCSSKey: (key) => @@ -99,6 +103,8 @@ let controlImagePreview = document.querySelector("#control_image_preview") let controlImageClearBtn = document.querySelector(".control_image_clear") let controlImageContainer = document.querySelector("#control_image_wrapper") let controlImageFilterField = document.querySelector("#control_image_filter") +let controlAlphaSlider = document.querySelector("#controlnet_alpha_slider") +let controlAlphaField = document.querySelector("#controlnet_alpha") let applyColorCorrectionField = document.querySelector("#apply_color_correction") let strictMaskBorderField = document.querySelector("#strict_mask_border") let colorCorrectionSetting = document.querySelector("#apply_color_correction_setting") @@ -1395,6 +1401,7 @@ function getCurrentUserRequest() { if (controlnetModelField.value !== "" && IMAGE_REGEX.test(controlImagePreview.src)) { newTask.reqBody.use_controlnet_model = controlnetModelField.value newTask.reqBody.control_image = controlImagePreview.src + newTask.reqBody.control_alpha = parseFloat(controlAlphaField.value) if (controlImageFilterField.value !== "") { newTask.reqBody.control_filter_to_apply = controlImageFilterField.value } @@ -2015,6 +2022,27 @@ function updateHypernetworkStrengthContainer() { hypernetworkModelField.addEventListener("change", updateHypernetworkStrengthContainer) updateHypernetworkStrengthContainer() +/********************* Controlnet Alpha **************************/ +function updateControlAlpha() { + controlAlphaField.value = controlAlphaSlider.value / 10 + controlAlphaField.dispatchEvent(new Event("change")) +} + +function updateControlAlphaSlider() { + if (controlAlphaField.value < 0) { + controlAlphaField.value = 0 + } else if (controlAlphaField.value > 10) { + controlAlphaField.value = 10 + } + + controlAlphaSlider.value = controlAlphaField.value * 10 + controlAlphaSlider.dispatchEvent(new Event("change")) +} + +controlAlphaSlider.addEventListener("input", updateControlAlpha) +controlAlphaField.addEventListener("input", updateControlAlphaSlider) +updateControlAlpha() + /********************* JPEG/WEBP Quality **********************/ function updateOutputQuality() { outputQualityField.value = 0 | outputQualitySlider.value From 4d9b023378e8ae7570636a8e09a8cb2d6da129c7 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 28 May 2024 18:48:23 +0530 Subject: [PATCH 5/8] changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 389ea7b7..b6a56186 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,8 @@ - **Major rewrite of the code** - We've switched to using diffusers under-the-hood, which allows us to release new features faster, and focus on making the UI and installer even easier to use. ### Detailed changelog +* 3.0.9 - 28 May 2024 - Slider for controlling the strength of controlnets. +* 3.0.8 - 27 May 2024 - SDXL ControlNets for Img2Img and Inpainting. * 3.0.7 - 11 Dec 2023 - Setting to enable/disable VAE tiling (in the Image Settings panel). Sometimes VAE tiling reduces the quality of the image, so this setting will help control that. * 3.0.6 - 18 Sep 2023 - Add thumbnails to embeddings from the UI, using the new `Upload Thumbnail` button in the Embeddings popup. Thanks @JeLuf. * 3.0.6 - 15 Sep 2023 - Fix broken embeddings dialog when LoRA information couldn't be fetched. From 05f3523364770f8aa8253c16b33ff2b627a67ff1 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 28 May 2024 19:16:48 +0530 Subject: [PATCH 6/8] Set the controlnet alpha correctly from older exports; Fix a bug with null lora model in exports --- ui/media/js/dnd.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index 0a547e55..5cb517fe 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -312,16 +312,18 @@ const TASK_MAPPING = { control_alpha: { name: "ControlNet Strength", setUI: (control_alpha) => { + control_alpha = control_alpha || 1.0 controlAlphaField.value = control_alpha updateControlAlphaSlider() }, readUI: () => parseFloat(controlAlphaField.value), - parse: (val) => parseFloat(val), + parse: (val) => val === null ? 1.0 : parseFloat(val), }, use_lora_model: { name: "LoRA model", setUI: (use_lora_model) => { let modelPaths = [] + use_lora_model = use_lora_model === null ? "" : use_lora_model use_lora_model = Array.isArray(use_lora_model) ? use_lora_model : [use_lora_model] use_lora_model.forEach((m) => { if (m.includes("models\\lora\\")) { @@ -538,6 +540,11 @@ function restoreTaskToUI(task, fieldsToSkip) { // listen for inpainter loading event, which happens AFTER the main image loads (which reloads the inpai controlImagePreview.src = task.reqBody.control_image } + + if ("use_controlnet_model" in task.reqBody && task.reqBody.use_controlnet_model && !("control_alpha" in task.reqBody)) { + controlAlphaField.value = 1.0 + updateControlAlphaSlider() + } } function readUI() { const reqBody = {} From fe3c648a2463efc95874ed29a9abf7362feaa846 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 28 May 2024 19:46:59 +0530 Subject: [PATCH 7/8] sdkit 2.0.15.5 - minor null check --- scripts/check_modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 23dac713..9b8387c5 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -22,7 +22,7 @@ modules_to_check = { "torch": ("1.11.0", "1.13.1", "2.0.0", "2.0.1"), "torchvision": ("0.12.0", "0.14.1", "0.15.1", "0.15.2"), "setuptools": "69.5.1", - "sdkit": "2.0.15.4", + "sdkit": "2.0.15.5", "diffusers": "0.21.4", "stable-diffusion-sdkit": "2.1.5", "rich": "12.6.0", From 21644adbe1d38e8ab492eeb1a49ee5683fd7b0f1 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 29 May 2024 10:01:04 +0530 Subject: [PATCH 8/8] sdkit 2.0.15.6 - typo that prevented 0 controlnet strength --- scripts/check_modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 9b8387c5..8941ef0e 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -22,7 +22,7 @@ modules_to_check = { "torch": ("1.11.0", "1.13.1", "2.0.0", "2.0.1"), "torchvision": ("0.12.0", "0.14.1", "0.15.1", "0.15.2"), "setuptools": "69.5.1", - "sdkit": "2.0.15.5", + "sdkit": "2.0.15.6", "diffusers": "0.21.4", "stable-diffusion-sdkit": "2.1.5", "rich": "12.6.0",