This commit is contained in:
tim h 2024-02-21 14:40:02 -06:00
parent ce6052d68e
commit c252ed6ea1
4 changed files with 34 additions and 7 deletions

View file

@ -186,12 +186,12 @@
<label id="hrFixLabel" class="hrfix">Choose HRfix upscaler</label>
<div id="hrFixUpscaler" class="hrfix"></div>
<div id="hrDenoising" class="hrfix"></div>
<input
<!-- <input
type="checkbox"
id="cbxRestoreFaces"
onchange="changeRestoreFaces()" />
<label for="cbxRestoreFaces">Restore Faces</label>
<br />
<br /> -->
<input
type="checkbox"
id="cbxSyncCursorSize"
@ -534,7 +534,7 @@
<!-- Basics -->
<script src="js/global.js?v=ac30d16" type="text/javascript"></script>
<script src="js/defaults.js?v=5b06818" type="text/javascript"></script>
<script src="js/extensions.js?v=14e4f0f" type="text/javascript"></script>
<script src="js/extensions.js?v=5102854" type="text/javascript"></script>
<!-- Base Libs -->
<script src="js/lib/util.js?v=379aef7" type="text/javascript"></script>
@ -560,7 +560,7 @@
<!-- Content -->
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
<script src="js/index.js?v=70af18f" type="text/javascript"></script>
<script src="js/index.js?v=206c7df" type="text/javascript"></script>
<script
src="js/ui/floating/history.js?v=4f29db4"
@ -574,7 +574,7 @@
src="js/ui/tool/generic.js?v=3e678e0"
type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=d8cfe88" type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=b224aac" type="text/javascript"></script>
<script
src="js/ui/tool/maskbrush.js?v=e9bd0eb"
type="text/javascript"></script>

View file

@ -5,6 +5,7 @@
const extensions = {
// alwaysOnScriptsData: {},
alwaysOnScripts: false,
// softInpaintingEnabled: false, //???
controlNetEnabled: false,
controlNetActive: false,
controlNetReferenceActive: false,

View file

@ -170,7 +170,7 @@ function startup() {
changeRefinerEnabled();
changeHiResFix();
changeHiResSquare();
changeRestoreFaces();
// changeRestoreFaces();
changeSyncCursorSize();
changeControlNetExtension();
changeControlNetReference();
@ -1558,7 +1558,7 @@ function loadSettings() {
document.getElementById("maskBlur").value = Number(_mask_blur);
document.getElementById("seed").value = Number(_seed);
document.getElementById("cbxHRFix").checked = Boolean(_enable_hr);
document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces);
// document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces);
document.getElementById("cbxSyncCursorSize").checked =
Boolean(_sync_cursor_size);
document.getElementById("hrFixScale").value = Number(_hrfix_scale);

View file

@ -1585,6 +1585,7 @@ const dream_img2img_callback = (bb, resolution, state) => {
if (extensions.dynamicPromptsEnabled) {
addDynamicPromptsToAlwaysOnScripts(state);
}
// and controlnet
if (extensions.controlNetActive) {
if (extensions.controlNetReferenceActive) {
addControlNetToAlwaysOnScripts(
@ -1596,6 +1597,12 @@ const dream_img2img_callback = (bb, resolution, state) => {
addControlNetToAlwaysOnScripts(state, null, null); // //WTF???
}
}
// and soft inpainting
if (state.softInpaint) {
addSoftInpaintingToAlwaysOnScripts(state);
// TODO build always on scripts entry for soft inpaint
}
if (extensions.alwaysOnScripts) {
// check again just to be sure because i'm an idiot?
// addControlNetToAlwaysOnScripts(state);
@ -2751,6 +2758,7 @@ const img2imgTool = () =>
"icon-squircle",
() => {
if (state.softInpaint) {
extensions.checkForSoftInpainting();
state.ctxmenu.softInpaintScheduleBiasSlider.classList.remove(
"invisible"
);
@ -3082,11 +3090,29 @@ const sendSeed = (seed) => {
};
function buildAlwaysOnScripts(state) {
//todo make sure soft inpainting works
if (extensions.alwaysOnScripts) {
state.alwayson_scripts = {};
}
}
function addSoftInpaintingToAlwaysOnScripts(state) {
if (extensions.alwaysOnScripts) {
//?????
state.alwayson_scripts["Soft Inpainting"] = {};
state.alwayson_scripts["Soft Inpainting"].args = [
state.softInpaint,
state.softInpaintScheduleBias,
state.softInpaintPreservationStrength,
state.softInpaintTransitionContrastBoost,
state.softInpaintMaskInfluence,
state.softInpaintDifferenceThreshold,
state.softInpaintDifferenceContrast,
];
}
}
function addDynamicPromptsToAlwaysOnScripts(state) {
if (extensions.dynamicPromptsEnabled) {
state.alwayson_scripts[extensions.dynamicPromptsAlwaysonScriptName] = {};