Clean SDXL imperative hand tags
This commit is contained in:
+6
-1
@@ -67,7 +67,12 @@ def split_tag_text(text: Any) -> list[str]:
|
||||
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(" .")]
|
||||
tags = []
|
||||
for part in parts:
|
||||
part = re.sub(r"^keep\s+", "", clean(part).strip(" ."), flags=re.IGNORECASE)
|
||||
if part:
|
||||
tags.append(part)
|
||||
return tags
|
||||
|
||||
|
||||
def tag_key(tag: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user