forked from extern/easydiffusion
Moved done check after data read in 'doMakeImage'.
This commit is contained in:
parent
83b0239791
commit
d6d4ce0ac4
@ -491,12 +491,8 @@ async function doMakeImage(task) {
|
|||||||
let t = new Date().getTime()
|
let t = new Date().getTime()
|
||||||
|
|
||||||
const {value, done} = await reader.read()
|
const {value, done} = await reader.read()
|
||||||
if (done) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
let timeTaken = (prevTime === -1 ? -1 : t - prevTime)
|
let timeTaken = (prevTime === -1 ? -1 : t - prevTime)
|
||||||
|
|
||||||
let jsonStr = textDecoder.decode(value)
|
let jsonStr = textDecoder.decode(value)
|
||||||
try {
|
try {
|
||||||
// hack for a middleman buffering all the streaming updates, and unleashing them on the poor browser in one shot.
|
// hack for a middleman buffering all the streaming updates, and unleashing them on the poor browser in one shot.
|
||||||
@ -520,6 +516,9 @@ async function doMakeImage(task) {
|
|||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (done) {
|
||||||
|
break
|
||||||
|
}
|
||||||
if (typeof stepUpdate === 'object' && 'step' in stepUpdate) {
|
if (typeof stepUpdate === 'object' && 'step' in stepUpdate) {
|
||||||
let batchSize = stepUpdate.total_steps
|
let batchSize = stepUpdate.total_steps
|
||||||
let overallStepCount = stepUpdate.step + task.batchesDone * batchSize
|
let overallStepCount = stepUpdate.step + task.batchesDone * batchSize
|
||||||
|
Loading…
Reference in New Issue
Block a user