Merge pull request #149 from zero01101/outpaint_type
user-adjustable outpaint (inpaint) type separated from... actual inpaint type
This commit is contained in:
commit
a3cfebff3f
3 changed files with 30 additions and 5 deletions
|
@ -340,7 +340,7 @@
|
||||||
|
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
|
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
|
||||||
<script src="js/index.js?v=adcbc46" type="text/javascript"></script>
|
<script src="js/index.js?v=62ccd18" type="text/javascript"></script>
|
||||||
|
|
||||||
<script
|
<script
|
||||||
src="js/ui/floating/history.js?v=fc92d14"
|
src="js/ui/floating/history.js?v=fc92d14"
|
||||||
|
@ -354,7 +354,7 @@
|
||||||
src="js/ui/tool/generic.js?v=2bcd36d"
|
src="js/ui/tool/generic.js?v=2bcd36d"
|
||||||
type="text/javascript"></script>
|
type="text/javascript"></script>
|
||||||
|
|
||||||
<script src="js/ui/tool/dream.js?v=7c80563" type="text/javascript"></script>
|
<script src="js/ui/tool/dream.js?v=d408feb" type="text/javascript"></script>
|
||||||
<script
|
<script
|
||||||
src="js/ui/tool/maskbrush.js?v=1e8a893"
|
src="js/ui/tool/maskbrush.js?v=1e8a893"
|
||||||
type="text/javascript"></script>
|
type="text/javascript"></script>
|
||||||
|
|
12
js/index.js
12
js/index.js
|
@ -103,7 +103,8 @@ var stableDiffusionData = {
|
||||||
mask: "",
|
mask: "",
|
||||||
init_images: [],
|
init_images: [],
|
||||||
inpaint_full_res: false,
|
inpaint_full_res: false,
|
||||||
inpainting_fill: 2,
|
inpainting_fill: 1,
|
||||||
|
outpainting_fill: 2,
|
||||||
enable_hr: false,
|
enable_hr: false,
|
||||||
restore_faces: false,
|
restore_faces: false,
|
||||||
//firstphase_width: 0,
|
//firstphase_width: 0,
|
||||||
|
@ -344,9 +345,13 @@ async function testHostConnection() {
|
||||||
);
|
);
|
||||||
const optionsdata = await response.json();
|
const optionsdata = await response.json();
|
||||||
if (optionsdata["use_scale_latent_for_hires_fix"]) {
|
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);
|
console.error(message);
|
||||||
alert(message);
|
if (notify) alert(message);
|
||||||
|
document
|
||||||
|
.getElementById("cbxHRFix")
|
||||||
|
.setAttribute("disabled", "disabled");
|
||||||
|
stableDiffusionData.enable_hr = false;
|
||||||
}
|
}
|
||||||
switch (response.status) {
|
switch (response.status) {
|
||||||
case 200: {
|
case 200: {
|
||||||
|
@ -563,6 +568,7 @@ const hrFixUpscalerAutoComplete = createAutoComplete(
|
||||||
"HRfix Upscaler",
|
"HRfix Upscaler",
|
||||||
document.getElementById("hrFixUpscaler")
|
document.getElementById("hrFixUpscaler")
|
||||||
);
|
);
|
||||||
|
|
||||||
hrFixUpscalerAutoComplete.onchange.on(({value}) => {
|
hrFixUpscalerAutoComplete.onchange.on(({value}) => {
|
||||||
stableDiffusionData.hr_upscaler = value;
|
stableDiffusionData.hr_upscaler = value;
|
||||||
localStorage.setItem(`openoutpaint/hr_upscaler`, value);
|
localStorage.setItem(`openoutpaint/hr_upscaler`, value);
|
||||||
|
|
|
@ -927,6 +927,7 @@ const dream_generate_callback = async (bb, resolution, state) => {
|
||||||
request.height
|
request.height
|
||||||
);
|
);
|
||||||
request.mask = maskCanvas.toDataURL();
|
request.mask = maskCanvas.toDataURL();
|
||||||
|
request.inpainting_fill = stableDiffusionData.outpainting_fill;
|
||||||
|
|
||||||
// Dream
|
// Dream
|
||||||
_generate("img2img", request, bb, {
|
_generate("img2img", request, bb, {
|
||||||
|
@ -1538,6 +1539,23 @@ const dreamTool = () =>
|
||||||
"invisible"
|
"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
|
// Preserve Brushed Masks Checkbox
|
||||||
state.ctxmenu.preserveMasksLabel = _toolbar_input.checkbox(
|
state.ctxmenu.preserveMasksLabel = _toolbar_input.checkbox(
|
||||||
state,
|
state,
|
||||||
|
@ -1587,6 +1605,7 @@ const dreamTool = () =>
|
||||||
// menu.appendChild(state.ctxmenu.keepUnmaskedBlurSliderLinebreak);
|
// menu.appendChild(state.ctxmenu.keepUnmaskedBlurSliderLinebreak);
|
||||||
// menu.appendChild(state.ctxmenu.preserveMasksLabel);
|
// menu.appendChild(state.ctxmenu.preserveMasksLabel);
|
||||||
// menu.appendChild(document.createElement("br"));
|
// menu.appendChild(document.createElement("br"));
|
||||||
|
menu.appendChild(state.ctxmenu.outpaintTypeSelect);
|
||||||
menu.appendChild(state.ctxmenu.overMaskPxLabel);
|
menu.appendChild(state.ctxmenu.overMaskPxLabel);
|
||||||
menu.appendChild(state.ctxmenu.eagerGenerateCountLabel);
|
menu.appendChild(state.ctxmenu.eagerGenerateCountLabel);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue