mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-27 04:48:23 +02:00
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
This commit is contained in:
parent
49ce302bd4
commit
bb6db783d8
@ -714,16 +714,15 @@ async function doMakeImage(reqBody, batchCount) {
|
|||||||
let res = ''
|
let res = ''
|
||||||
let seed = reqBody['seed']
|
let seed = reqBody['seed']
|
||||||
let numOutputs = parseInt(reqBody['num_outputs'])
|
let numOutputs = parseInt(reqBody['num_outputs'])
|
||||||
|
let showOnlyFilteredImage = reqBody['show_only_filtered_image']
|
||||||
|
|
||||||
let images = []
|
let images = []
|
||||||
|
|
||||||
function makeImageContainers() {
|
function makeImageContainers(numImages) {
|
||||||
if (images.length === 0) {
|
for (let i = images.length; i < numImages; i++) {
|
||||||
for (let i = 0; i < numOutputs; i++) {
|
|
||||||
images.push(makeImageElement(reqBody.width, reqBody.height))
|
images.push(makeImageElement(reqBody.width, reqBody.height))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
res = await fetch('/image', {
|
res = await fetch('/image', {
|
||||||
@ -777,7 +776,7 @@ async function doMakeImage(reqBody, batchCount) {
|
|||||||
progressBar.style.display = 'block'
|
progressBar.style.display = 'block'
|
||||||
|
|
||||||
if (stepUpdate.output !== undefined) {
|
if (stepUpdate.output !== undefined) {
|
||||||
makeImageContainers()
|
makeImageContainers(numOutputs)
|
||||||
|
|
||||||
for (idx in stepUpdate.output) {
|
for (idx in stepUpdate.output) {
|
||||||
let imgItem = images[idx]
|
let imgItem = images[idx]
|
||||||
@ -844,7 +843,7 @@ async function doMakeImage(reqBody, batchCount) {
|
|||||||
|
|
||||||
lastPromptUsed = reqBody['prompt']
|
lastPromptUsed = reqBody['prompt']
|
||||||
|
|
||||||
makeImageContainers()
|
makeImageContainers(numOutputs * (showOnlyFilteredImage ? 1 : 2))
|
||||||
|
|
||||||
for (let idx in res.output) {
|
for (let idx in res.output) {
|
||||||
let imgBody = ''
|
let imgBody = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user