From 97708c3cbc1c557714f4227a1452c68a22181a7c Mon Sep 17 00:00:00 2001 From: Siavosh Kasravi Date: Fri, 28 Jun 2024 14:48:55 +0330 Subject: [PATCH 01/39] Enhancement - ability to change image count in the queue --- ui/index.html | 2 +- ui/media/css/main.css | 4 ++++ ui/media/js/main.js | 14 +++++++++++++- ui/media/js/task-manager.js | 2 ++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ui/index.html b/ui/index.html index a8c6685f..5553c507 100644 --- a/ui/index.html +++ b/ui/index.html @@ -156,7 +156,7 @@
Image Settings - +
diff --git a/ui/media/css/main.css b/ui/media/css/main.css index 009c13d5..5ab2506a 100644 --- a/ui/media/css/main.css +++ b/ui/media/css/main.css @@ -2040,3 +2040,7 @@ div#enlarge-buttons { padding-top: 6pt; color: var(--small-label-color); } + +.imgCount { + width: 42pt; +} \ No newline at end of file diff --git a/ui/media/js/main.js b/ui/media/js/main.js index bff87b3b..bfe73faf 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1163,7 +1163,7 @@ function createTask(task) { } taskConfig += `
${createTaskConfig(task)}
` - + let imgCount = task.numOutputsTotal let taskEntry = document.createElement("div") taskEntry.id = `imageTaskContainer-${Date.now()}` taskEntry.className = "imageTaskContainer" @@ -1172,6 +1172,8 @@ function createTask(task) {
Enqueued
+ +
${taskConfig}
@@ -1234,6 +1236,16 @@ function createTask(task) { task["previewPrompt"] = taskEntry.querySelector(".preview-prompt") task["progressBar"] = taskEntry.querySelector(".progress-bar") task["stopTask"] = taskEntry.querySelector(".stopTask") + task["imgCount"] = taskEntry.querySelector(".imgCount") + + task["imgCount"].addEventListener("change", (e) => { + e.stopPropagation() + task.batchCount = e.target.value / (task.numOutputsTotal / task.batchCount) + task.numOutputsTotal = e.target.value + }) + task["imgCount"].addEventListener("click", (e) => { + e.stopPropagation(); // Prevent propagation of the click event to the parent + }); task["stopTask"].addEventListener("click", (e) => { e.stopPropagation() diff --git a/ui/media/js/task-manager.js b/ui/media/js/task-manager.js index 71fd7803..85047616 100644 --- a/ui/media/js/task-manager.js +++ b/ui/media/js/task-manager.js @@ -165,12 +165,14 @@ function getTaskUpdater(task, reqBody, outputContainer) { task["taskStatusLabel"].innerText = "Waiting" task["taskStatusLabel"].classList.add("waitingTaskLabel") task["taskStatusLabel"].classList.remove("activeTaskLabel") + task["imgCount"].setAttribute("disabled", true) break case SD.TaskStatus.processing: case SD.TaskStatus.completed: task["taskStatusLabel"].innerText = "Processing" task["taskStatusLabel"].classList.add("activeTaskLabel") task["taskStatusLabel"].classList.remove("waitingTaskLabel") + task["imgCount"].setAttribute("disabled", true) break case SD.TaskStatus.stopped: break From 74b05022f4ed7050bc3c853f97cd6ef21e759d64 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 11 Dec 2024 11:20:17 +0530 Subject: [PATCH 02/39] Merge pull request #1867 from tjcomserv/tjcomserv-patch-1-pydantic Tjcomserv patch 1 pydantic --- scripts/check_modules.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 951ca868..d695ee03 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -28,7 +28,7 @@ modules_to_check = { "stable-diffusion-sdkit": "2.1.5", "rich": "12.6.0", "uvicorn": "0.19.0", - "fastapi": "0.85.1", + "fastapi": "0.115.6", "pycloudflared": "0.2.0", "ruamel.yaml": "0.17.21", "sqlalchemy": "2.0.19", @@ -100,8 +100,8 @@ def update_modules(): allowed_versions = ("59.8.0",) latest_version = "59.8.0" else: - allowed_versions = ("69.0.0",) - latest_version = "69.0.0" + allowed_versions = ("69.5.1",) + latest_version = "69.5.1" requires_install = False if module_name in ("torch", "torchvision"): From 77a9226720a6bd8b578a12920a2bce32116f22d8 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 11 Dec 2024 11:47:18 +0530 Subject: [PATCH 03/39] Annotate with types for pydantic --- ui/easydiffusion/types.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/easydiffusion/types.py b/ui/easydiffusion/types.py index f16e9aa3..2da62537 100644 --- a/ui/easydiffusion/types.py +++ b/ui/easydiffusion/types.py @@ -20,8 +20,8 @@ class GenerateImageRequest(BaseModel): control_image: Any = None control_alpha: Union[float, List[float]] = None prompt_strength: float = 0.8 - preserve_init_image_color_profile = False - strict_mask_border = False + preserve_init_image_color_profile: bool = False + strict_mask_border: bool = False sampler_name: str = None # "ddim", "plms", "heun", "euler", "euler_a", "dpm2", "dpm2_a", "lms" hypernetwork_strength: float = 0 @@ -100,7 +100,7 @@ class MergeRequest(BaseModel): model1: str = None ratio: float = None out_path: str = "mix" - use_fp16 = True + use_fp16: bool = True class Image: From c246c7456afb176a04c3a900a154d41b2dd4db8a Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 11 Dec 2024 11:59:09 +0530 Subject: [PATCH 04/39] Pin wandb --- scripts/check_modules.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index d695ee03..bf8e74af 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -35,6 +35,7 @@ modules_to_check = { "python-multipart": "0.0.6", # "xformers": "0.0.16", "huggingface-hub": "0.21.4", + "wandb": "0.13.7", } modules_to_log = ["torch", "torchvision", "sdkit", "stable-diffusion-sdkit", "diffusers"] From 1a1f8f381ba6c32369fcfe3945fb3139bc04abdb Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 12 Dec 2024 00:15:31 +0530 Subject: [PATCH 05/39] winter is coming --- ui/plugins/ui/snow.plugin.js | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 ui/plugins/ui/snow.plugin.js diff --git a/ui/plugins/ui/snow.plugin.js b/ui/plugins/ui/snow.plugin.js new file mode 100644 index 00000000..6299a038 --- /dev/null +++ b/ui/plugins/ui/snow.plugin.js @@ -0,0 +1,71 @@ +// temp christmas hack, courtesy: https://pajasevi.github.io/CSSnowflakes/ + +;(function(){ + "use strict"; + const styleSheet = document.createElement("style") + styleSheet.textContent = ` + /* customizable snowflake styling */ + .snowflake { + color: #fff; + font-size: 1em; + font-family: Arial, sans-serif; + text-shadow: 0 0 5px #000; + } + + .snowflake,.snowflake .inner{animation-iteration-count:infinite;animation-play-state:running}@keyframes snowflakes-fall{0%{transform:translateY(0)}100%{transform:translateY(110vh)}}@keyframes snowflakes-shake{0%,100%{transform:translateX(0)}50%{transform:translateX(80px)}}.snowflake{position:fixed;top:-10%;z-index:9999;-webkit-user-select:none;user-select:none;cursor:default;animation-name:snowflakes-shake;animation-duration:3s;animation-timing-function:ease-in-out}.snowflake .inner{animation-duration:10s;animation-name:snowflakes-fall;animation-timing-function:linear}.snowflake:nth-of-type(0){left:1%;animation-delay:0s}.snowflake:nth-of-type(0) .inner{animation-delay:0s}.snowflake:first-of-type{left:10%;animation-delay:1s}.snowflake:first-of-type .inner,.snowflake:nth-of-type(8) .inner{animation-delay:1s}.snowflake:nth-of-type(2){left:20%;animation-delay:.5s}.snowflake:nth-of-type(2) .inner,.snowflake:nth-of-type(6) .inner{animation-delay:6s}.snowflake:nth-of-type(3){left:30%;animation-delay:2s}.snowflake:nth-of-type(11) .inner,.snowflake:nth-of-type(3) .inner{animation-delay:4s}.snowflake:nth-of-type(4){left:40%;animation-delay:2s}.snowflake:nth-of-type(10) .inner,.snowflake:nth-of-type(4) .inner{animation-delay:2s}.snowflake:nth-of-type(5){left:50%;animation-delay:3s}.snowflake:nth-of-type(5) .inner{animation-delay:8s}.snowflake:nth-of-type(6){left:60%;animation-delay:2s}.snowflake:nth-of-type(7){left:70%;animation-delay:1s}.snowflake:nth-of-type(7) .inner{animation-delay:2.5s}.snowflake:nth-of-type(8){left:80%;animation-delay:0s}.snowflake:nth-of-type(9){left:90%;animation-delay:1.5s}.snowflake:nth-of-type(9) .inner{animation-delay:3s}.snowflake:nth-of-type(10){left:25%;animation-delay:0s}.snowflake:nth-of-type(11){left:65%;animation-delay:2.5s} + ` + document.head.appendChild(styleSheet) + + const snowflakes = document.createElement("div") + snowflakes.innerHTML = ` + ` + + document.body.appendChild(snowflakes) + + const script = document.createElement("script") + script.innerHTML = ` + $(document).ready(function() { + setTimeout(function() { + $(".snowflakes").fadeOut("slow") + }, 10 * 1000) + }) + ` + document.body.appendChild(script) +})() From 28badd53190fd319ef7b5d701444cd8a1b9a2bde Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 12 Dec 2024 00:26:16 +0530 Subject: [PATCH 06/39] =?UTF-8?q?=E2=9D=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/plugins/ui/snow.plugin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/plugins/ui/snow.plugin.js b/ui/plugins/ui/snow.plugin.js index 6299a038..6bdcf0f8 100644 --- a/ui/plugins/ui/snow.plugin.js +++ b/ui/plugins/ui/snow.plugin.js @@ -17,6 +17,7 @@ document.head.appendChild(styleSheet) const snowflakes = document.createElement("div") + snowflakes.id = "snowflakes-container" snowflakes.innerHTML = `