remove extra <br>

This commit is contained in:
tim h 2023-01-01 22:06:09 -06:00
parent bf40218f28
commit 25eb6258cf
2 changed files with 21 additions and 30 deletions

View file

@ -348,7 +348,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=230e42e" type="text/javascript"></script> <script src="js/ui/tool/dream.js?v=e4d57e4" 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>

View file

@ -3,7 +3,6 @@ let generationQueue = [];
let generationAreas = new Set(); let generationAreas = new Set();
let generating = false; let generating = false;
/** /**
* Starts progress monitoring bar * Starts progress monitoring bar
* *
@ -378,7 +377,7 @@ const _generate = async (endpoint, request, bb, options = {}) => {
const sendInterrupt = () => { const sendInterrupt = () => {
fetch(`${host}${config.api.path}interrupt`, {method: "POST"}); fetch(`${host}${config.api.path}interrupt`, {method: "POST"});
} };
// Add Interrupt Button // Add Interrupt Button
const interruptButton = makeElement("button", bb.x + bb.w - 100, bb.y + bb.h); const interruptButton = makeElement("button", bb.x + bb.w - 100, bb.y + bb.h);
@ -395,7 +394,6 @@ const _generate = async (endpoint, request, bb, options = {}) => {
console.info(`[dream] Generating images for prompt '${request.prompt}'`); console.info(`[dream] Generating images for prompt '${request.prompt}'`);
console.debug(request); console.debug(request);
eagerGenerateCount = toolbar._current_tool.state.eagerGenerateCount; eagerGenerateCount = toolbar._current_tool.state.eagerGenerateCount;
isDreamComplete = false; isDreamComplete = false;
@ -438,13 +436,15 @@ const _generate = async (endpoint, request, bb, options = {}) => {
} }
const needMoreGenerations = () => { const needMoreGenerations = () => {
return (eagerGenerateCount > 0) && return (
(images.length - highestNavigatedImageIndex <= eagerGenerateCount); eagerGenerateCount > 0 &&
} images.length - highestNavigatedImageIndex <= eagerGenerateCount
);
};
const isGenerationPending = () => { const isGenerationPending = () => {
return generationQueue.length > 0; return generationQueue.length > 0;
} };
let highestNavigatedImageIndex = 0; let highestNavigatedImageIndex = 0;
@ -535,7 +535,6 @@ const _generate = async (endpoint, request, bb, options = {}) => {
if (needMoreGenerations() && !isGenerationPending() && !isDreamComplete) { if (needMoreGenerations() && !isGenerationPending() && !isDreamComplete) {
makeMore(); makeMore();
} }
}; };
const discardImg = async () => { const discardImg = async () => {
@ -781,7 +780,6 @@ const _generate = async (endpoint, request, bb, options = {}) => {
if (needMoreGenerations()) { if (needMoreGenerations()) {
makeMore(); makeMore();
} }
}; };
/** /**
@ -1508,7 +1506,6 @@ const dreamTool = () =>
"Preserve Brushed Masks" "Preserve Brushed Masks"
).label; ).label;
// Overmasking Slider // Overmasking Slider
state.ctxmenu.overMaskPxLabel = _toolbar_input.slider( state.ctxmenu.overMaskPxLabel = _toolbar_input.slider(
state, state,
@ -1522,7 +1519,6 @@ const dreamTool = () =>
} }
).slider; ).slider;
// Eager generation Slider // Eager generation Slider
state.ctxmenu.eagerGenerateCountLabel = _toolbar_input.slider( state.ctxmenu.eagerGenerateCountLabel = _toolbar_input.slider(
state, state,
@ -1535,8 +1531,6 @@ const dreamTool = () =>
textStep: 1, textStep: 1,
} }
).slider; ).slider;
} }
menu.appendChild(state.ctxmenu.cursorSizeSlider); menu.appendChild(state.ctxmenu.cursorSizeSlider);
@ -1549,7 +1543,6 @@ const dreamTool = () =>
menu.appendChild(state.ctxmenu.preserveMasksLabel); menu.appendChild(state.ctxmenu.preserveMasksLabel);
menu.appendChild(document.createElement("br")); menu.appendChild(document.createElement("br"));
menu.appendChild(state.ctxmenu.overMaskPxLabel); menu.appendChild(state.ctxmenu.overMaskPxLabel);
menu.appendChild(document.createElement("br"));
menu.appendChild(state.ctxmenu.eagerGenerateCountLabel); menu.appendChild(state.ctxmenu.eagerGenerateCountLabel);
}, },
shortcut: "D", shortcut: "D",
@ -2070,18 +2063,18 @@ const img2imgTool = () =>
} }
).slider; ).slider;
// Eager generation Slider // Eager generation Slider
state.ctxmenu.eagerGenerateCountLabel = _toolbar_input.slider( state.ctxmenu.eagerGenerateCountLabel = _toolbar_input.slider(
state, state,
"eagerGenerateCount", "eagerGenerateCount",
"Generate-ahead count", "Generate-ahead count",
{ {
min: 0, min: 0,
max: 100, max: 100,
step: 2, step: 2,
textStep: 1, textStep: 1,
} }
).slider; ).slider;
} }
menu.appendChild(state.ctxmenu.cursorSizeSlider); menu.appendChild(state.ctxmenu.cursorSizeSlider);
@ -2099,7 +2092,6 @@ const img2imgTool = () =>
menu.appendChild(state.ctxmenu.denoisingStrengthSlider); menu.appendChild(state.ctxmenu.denoisingStrengthSlider);
menu.appendChild(state.ctxmenu.borderMaskGradientCheckbox); menu.appendChild(state.ctxmenu.borderMaskGradientCheckbox);
menu.appendChild(state.ctxmenu.borderMaskSlider); menu.appendChild(state.ctxmenu.borderMaskSlider);
menu.appendChild(document.createElement("br"));
menu.appendChild(state.ctxmenu.eagerGenerateCountLabel); menu.appendChild(state.ctxmenu.eagerGenerateCountLabel);
}, },
shortcut: "I", shortcut: "I",
@ -2108,8 +2100,7 @@ const img2imgTool = () =>
window.onbeforeunload = async () => { window.onbeforeunload = async () => {
// Stop current generation on page close // Stop current generation on page close
if (generating) if (generating) await sendInterrupt();
await sendInterrupt();
}; };
const sendSeed = (seed) => { const sendSeed = (seed) => {