浏览代码

fix various float parsing errors

AUTOMATIC 2 年之前
父节点
当前提交
f8e41a96bb
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      modules/prompt_parser.py

+ 1 - 2
modules/prompt_parser.py

@@ -143,8 +143,7 @@ def get_learned_conditioning(model, prompts, steps):
 
 
 
 
 re_AND = re.compile(r"\bAND\b")
 re_AND = re.compile(r"\bAND\b")
-re_weight = re.compile(r"^(.*?)(?:\s*:\s*([-+]?\s*(?:\d+|\d*\.\d+)?))?\s*$")
-
+re_weight = re.compile(r"^(.*?)(?:\s*:\s*([-+]?(?:\d+\.?|\d*\.\d+)))?\s*$")
 
 
 def get_multicond_prompt_list(prompts):
 def get_multicond_prompt_list(prompts):
     res_indexes = []
     res_indexes = []