diff --git a/index.html b/index.html index d1a69eb..0b38969 100644 --- a/index.html +++ b/index.html @@ -250,7 +250,7 @@
- Alpha release v0.0.14 + Alpha release v0.0.14.1
- + - + diff --git a/js/index.js b/js/index.js index 90485d9..651bbdd 100644 --- a/js/index.js +++ b/js/index.js @@ -604,6 +604,13 @@ let modelAutoComplete = createAutoComplete( "refreshable" ); modelAutoComplete.onchange.on(({value}) => { + /** + * TODO implement optional API call to check model unet channel count + * extension users guaranteed to have it as of + * https://github.com/zero01101/openOutpaint-webUI-extension/commit/1f22f5ea5b860c6e91f77edfb47743a124596dec + * but still need a fallback check like below + */ + if (value.toLowerCase().includes("inpainting")) document.querySelector( "#models-ac-select input.autocomplete-text" @@ -1357,3 +1364,22 @@ function checkFocus() { focused = true; } } + +function togglePix2PixImgCfg(value) { + // super hacky + // actually doesn't work at all yet so i'm leaving it here to taunt and remind me of my failures + + try { + if (value.toLowerCase().includes("pix2pix")) { + document + .querySelector(".instruct-pix2pix-img-cfg") + .classList.remove("invisible"); + } else { + document + .querySelector(".instruct-pix2pix-img-cfg") + .classList.add("invisible"); + } + } catch (e) { + // highly likely not currently using img2img tool, do nothing + } +} diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index 154193c..457d7f2 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -2306,6 +2306,22 @@ const img2imgTool = () => textStep: 1, } ).slider; + + // img cfg scale slider for instruct-pix2pix + state.ctxmenu.instructPix2PixImgCfgLabel = _toolbar_input.slider( + state, + "image_cfg_scale", + "iP2P Image CFG Scale", + { + min: 0, + max: 30, + step: 1, + textStep: 0.1, + } + ).slider; + state.ctxmenu.instructPix2PixImgCfgLabel.classList.add( + "instruct-pix2pix-img-cfg" + ); } menu.appendChild(state.ctxmenu.cursorSizeSlider); @@ -2320,6 +2336,7 @@ const img2imgTool = () => // menu.appendChild(state.ctxmenu.keepUnmaskedBlurSliderLinebreak); menu.appendChild(state.ctxmenu.inpaintTypeSelect); menu.appendChild(state.ctxmenu.denoisingStrengthSlider); + menu.appendChild(state.ctxmenu.instructPix2PixImgCfgLabel); const btnArray2 = document.createElement("div"); btnArray2.classList.add("checkbox-array"); btnArray2.appendChild(state.ctxmenu.fullResolutionLabel);