mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-28 10:42:32 -08:00
Simplify a bunch of len(x) > 0/len(x) == 0 style expressions
This commit is contained in:
parent
3e995778fc
commit
51864790fd
25 changed files with 47 additions and 48 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue