From be3b4e18a7958e47e8656d013275b5bb68aa8054 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Tue, 16 May 2023 12:36:46 +0300 Subject: [PATCH 1/4] Reduce console spam --- public/scripts/extensions/stable-diffusion/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index c4af71d2b..889a8881a 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -229,6 +229,10 @@ async function loadHordeSamplers() { } async function loadExtrasSamplers() { + if (!modules.includes('sd')) { + return []; + } + const url = new URL(getApiUrl()); url.pathname = '/api/image/samplers'; const result = await fetch(url, defaultRequestArgs); @@ -276,6 +280,10 @@ async function loadHordeModels() { } async function loadExtrasModels() { + if (!modules.includes('sd')) { + return []; + } + const url = new URL(getApiUrl()); url.pathname = '/api/image/model'; const getCurrentModelResult = await fetch(url, defaultRequestArgs); From 3b5ce2f669ab089ad708905445c157c7dd1eaa10 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Tue, 16 May 2023 12:40:36 +0300 Subject: [PATCH 2/4] Fix quiet prompt extraction --- public/script.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/public/script.js b/public/script.js index 9040454ef..5f215e007 100644 --- a/public/script.js +++ b/public/script.js @@ -2096,11 +2096,6 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject, } } - // Add quiet generation prompt at depth 0 - if (quiet_prompt && quiet_prompt.length) { - finalPromt += `\n${quiet_prompt}`; - } - finalPromt = finalPromt.replace(/\r/gm, ''); if (power_user.collapse_newlines) { From 7192c912ab382f5a777932e54bd366d6d4791dfc Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Tue, 16 May 2023 12:46:58 +0300 Subject: [PATCH 3/4] Fix Horde image gen --- server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.js b/server.js index ccfc29825..f36f38086 100644 --- a/server.js +++ b/server.js @@ -2974,9 +2974,11 @@ app.post('/horde_generateimage', jsonParser, async (request, response) => { return response.send(result.generations[0].img); } + /* if (!check.is_possible) { return response.sendStatus(503); } + */ if (check.faulted) { return response.sendStatus(500); From 07bc7c434a8d05a033a323c42e2990edb2559654 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Tue, 16 May 2023 14:20:37 +0300 Subject: [PATCH 4/4] SD gen error message --- public/scripts/extensions/stable-diffusion/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index 889a8881a..b2a098357 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -409,11 +409,12 @@ async function generateExtrasImage(prompt) { }), }); - if (result.ok) { const data = await result.json(); const base64Image = `data:image/jpeg;base64,${data.image}`; sendMessage(prompt, base64Image); + } else { + callPopup('Image generation has failed. Please try again.', 'text'); } } @@ -439,6 +440,8 @@ async function generateHordeImage(prompt) { const data = await result.text(); const base64Image = `data:image/webp;base64,${data}`; sendMessage(prompt, base64Image); + } else { + callPopup('Image generation has failed. Please try again.', 'text'); } }