From c3ad87cea1b2eab999d632a2e14e1816ed931c71 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 28 Dec 2024 16:05:58 +0200 Subject: [PATCH] ComfyUI: negate clip_skip placeholder value --- public/scripts/extensions/stable-diffusion/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index 8d8449c7a..89ecc5de2 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -3310,7 +3310,6 @@ async function generateComfyImage(prompt, negativePrompt, signal) { 'scale', 'width', 'height', - 'clip_skip', ]; const workflowResponse = await fetch('/api/sd/comfy/workflow', { @@ -3333,6 +3332,9 @@ async function generateComfyImage(prompt, negativePrompt, signal) { const denoising_strength = extension_settings.sd.denoising_strength === undefined ? 1.0 : extension_settings.sd.denoising_strength; workflow = workflow.replaceAll('"%denoise%"', JSON.stringify(denoising_strength)); + const clip_skip = isNaN(extension_settings.sd.clip_skip) ? -1 : -extension_settings.sd.clip_skip; + workflow = workflow.replaceAll('"%clip_skip%"', JSON.stringify(clip_skip)); + placeholders.forEach(ph => { workflow = workflow.replaceAll(`"%${ph}%"`, JSON.stringify(extension_settings.sd[ph])); });