diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-06-27 09:02:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 09:02:38 +0300 |
commit | 58a9a261c4feb729717c386fea70f8ea985c6722 (patch) | |
tree | ebc822c17a889034672297d7450477f7c945cbb7 /modules/prompt_parser.py | |
parent | 373ff5a217eca33607abb692b9ebfa38abb7fe33 (diff) | |
parent | 2c43dd766da52d2ccaaa78d8f265a6a4aa33b9df (diff) |
Merge branch 'dev' into meta_class
Diffstat (limited to 'modules/prompt_parser.py')
-rw-r--r-- | modules/prompt_parser.py | 6 |
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)
|