mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-02-23 13:51:51 +01:00
Allow empty prompts (image modifiers only)
Allows empty prompts as long as there are image modifiers. This allows the user to craft prompts just by using image modifiers if they so wish.
This commit is contained in:
parent
cdfef16a0e
commit
127949c56b
@ -917,20 +917,29 @@ function getPrompts(prompts) {
|
|||||||
if (typeof prompts === 'undefined') {
|
if (typeof prompts === 'undefined') {
|
||||||
prompts = promptField.value
|
prompts = promptField.value
|
||||||
}
|
}
|
||||||
if (prompts.trim() === '') {
|
if (prompts.trim() === '' && activeTags.length === 0) {
|
||||||
return ['']
|
return ['']
|
||||||
}
|
}
|
||||||
|
|
||||||
prompts = prompts.split('\n')
|
let promptsToMake = []
|
||||||
prompts = prompts.map(prompt => prompt.trim())
|
if (prompts.trim() !== '') {
|
||||||
prompts = prompts.filter(prompt => prompt !== '')
|
prompts = prompts.split('\n')
|
||||||
|
prompts = prompts.map(prompt => prompt.trim())
|
||||||
let promptsToMake = applyPermuteOperator(prompts)
|
prompts = prompts.filter(prompt => prompt !== '')
|
||||||
promptsToMake = applySetOperator(promptsToMake)
|
|
||||||
|
promptsToMake = applyPermuteOperator(prompts)
|
||||||
|
promptsToMake = applySetOperator(promptsToMake)
|
||||||
|
}
|
||||||
const newTags = activeTags.filter(tag => tag.inactive === undefined || tag.inactive === false)
|
const newTags = activeTags.filter(tag => tag.inactive === undefined || tag.inactive === false)
|
||||||
if (newTags.length > 0) {
|
if (newTags.length > 0) {
|
||||||
const promptTags = newTags.map(x => x.name).join(", ")
|
const promptTags = newTags.map(x => x.name).join(", ")
|
||||||
promptsToMake = promptsToMake.map((prompt) => `${prompt}, ${promptTags}`)
|
if (promptsToMake.length > 0) {
|
||||||
|
promptsToMake = promptsToMake.map((prompt) => `${prompt}, ${promptTags}`)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
promptsToMake.push(promptTags)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
promptsToMake = applyPermuteOperator(promptsToMake)
|
promptsToMake = applyPermuteOperator(promptsToMake)
|
||||||
|
Loading…
Reference in New Issue
Block a user