mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: match anything in array syntax, not only words and whitespace (#2438)
allows e.g. [[ (red:1.1), (blue:1.2) ]] and enables same seed checks for different prompt weight
This commit is contained in:
@@ -94,9 +94,8 @@ def get_words(arrays, totalMult, index):
|
|||||||
return [word] + get_words(arrays[1:], math.floor(totalMult/len(words)), index)
|
return [word] + get_words(arrays[1:], math.floor(totalMult/len(words)), index)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def apply_arrays(text, index):
|
def apply_arrays(text, index):
|
||||||
arrays = re.findall(r'\[\[([\s,\w-]+)\]\]', text)
|
arrays = re.findall(r'\[\[(.*?)\]\]', text)
|
||||||
if len(arrays) == 0:
|
if len(arrays) == 0:
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user