fix SyntaxWarning in python 3.12

Signed-off-by: Bob Du <i@bobdu.cc>
This commit is contained in:
Bob Du
2024-12-25 23:28:21 +08:00
parent b26fcef6d7
commit f5efee7f23
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ class ChinesePromptTranslate(Transformer):
#定义Prompt文法
grammar = """
grammar = r"""
start: sentence
sentence: phrase ("," phrase)*
phrase: emphasis | weight | word | lora | embedding | schedule
+1 -1
View File
@@ -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():
+1 -1
View File
@@ -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