diff --git a/py/libs/translate.py b/py/libs/translate.py index ac63dc1..577c92b 100644 --- a/py/libs/translate.py +++ b/py/libs/translate.py @@ -185,7 +185,7 @@ class ChinesePromptTranslate(Transformer): #定义Prompt文法 -grammar = """ +grammar = r""" start: sentence sentence: phrase ("," phrase)* phrase: emphasis | weight | word | lora | embedding | schedule diff --git a/py/libs/wildcards.py b/py/libs/wildcards.py index 28e5ed6..901396a 100644 --- a/py/libs/wildcards.py +++ b/py/libs/wildcards.py @@ -168,7 +168,7 @@ def process(text, seed=None): replacements_found = True string = string.replace(f"__{match}__", replacement, 1) elif '*' in keyword: - subpattern = keyword.replace('*', '.*').replace('+','\+') + subpattern = keyword.replace('*', '.*').replace('+', r'\+') total_patterns = [] found = False for k, v in easy_wildcard_dict.items(): diff --git a/py/logic.py b/py/logic.py index 40b3b15..2789df8 100644 --- a/py/logic.py +++ b/py/logic.py @@ -1728,7 +1728,7 @@ class saveText: if not os.path.isabs(output_file_path): output_path = os.path.join(self.output_dir, output_path) base_output = os.path.basename(output_path) - if output_path.endswith("ComfyUI/output") or output_path.endswith("ComfyUI\output"): + if output_path.endswith("ComfyUI/output") or output_path.endswith(r"ComfyUI\output"): base_output = "" # Check output destination