From 92f91e23ae8f2be060f52e8ed1aee42620378168 Mon Sep 17 00:00:00 2001 From: tim h Date: Tue, 3 Jan 2023 15:52:56 -0600 Subject: [PATCH] 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); },