Split SDXL sentence-boundary tags

This commit is contained in:
2026-06-27 22:23:49 +02:00
parent 842d3580f5
commit 030a1255e1
3 changed files with 16 additions and 0 deletions
+1
View File
@@ -63,6 +63,7 @@ def split_tag_text(text: Any) -> list[str]:
text,
flags=re.IGNORECASE,
)
text = re.sub(r"(?<=[A-Za-z0-9)])\.\s+(?=[A-Za-z])", ", ", text)
text = re.sub(r"(?<!-)\b(?:and|with)\b(?!-)", ",", text, flags=re.IGNORECASE)
text = re.sub(r"\b(woman|man),\s+(woman|man)\s+are\b", r"\1 and \2 are", text, flags=re.IGNORECASE)
parts = re.split(r"\s*[,;]\s*", text)