From bb6db783d873fca22e5daf554a05e57ba82f69cb Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 21 Sep 2022 16:26:13 +0530 Subject: [PATCH] Fix a bug where the stop button wouldn't go away after the task finished. This happened when the upscaling/face correction was on, and insufficient image placeholders were created --- ui/index.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/index.html b/ui/index.html index fc849f7d..0c6850cd 100644 --- a/ui/index.html +++ b/ui/index.html @@ -714,14 +714,13 @@ async function doMakeImage(reqBody, batchCount) { let res = '' let seed = reqBody['seed'] let numOutputs = parseInt(reqBody['num_outputs']) + let showOnlyFilteredImage = reqBody['show_only_filtered_image'] let images = [] - function makeImageContainers() { - if (images.length === 0) { - for (let i = 0; i < numOutputs; i++) { - images.push(makeImageElement(reqBody.width, reqBody.height)) - } + function makeImageContainers(numImages) { + for (let i = images.length; i < numImages; i++) { + images.push(makeImageElement(reqBody.width, reqBody.height)) } } @@ -777,7 +776,7 @@ async function doMakeImage(reqBody, batchCount) { progressBar.style.display = 'block' if (stepUpdate.output !== undefined) { - makeImageContainers() + makeImageContainers(numOutputs) for (idx in stepUpdate.output) { let imgItem = images[idx] @@ -844,7 +843,7 @@ async function doMakeImage(reqBody, batchCount) { lastPromptUsed = reqBody['prompt'] - makeImageContainers() + makeImageContainers(numOutputs * (showOnlyFilteredImage ? 1 : 2)) for (let idx in res.output) { let imgBody = ''