From ba4893d821b089831588b9f599431826504ceea8 Mon Sep 17 00:00:00 2001 From: tim h Date: Sat, 22 Jul 2023 10:43:31 -0500 Subject: [PATCH 1/2] model selector update for upcoming webUI 1.5 --- index.html | 6 +++--- js/index.js | 12 +++++++++++- js/ui/tool/dream.js | 9 +++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 9f5dd21..893a8ee 100644 --- a/index.html +++ b/index.html @@ -316,7 +316,7 @@ Alpha release v0.0.16.4 - v20230722.001 + v20230722.002
- + - + diff --git a/js/index.js b/js/index.js index 7af7016..02078ad 100644 --- a/js/index.js +++ b/js/index.js @@ -1172,7 +1172,17 @@ async function getModels(refresh = false) { ); const optData = await optResponse.json(); - const model = optData.sd_model_checkpoint; + var model = optData.sd_model_checkpoint; + // 20230722 - sigh so this key is now removed https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/66c5f1bb1556a2d86d9f11aeb92f83d4a09832cc + // no idea why but time to deal with it + if (model === undefined) { + const modelHash = optData.sd_checkpoint_hash; + const hashMap = data.map((option) => ({ + hash: option.sha256, + title: option.title, + })); + model = hashMap.find((option) => option.hash === modelHash).title; + } console.log("Current model: " + model); if (modelAutoComplete.value !== model) modelAutoComplete.value = model; } catch (e) { diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index a591791..524f336 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -62,12 +62,9 @@ const _monitorProgress = (bb, oncheck = null) => { } const timeSpent = performance.now() - init; - setTimeout( - () => { - if (running) _checkProgress(); - }, - Math.max(0, minDelay - timeSpent) - ); + setTimeout(() => { + if (running) _checkProgress(); + }, Math.max(0, minDelay - timeSpent)); }; _checkProgress(); From fb3bf0a9395b984063a95cd6c1603ca808ee3aa8 Mon Sep 17 00:00:00 2001 From: tim h Date: Sat, 22 Jul 2023 11:00:43 -0500 Subject: [PATCH 2/2] did something change with sdxl outpainting >:( --- index.html | 2 +- js/ui/tool/dream.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 893a8ee..7e840af 100644 --- a/index.html +++ b/index.html @@ -553,7 +553,7 @@ src="js/ui/tool/generic.js?v=3e678e0" type="text/javascript"> - + diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index 524f336..1c320d4 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -2032,8 +2032,8 @@ const dreamTool = () => "outpainting_fill", "Outpaint Type", { - 0: "fill", - 1: "original (SDXL)", + 0: "fill (SDXL?)", + 1: "original (SDXL?)", 2: "latent noise (SD1.x/2.x)", 3: "latent nothing", },