mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-22 00:03:20 +01:00
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
|
||||
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)
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user