aboutsummaryrefslogtreecommitdiff
path: root/modules/prompt_parser.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-08 15:10:10 +0300
committerGitHub <noreply@github.com>2023-07-08 15:10:10 +0300
commitec9bbda3da846b4aa2f03b1e0f0952ffbc61f4f6 (patch)
tree5ae676b6ac7242ad082ab7421cf8ae9d50d52818 /modules/prompt_parser.py
parentc4c63dd5e4760c56405cef2e71abc5c3604c4578 (diff)
parent18256c5f0174126cb103afece2b39b6b831e034a (diff)
Merge branch 'dev' into img2img-batch-png-info
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)