From 92f91e23ae8f2be060f52e8ed1aee42620378168 Mon Sep 17 00:00:00 2001 From: tim h Date: Tue, 3 Jan 2023 15:52:56 -0600 Subject: [PATCH 1/4] selectable outpaint type separate from inpaint now that i know how _horrible_ original is for outpainting --- js/index.js | 3 ++- js/ui/tool/dream.js | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index 5ac6a77..457acaa 100644 --- a/js/index.js +++ b/js/index.js @@ -103,7 +103,8 @@ var stableDiffusionData = { mask: "", init_images: [], inpaint_full_res: false, - inpainting_fill: 2, + inpainting_fill: 1, + outpainting_fill: 2, enable_hr: false, restore_faces: false, //firstphase_width: 0, diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index e8d9e54..505fb2c 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -927,6 +927,7 @@ const dream_generate_callback = async (bb, resolution, state) => { request.height ); request.mask = maskCanvas.toDataURL(); + request.inpainting_fill = stableDiffusionData.outpainting_fill; // Dream _generate("img2img", request, bb, { @@ -1538,6 +1539,23 @@ const dreamTool = () => "invisible" ); + // outpaint fill type select list + state.ctxmenu.outpaintTypeSelect = _toolbar_input.selectlist( + state, + "outpainting_fill", + "Outpaint Type", + { + 0: "fill", + 1: "original (AVOID)", + 2: "latent noise (suggested)", + 3: "latent nothing", + }, + 2, // AVOID ORIGINAL FOR OUTPAINT OR ELSE but we still give you the option because we love you + () => { + stableDiffusionData.outpainting_fill = state.outpainting_fill; + } + ).label; + // Preserve Brushed Masks Checkbox state.ctxmenu.preserveMasksLabel = _toolbar_input.checkbox( state, @@ -1587,6 +1605,7 @@ const dreamTool = () => // menu.appendChild(state.ctxmenu.keepUnmaskedBlurSliderLinebreak); // menu.appendChild(state.ctxmenu.preserveMasksLabel); // menu.appendChild(document.createElement("br")); + menu.appendChild(state.ctxmenu.outpaintTypeSelect); menu.appendChild(state.ctxmenu.overMaskPxLabel); menu.appendChild(state.ctxmenu.eagerGenerateCountLabel); }, From db725d54b5c00a11f6661ee9075b543b7be70192 Mon Sep 17 00:00:00 2001 From: tim h Date: Tue, 3 Jan 2023 15:54:05 -0600 Subject: [PATCH 2/4] be much less annoying about out of date webUI but also disable HRfix outright --- js/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/index.js b/js/index.js index 457acaa..d9ac3a2 100644 --- a/js/index.js +++ b/js/index.js @@ -345,9 +345,13 @@ async function testHostConnection() { ); const optionsdata = await response.json(); if (optionsdata["use_scale_latent_for_hires_fix"]) { - const message = `You are using an outdated version of A1111 webUI.\nThe HRfix options will not work until you update to at least commit ef27a18\n(https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/ef27a18b6b7cb1a8eebdc9b2e88d25baf2c2414d)\nor newer.`; + const message = `You are using an outdated version of A1111 webUI.\nThe HRfix options will not work until you update to at least commit ef27a18 or newer.\n(https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/ef27a18b6b7cb1a8eebdc9b2e88d25baf2c2414d)\nHRfix options have been disabled.`; console.error(message); - alert(message); + if (notify) alert(message); + document + .getElementById("cbxHRFix") + .setAttribute("disabled", "disabled"); + stableDiffusionData.enable_hr = false; } switch (response.status) { case 200: { @@ -564,6 +568,7 @@ const hrFixUpscalerAutoComplete = createAutoComplete( "HRfix Upscaler", document.getElementById("hrFixUpscaler") ); + hrFixUpscalerAutoComplete.onchange.on(({value}) => { stableDiffusionData.hr_upscaler = value; localStorage.setItem(`openoutpaint/hr_upscaler`, value); From e95b05c079196763c95fd8f0a691eda86bcaa5f5 Mon Sep 17 00:00:00 2001 From: tim h Date: Tue, 3 Jan 2023 15:56:41 -0600 Subject: [PATCH 3/4] update hashes --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 83acfbb..b124873 100644 --- a/index.html +++ b/index.html @@ -322,7 +322,7 @@ - + @@ -340,7 +340,7 @@ - + - + From 4a9121194105ae00a7b7487dfdc02c18ab51a7c2 Mon Sep 17 00:00:00 2001 From: zero01101 Date: Tue, 3 Jan 2023 23:23:47 +0000 Subject: [PATCH 4/4] Fixed resource hashes --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index b124873..1cda974 100644 --- a/index.html +++ b/index.html @@ -322,7 +322,7 @@ - + @@ -351,7 +351,7 @@