From d350dbf0d7fae941c0fb0ef17ece9f7d32a90c7f Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 29 May 2024 03:00:42 +0300 Subject: [PATCH] Add Novel decrisper control --- .../scripts/extensions/stable-diffusion/index.js | 9 +++++++++ .../extensions/stable-diffusion/settings.html | 16 ++++++++++++---- src/endpoints/novelai.js | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index 92f49c07d..c8124dc6f 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -243,6 +243,7 @@ const defaultSettings = { novel_anlas_guard: false, novel_sm: false, novel_sm_dyn: false, + novel_decrisper: false, // OpenAI settings openai_style: 'vivid', @@ -387,6 +388,7 @@ async function loadSettings() { $('#sd_novel_sm').prop('checked', extension_settings.sd.novel_sm); $('#sd_novel_sm_dyn').prop('checked', extension_settings.sd.novel_sm_dyn); $('#sd_novel_sm_dyn').prop('disabled', !extension_settings.sd.novel_sm); + $('#sd_novel_decrisper').prop('checked', extension_settings.sd.novel_decrisper); $('#sd_pollinations_enhance').prop('checked', extension_settings.sd.pollinations_enhance); $('#sd_pollinations_refine').prop('checked', extension_settings.sd.pollinations_refine); $('#sd_horde').prop('checked', extension_settings.sd.horde); @@ -846,6 +848,11 @@ function onNovelSmDynInput() { saveSettingsDebounced(); } +function onNovelDecrisperInput() { + extension_settings.sd.novel_decrisper = !!$('#sd_novel_decrisper').prop('checked'); + saveSettingsDebounced(); +} + function onPollinationsEnhanceInput() { extension_settings.sd.pollinations_enhance = !!$('#sd_pollinations_enhance').prop('checked'); saveSettingsDebounced(); @@ -2542,6 +2549,7 @@ async function generateNovelImage(prompt, negativePrompt) { height: height, negative_prompt: negativePrompt, upscale_ratio: extension_settings.sd.novel_upscale_ratio, + decrisper: extension_settings.sd.novel_decrisper, sm: sm, sm_dyn: sm_dyn, }), @@ -3185,6 +3193,7 @@ jQuery(async () => { $('#sd_novel_view_anlas').on('click', onViewAnlasClick); $('#sd_novel_sm').on('input', onNovelSmInput); $('#sd_novel_sm_dyn').on('input', onNovelSmDynInput); + $('#sd_novel_decrisper').on('input', onNovelDecrisperInput); $('#sd_pollinations_enhance').on('input', onPollinationsEnhanceInput); $('#sd_pollinations_refine').on('input', onPollinationsRefineInput); $('#sd_comfy_validate').on('click', validateComfyUrl); diff --git a/public/scripts/extensions/stable-diffusion/settings.html b/public/scripts/extensions/stable-diffusion/settings.html index bdb86eae8..74d722772 100644 --- a/public/scripts/extensions/stable-diffusion/settings.html +++ b/public/scripts/extensions/stable-diffusion/settings.html @@ -182,6 +182,14 @@ +
+ +
@@ -192,13 +200,13 @@ -