Clean SDXL paired character tags

This commit is contained in:
2026-06-27 22:18:52 +02:00
parent 15b28b422f
commit 842d3580f5
3 changed files with 11 additions and 0 deletions
+1
View File
@@ -64,6 +64,7 @@ def split_tag_text(text: Any) -> list[str]:
flags=re.IGNORECASE,
)
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)
return [clean(part).strip(" .") for part in parts if clean(part).strip(" .")]