Naturalize Krea single appearance grammar

This commit is contained in:
2026-06-27 21:34:15 +02:00
parent 4f97057fc4
commit e9bd9c45ca
3 changed files with 30 additions and 1 deletions
+11
View File
@@ -536,6 +536,16 @@ def _caption_expression_grammar_issues(name: str, caption_text: str) -> list[str
return []
def _krea_grammar_issues(name: str, krea_prompt: str) -> list[str]:
if re.search(
r"\b(?:woman|man|person),\s+with\s+[^.;]{0,120}\bfigure\s+with\b",
krea_prompt,
flags=re.IGNORECASE,
):
return [f"{name}.krea_prompt: subject_appearance_with_grammar"]
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:
@@ -670,6 +680,7 @@ def _formatter_issues(
issues.extend(_formatter_trace_issues(name, formats, target=target, row=row))
issues.extend(_caption_cast_descriptor_issues(name, row, caption_text))
issues.extend(_caption_expression_grammar_issues(name, caption_text))
issues.extend(_krea_grammar_issues(name, krea_prompt))
for label, value in (
(f"{name}.krea_negative", krea.get("negative_prompt")),