Fix number on the "Make X images" button

With this change, the number of prompt variants is taken into account when computing the number of images that will be generated.
X = getPrompts().length * numOutputsTotalField.value
This commit is contained in:
JeLuF 2023-01-13 22:05:25 +01:00
parent df3d00ef94
commit 9d9fc1683a

View File

@ -1138,7 +1138,7 @@ widthField.addEventListener('change', onDimensionChange)
heightField.addEventListener('change', onDimensionChange) heightField.addEventListener('change', onDimensionChange)
function renameMakeImageButton() { function renameMakeImageButton() {
let totalImages = Math.max(parseInt(numOutputsTotalField.value), parseInt(numOutputsParallelField.value)) let totalImages = Math.max(parseInt(numOutputsTotalField.value), parseInt(numOutputsParallelField.value)) * getPrompts().length
let imageLabel = 'Image' let imageLabel = 'Image'
if (totalImages > 1) { if (totalImages > 1) {
imageLabel = totalImages + ' Images' imageLabel = totalImages + ' Images'
@ -1483,6 +1483,9 @@ function resumeClient() {
}) })
} }
promptField.addEventListener("input", debounce( renameMakeImageButton, 1000) )
pauseBtn.addEventListener("click", function () { pauseBtn.addEventListener("click", function () {
pauseClient = true pauseClient = true
pauseBtn.style.display="none" pauseBtn.style.display="none"