forked from extern/easydiffusion
Fix for prompt number calculation with empty or single-element set
This commit is contained in:
parent
800f275e91
commit
3a7281df3c
@ -1347,7 +1347,7 @@ function getPromptsNumber(prompts) {
|
|||||||
// estimate number of prompts
|
// estimate number of prompts
|
||||||
let estimatedNumberOfPrompts = 0
|
let estimatedNumberOfPrompts = 0
|
||||||
prompts.forEach((prompt) => {
|
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)
|
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) {
|
if (estimatedNumberOfPrompts >= 10000) {
|
||||||
|
Loading…
Reference in New Issue
Block a user