aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-10-06 10:21:12 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-10-06 10:21:12 +0000
commit2d3ea42a2d1e909bbccdb6b49561b187c60a9402 (patch)
treefb5fc96cccc10ff2ea9171cf13a8e3becd589119
parent5f24b7bcf4a074fbdec757617fcd1bc82e76551b (diff)
downloadstable-diffusion-webui-gfx803-2d3ea42a2d1e909bbccdb6b49561b187c60a9402.tar.gz
stable-diffusion-webui-gfx803-2d3ea42a2d1e909bbccdb6b49561b187c60a9402.tar.bz2
stable-diffusion-webui-gfx803-2d3ea42a2d1e909bbccdb6b49561b187c60a9402.zip
workaround for a mysterious bug where prompt weights can't be matched
-rw-r--r--modules/prompt_parser.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py
index a7a6aa31..f00256f2 100644
--- a/modules/prompt_parser.py
+++ b/modules/prompt_parser.py
@@ -156,7 +156,9 @@ def get_multicond_prompt_list(prompts):
indexes = []
for subprompt in subprompts:
- text, weight = re_weight.search(subprompt).groups()
+ match = re_weight.search(subprompt)
+
+ text, weight = match.groups() if match is not None else (subprompt, 1.0)
weight = float(weight) if weight is not None else 1.0