mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-20 18:08:00 +02:00
Changed from showing percentage to how many images are left to create
This commit is contained in:
parent
49445d6473
commit
19405ee960
@ -1144,9 +1144,6 @@ function getTaskUpdater(task, reqBody, outputContainer) {
|
|||||||
stepUpdate.total_steps * (batchCount - task.batchesDone) // Initial value at (unstarted task count * Nbr of steps)
|
stepUpdate.total_steps * (batchCount - task.batchesDone) // Initial value at (unstarted task count * Nbr of steps)
|
||||||
)
|
)
|
||||||
const percent = Math.min(100, 100 * (overallStepCount / totalSteps)).toFixed(0)
|
const percent = Math.min(100, 100 * (overallStepCount / totalSteps)).toFixed(0)
|
||||||
if (SHOW_PROGRESS) {
|
|
||||||
document.title = `${percent}% - Easy Diffusion`
|
|
||||||
}
|
|
||||||
|
|
||||||
const timeTaken = stepUpdate.step_time // sec
|
const timeTaken = stepUpdate.step_time // sec
|
||||||
const stepsRemaining = Math.max(0, totalSteps - overallStepCount)
|
const stepsRemaining = Math.max(0, totalSteps - overallStepCount)
|
||||||
@ -1289,6 +1286,15 @@ function onTaskCompleted(task, reqBody, instance, outputContainer, stepUpdate) {
|
|||||||
playSound()
|
playSound()
|
||||||
}
|
}
|
||||||
if (SHOW_PROGRESS) {
|
if (SHOW_PROGRESS) {
|
||||||
|
updateTitle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateTitle() {
|
||||||
|
let img_remaining = [...document.querySelectorAll("div .imageTaskContainer").entries()].map(c => htmlTaskMap.get(c[1])).filter(task => task.isProcessing).map(task => task.numOutputsTotal - Math.max(0, (task.batchesDone - 1) * task.reqBody.num_outputs)).reduce((total, value) => total + value, 0);
|
||||||
|
if (img_remaining > 0) {
|
||||||
|
document.title = `${img_remaining} - Easy Diffusion`;
|
||||||
|
} else {
|
||||||
document.title = "Completed - Easy Diffusion"
|
document.title = "Completed - Easy Diffusion"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1384,6 +1390,9 @@ async function onTaskStart(task) {
|
|||||||
renderButtons.style.display = "flex"
|
renderButtons.style.display = "flex"
|
||||||
renameMakeImageButton()
|
renameMakeImageButton()
|
||||||
updateInitialText()
|
updateInitialText()
|
||||||
|
if (SHOW_PROGRESS) {
|
||||||
|
updateTitle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hover effect for the init image in the task list */
|
/* Hover effect for the init image in the task list */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user