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

Function applyPermuteOperatorNumber

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

Source from the content-addressed store, hash-verified

1641
1642// returns how many prompts would have to be made with the given prompts
1643function applyPermuteOperatorNumber(prompts) {
1644 // prompts is array of input, trimmed, filtered and split by \n
1645 let numberOfPrompts = 0
1646 prompts.forEach((prompt) => {
1647 let promptCounter = 1
1648 let promptMatrix = prompt.split("|")
1649 promptMatrix.shift()
1650
1651 promptMatrix = promptMatrix.map((p) => p.trim())
1652 promptMatrix = promptMatrix.filter((p) => p !== "")
1653
1654 if (promptMatrix.length > 0) {
1655 promptCounter *= permuteNumber(promptMatrix)
1656 }
1657 numberOfPrompts += promptCounter
1658 })
1659
1660 return numberOfPrompts
1661}
1662
1663function permutePrompts(promptBase, promptMatrix) {
1664 let prompts = []

Callers 1

getPromptsNumberFunction · 0.85

Calls 2

permuteNumberFunction · 0.85
shiftMethod · 0.80

Tested by

no test coverage detected