Clean SDXL paired character tags
This commit is contained in:
@@ -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(" .")]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user