From 4127f4aff8aff3d72bdd47224fabf9697633b352 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Thu, 29 Sep 2022 11:39:55 +0300 Subject: [PATCH] fix program breaking on empty prompt --- modules/prompt_parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py index f3c50adfa..e811eb9ec 100644 --- a/modules/prompt_parser.py +++ b/modules/prompt_parser.py @@ -212,4 +212,7 @@ def parse_prompt_attention(text): for pos in square_brackets: multiply_range(pos, square_bracket_multiplier) + if len(res) == 0: + res = [["", 1.0]] + return res