aboutsummaryrefslogtreecommitdiff
path: root/modules/prompt_parser.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-06-27 08:38:14 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-06-27 08:38:14 +0300
commit394ffa7b0a7fff3ec484bcd084e673a8b301ccc8 (patch)
treeb0e9b9d93f90b5d50084292a48578bd4f9a83ec6 /modules/prompt_parser.py
parentbaf6946e06249c5af9851c60171692c44ef633e0 (diff)
parentdbc88c96450793b08b520f3b86cd46d6aeaaae52 (diff)
Merge branch 'release_candidate'
Diffstat (limited to 'modules/prompt_parser.py')
-rw-r--r--modules/prompt_parser.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py
index b4aff704..0069d8b0 100644
--- a/modules/prompt_parser.py
+++ b/modules/prompt_parser.py
@@ -336,11 +336,11 @@ def parse_prompt_attention(text):
round_brackets.append(len(res))
elif text == '[':
square_brackets.append(len(res))
- elif weight is not None and len(round_brackets) > 0:
+ elif weight is not None and round_brackets:
multiply_range(round_brackets.pop(), float(weight))
- elif text == ')' and len(round_brackets) > 0:
+ elif text == ')' and round_brackets:
multiply_range(round_brackets.pop(), round_bracket_multiplier)
- elif text == ']' and len(square_brackets) > 0:
+ elif text == ']' and square_brackets:
multiply_range(square_brackets.pop(), square_bracket_multiplier)
else:
parts = re.split(re_break, text)