aboutsummaryrefslogtreecommitdiffstats
path: root/modules/prompt_parser.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-27 06:23:15 +0000
committerGitHub <noreply@github.com>2023-06-27 06:23:15 +0000
commit0b97ae2832a89b103be1c062d7778e558732712f (patch)
tree6d0966156f1cfa78aa0e97ed0474afaffc50f2cd /modules/prompt_parser.py
parent7e2d39a2d158d1426321686b05d31a3ea694a99e (diff)
parent3cd4fd51ef916aba8b978490569a5da82795a839 (diff)
downloadstable-diffusion-webui-gfx803-0b97ae2832a89b103be1c062d7778e558732712f.tar.gz
stable-diffusion-webui-gfx803-0b97ae2832a89b103be1c062d7778e558732712f.tar.bz2
stable-diffusion-webui-gfx803-0b97ae2832a89b103be1c062d7778e558732712f.zip
Merge branch 'dev' into master
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)