diff --git a/index.html b/index.html index 6bb6f8a..745c4e2 100644 --- a/index.html +++ b/index.html @@ -186,12 +186,12 @@
- -
+
--> - + @@ -560,7 +560,7 @@ - + - + diff --git a/js/extensions.js b/js/extensions.js index d80fdcd..410e00d 100644 --- a/js/extensions.js +++ b/js/extensions.js @@ -5,6 +5,7 @@ const extensions = { // alwaysOnScriptsData: {}, alwaysOnScripts: false, + // softInpaintingEnabled: false, //??? controlNetEnabled: false, controlNetActive: false, controlNetReferenceActive: false, diff --git a/js/index.js b/js/index.js index c1442d9..b5ccf7a 100644 --- a/js/index.js +++ b/js/index.js @@ -170,7 +170,7 @@ function startup() { changeRefinerEnabled(); changeHiResFix(); changeHiResSquare(); - changeRestoreFaces(); + // changeRestoreFaces(); changeSyncCursorSize(); changeControlNetExtension(); changeControlNetReference(); @@ -1558,7 +1558,7 @@ function loadSettings() { document.getElementById("maskBlur").value = Number(_mask_blur); document.getElementById("seed").value = Number(_seed); document.getElementById("cbxHRFix").checked = Boolean(_enable_hr); - document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces); + // document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces); document.getElementById("cbxSyncCursorSize").checked = Boolean(_sync_cursor_size); document.getElementById("hrFixScale").value = Number(_hrfix_scale); diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index b0a1d01..85da32c 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -1585,6 +1585,7 @@ const dream_img2img_callback = (bb, resolution, state) => { if (extensions.dynamicPromptsEnabled) { addDynamicPromptsToAlwaysOnScripts(state); } + // and controlnet if (extensions.controlNetActive) { if (extensions.controlNetReferenceActive) { addControlNetToAlwaysOnScripts( @@ -1596,6 +1597,12 @@ const dream_img2img_callback = (bb, resolution, state) => { addControlNetToAlwaysOnScripts(state, null, null); // //WTF??? } } + // and soft inpainting + if (state.softInpaint) { + addSoftInpaintingToAlwaysOnScripts(state); + // TODO build always on scripts entry for soft inpaint + } + if (extensions.alwaysOnScripts) { // check again just to be sure because i'm an idiot? // addControlNetToAlwaysOnScripts(state); @@ -2751,6 +2758,7 @@ const img2imgTool = () => "icon-squircle", () => { if (state.softInpaint) { + extensions.checkForSoftInpainting(); state.ctxmenu.softInpaintScheduleBiasSlider.classList.remove( "invisible" ); @@ -3082,11 +3090,29 @@ const sendSeed = (seed) => { }; function buildAlwaysOnScripts(state) { + //todo make sure soft inpainting works + if (extensions.alwaysOnScripts) { state.alwayson_scripts = {}; } } +function addSoftInpaintingToAlwaysOnScripts(state) { + if (extensions.alwaysOnScripts) { + //????? + state.alwayson_scripts["Soft Inpainting"] = {}; + state.alwayson_scripts["Soft Inpainting"].args = [ + state.softInpaint, + state.softInpaintScheduleBias, + state.softInpaintPreservationStrength, + state.softInpaintTransitionContrastBoost, + state.softInpaintMaskInfluence, + state.softInpaintDifferenceThreshold, + state.softInpaintDifferenceContrast, + ]; + } +} + function addDynamicPromptsToAlwaysOnScripts(state) { if (extensions.dynamicPromptsEnabled) { state.alwayson_scripts[extensions.dynamicPromptsAlwaysonScriptName] = {};