mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-22 00:03:20 +01:00
Incorporated proposal by @JeLuF in #1324
This commit is contained in:
parent
5e07432ae9
commit
6ae4314b79
@ -1342,6 +1342,16 @@ function getPromptsNumber(prompts) {
|
|||||||
prompts = prompts.map((prompt) => prompt.trim())
|
prompts = prompts.map((prompt) => prompt.trim())
|
||||||
prompts = prompts.filter((prompt) => prompt !== "")
|
prompts = prompts.filter((prompt) => prompt !== "")
|
||||||
|
|
||||||
|
// estimate number of prompts
|
||||||
|
let estimatedNumberOfPrompts = 0
|
||||||
|
prompts.forEach((prompt) => {
|
||||||
|
estimatedNumberOfPrompts += (prompt.match(/{[^}]*}/g) || []).map((e) => e.match(/,/g).length + 1).reduce( (p,a) => p*a, 1) * (2**(prompt.match(/\|/g) || []).length)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (estimatedNumberOfPrompts >= 10000) {
|
||||||
|
return 10000
|
||||||
|
}
|
||||||
|
|
||||||
promptsToMake = applySetOperator(prompts) // switched those around as Set grows in a linear fashion and permute in 2^n, and one has to be computed for the other to be calculated
|
promptsToMake = applySetOperator(prompts) // switched those around as Set grows in a linear fashion and permute in 2^n, and one has to be computed for the other to be calculated
|
||||||
numberOfPrompts = applyPermuteOperatorNumber(promptsToMake)
|
numberOfPrompts = applyPermuteOperatorNumber(promptsToMake)
|
||||||
}
|
}
|
||||||
@ -1613,8 +1623,14 @@ function renameMakeImageButton() {
|
|||||||
imageLabel = totalImages + " Images"
|
imageLabel = totalImages + " Images"
|
||||||
}
|
}
|
||||||
if (SD.activeTasks.size == 0) {
|
if (SD.activeTasks.size == 0) {
|
||||||
|
if (totalImages >= 10000)
|
||||||
|
makeImageBtn.innerText = "Make tens of thousands of images"
|
||||||
|
else
|
||||||
makeImageBtn.innerText = "Make " + imageLabel
|
makeImageBtn.innerText = "Make " + imageLabel
|
||||||
} else {
|
} else {
|
||||||
|
if (totalImages >= 10000)
|
||||||
|
makeImageBtn.innerText = "Enqueue tens of thousands of images"
|
||||||
|
else
|
||||||
makeImageBtn.innerText = "Enqueue Next " + imageLabel
|
makeImageBtn.innerText = "Enqueue Next " + imageLabel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user