MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / applyPermuteOperator

Function applyPermuteOperator

ui/media/js/main.js:1622–1640  ·  view source on GitHub ↗
(prompts)

Source from the content-addressed store, hash-verified

1620}
1621
1622function applyPermuteOperator(prompts) {
1623 // prompts is array of input, trimmed, filtered and split by \n
1624 let promptsToMake = []
1625 prompts.forEach((prompt) => {
1626 let promptMatrix = prompt.split("|")
1627 prompt = promptMatrix.shift().trim()
1628 promptsToMake.push(prompt)
1629
1630 promptMatrix = promptMatrix.map((p) => p.trim())
1631 promptMatrix = promptMatrix.filter((p) => p !== "")
1632
1633 if (promptMatrix.length > 0) {
1634 let promptPermutations = permutePrompts(prompt, promptMatrix)
1635 promptsToMake = promptsToMake.concat(promptPermutations)
1636 }
1637 })
1638
1639 return promptsToMake
1640}
1641
1642// returns how many prompts would have to be made with the given prompts
1643function applyPermuteOperatorNumber(prompts) {

Callers 1

getPromptsFunction · 0.85

Calls 3

permutePromptsFunction · 0.85
shiftMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected