Merge pull request #118 from zero01101/testing
adds preserve mask option
This commit is contained in:
commit
2a0235a380
1 changed files with 21 additions and 1 deletions
|
@ -433,7 +433,7 @@ const _generate = async (endpoint, request, bb, options = {}) => {
|
||||||
h: bb.h,
|
h: bb.h,
|
||||||
image: canvas,
|
image: canvas,
|
||||||
});
|
});
|
||||||
clean(true);
|
clean(!toolbar._current_tool.state.preserveMasks);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1151,6 +1151,7 @@ const dreamTool = () =>
|
||||||
state.keepUnmasked = true;
|
state.keepUnmasked = true;
|
||||||
state.keepUnmaskedBlur = 8;
|
state.keepUnmaskedBlur = 8;
|
||||||
state.overMaskPx = 0;
|
state.overMaskPx = 0;
|
||||||
|
state.preserveMasks = false;
|
||||||
|
|
||||||
state.erasePrevCursor = () =>
|
state.erasePrevCursor = () =>
|
||||||
uiCtx.clearRect(0, 0, uiCanvas.width, uiCanvas.height);
|
uiCtx.clearRect(0, 0, uiCanvas.width, uiCanvas.height);
|
||||||
|
@ -1413,6 +1414,13 @@ const dreamTool = () =>
|
||||||
}
|
}
|
||||||
).slider;
|
).slider;
|
||||||
|
|
||||||
|
// Preserve Brushed Masks Checkbox
|
||||||
|
state.ctxmenu.preserveMasksLabel = _toolbar_input.checkbox(
|
||||||
|
state,
|
||||||
|
"preserveMasks",
|
||||||
|
"Preserve Brushed Masks"
|
||||||
|
).label;
|
||||||
|
|
||||||
// Overmasking Slider
|
// Overmasking Slider
|
||||||
state.ctxmenu.overMaskPxLabel = _toolbar_input.slider(
|
state.ctxmenu.overMaskPxLabel = _toolbar_input.slider(
|
||||||
state,
|
state,
|
||||||
|
@ -1434,6 +1442,8 @@ const dreamTool = () =>
|
||||||
menu.appendChild(document.createElement("br"));
|
menu.appendChild(document.createElement("br"));
|
||||||
menu.appendChild(state.ctxmenu.keepUnmaskedLabel);
|
menu.appendChild(state.ctxmenu.keepUnmaskedLabel);
|
||||||
menu.appendChild(state.ctxmenu.keepUnmaskedBlurSlider);
|
menu.appendChild(state.ctxmenu.keepUnmaskedBlurSlider);
|
||||||
|
menu.appendChild(state.ctxmenu.preserveMasksLabel);
|
||||||
|
menu.appendChild(document.createElement("br"));
|
||||||
menu.appendChild(state.ctxmenu.overMaskPxLabel);
|
menu.appendChild(state.ctxmenu.overMaskPxLabel);
|
||||||
},
|
},
|
||||||
shortcut: "D",
|
shortcut: "D",
|
||||||
|
@ -1518,6 +1528,7 @@ const img2imgTool = () =>
|
||||||
state.keepUnmasked = true;
|
state.keepUnmasked = true;
|
||||||
state.keepUnmaskedBlur = 8;
|
state.keepUnmaskedBlur = 8;
|
||||||
state.fullResolution = false;
|
state.fullResolution = false;
|
||||||
|
state.preserveMasks = false;
|
||||||
|
|
||||||
state.denoisingStrength = 0.7;
|
state.denoisingStrength = 0.7;
|
||||||
|
|
||||||
|
@ -1900,6 +1911,13 @@ const img2imgTool = () =>
|
||||||
"invisible"
|
"invisible"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Preserve Brushed Masks Checkbox
|
||||||
|
state.ctxmenu.preserveMasksLabel = _toolbar_input.checkbox(
|
||||||
|
state,
|
||||||
|
"preserveMasks",
|
||||||
|
"Preserve Brushed Masks"
|
||||||
|
).label;
|
||||||
|
|
||||||
// Inpaint Full Resolution Checkbox
|
// Inpaint Full Resolution Checkbox
|
||||||
state.ctxmenu.fullResolutionLabel = _toolbar_input.checkbox(
|
state.ctxmenu.fullResolutionLabel = _toolbar_input.checkbox(
|
||||||
state,
|
state,
|
||||||
|
@ -1949,6 +1967,8 @@ const img2imgTool = () =>
|
||||||
menu.appendChild(state.ctxmenu.keepUnmaskedLabel);
|
menu.appendChild(state.ctxmenu.keepUnmaskedLabel);
|
||||||
menu.appendChild(state.ctxmenu.keepUnmaskedBlurSlider);
|
menu.appendChild(state.ctxmenu.keepUnmaskedBlurSlider);
|
||||||
menu.appendChild(state.ctxmenu.keepUnmaskedBlurSliderLinebreak);
|
menu.appendChild(state.ctxmenu.keepUnmaskedBlurSliderLinebreak);
|
||||||
|
menu.appendChild(state.ctxmenu.preserveMasksLabel);
|
||||||
|
menu.appendChild(document.createElement("br"));
|
||||||
menu.appendChild(state.ctxmenu.fullResolutionLabel);
|
menu.appendChild(state.ctxmenu.fullResolutionLabel);
|
||||||
menu.appendChild(document.createElement("br"));
|
menu.appendChild(document.createElement("br"));
|
||||||
menu.appendChild(state.ctxmenu.denoisingStrengthSlider);
|
menu.appendChild(state.ctxmenu.denoisingStrengthSlider);
|
||||||
|
|
Loading…
Reference in a new issue