From f8dece9d8822ec0dd4dd208e93c42ec0543566c8 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 24 Dec 2023 20:01:59 +0200 Subject: [PATCH 1/3] Always remove logit bias and stop from vision --- public/scripts/openai.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 35f232dcb..ffb4a9efe 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -1556,9 +1556,10 @@ async function sendOpenAIRequest(type, messages, signal) { delete generate_data.stop; } - // Vision models don't support logit bias - if (isImageInliningSupported()) { + // Remove logit bias and stop strings if it's not supported by the model + if (isOAI && oai_settings.openai_model.includes('vision') || isOpenRouter && oai_settings.openrouter_model.includes('vision')) { delete generate_data.logit_bias; + delete generate_data.stop; } // Proxy is only supported for Claude and OpenAI From 4b254a75bcdf283d034e37e583f042d637a1ea2d Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 24 Dec 2023 20:02:11 +0200 Subject: [PATCH 2/3] Add scale icon --- public/img/scale.svg | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 public/img/scale.svg diff --git a/public/img/scale.svg b/public/img/scale.svg new file mode 100644 index 000000000..5d0f87cea --- /dev/null +++ b/public/img/scale.svg @@ -0,0 +1,60 @@ + + + + From b6570e775d1eba2c4f9a4cba23d296bd62a09481 Mon Sep 17 00:00:00 2001 From: RigbyB Date: Sun, 24 Dec 2023 21:02:04 +0000 Subject: [PATCH 3/3] ComfyUI request/prompt fix --- public/scripts/extensions/stable-diffusion/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index e8bc8f1e2..15e8736b0 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -2286,7 +2286,7 @@ async function generateComfyImage(prompt, negativePrompt) { toastr.error(`Failed to load workflow.\n\n${text}`); } let workflow = (await workflowResponse.json()).replace('"%prompt%"', JSON.stringify(prompt)); - workflow = (await workflowResponse.json()).replace('"%negative_prompt%"', JSON.stringify(negativePrompt)); + workflow = workflow.replace('"%negative_prompt%"', JSON.stringify(negativePrompt)); workflow = workflow.replace('"%seed%"', JSON.stringify(Math.round(Math.random() * Number.MAX_SAFE_INTEGER))); placeholders.forEach(ph => { workflow = workflow.replace(`"%${ph}%"`, JSON.stringify(extension_settings.sd[ph]));