From 9155d940674d8f90c927920b60e0ce066ae0cf16 Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:22:24 +0100 Subject: [PATCH] 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 --- modules/sdxl_styles.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/sdxl_styles.py b/modules/sdxl_styles.py index 71afc402..2a310024 100644 --- a/modules/sdxl_styles.py +++ b/modules/sdxl_styles.py @@ -94,9 +94,8 @@ def get_words(arrays, totalMult, index): return [word] + get_words(arrays[1:], math.floor(totalMult/len(words)), index) - def apply_arrays(text, index): - arrays = re.findall(r'\[\[([\s,\w-]+)\]\]', text) + arrays = re.findall(r'\[\[(.*?)\]\]', text) if len(arrays) == 0: return text