Clean SDXL composition tags
This commit is contained in:
@@ -569,6 +569,13 @@ def _composition_label_issues(name: str, prompts: dict[str, str]) -> list[str]:
|
||||
return issues
|
||||
|
||||
|
||||
def _sdxl_composition_tag_issues(name: str, sdxl_prompt: str) -> list[str]:
|
||||
for tag in (part.strip() for part in sdxl_prompt.split(",")):
|
||||
if re.search(r"\bcomposition$", tag, flags=re.IGNORECASE):
|
||||
return [f"{name}.sdxl_prompt: composition_tag_label"]
|
||||
return []
|
||||
|
||||
|
||||
def _trace_dict(formatter_name: str, payload: dict[str, Any]) -> tuple[dict[str, Any], str]:
|
||||
trace_text = str(payload.get("route_trace_json") or "")
|
||||
if not trace_text:
|
||||
@@ -705,6 +712,7 @@ def _formatter_issues(
|
||||
issues.extend(_caption_expression_grammar_issues(name, caption_text))
|
||||
issues.extend(_krea_grammar_issues(name, krea_prompt))
|
||||
issues.extend(_composition_label_issues(name, prompts))
|
||||
issues.extend(_sdxl_composition_tag_issues(name, sdxl_prompt))
|
||||
|
||||
for label, value in (
|
||||
(f"{name}.krea_negative", krea.get("negative_prompt")),
|
||||
|
||||
Reference in New Issue
Block a user