Split Krea camera layout sentence

This commit is contained in:
2026-06-27 21:54:07 +02:00
parent 221659a58d
commit 42857e938e
3 changed files with 15 additions and 3 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ def format_normal_row_result(
style if detail_level != "concise" else "", style if detail_level != "concise" else "",
] ]
return KreaNormalRowPrompt( return KreaNormalRowPrompt(
deps.paragraph([", ".join(part for part in parts[:6] if part), *parts[6:]]), deps.paragraph([", ".join(part for part in parts[:5] if part), *parts[5:]]),
"metadata(single)", "metadata(single)",
) )
+5 -2
View File
@@ -539,13 +539,16 @@ def _caption_expression_grammar_issues(name: str, caption_text: str) -> list[str
def _krea_grammar_issues(name: str, krea_prompt: str) -> list[str]: def _krea_grammar_issues(name: str, krea_prompt: str) -> list[str]:
issues: list[str] = []
if re.search( if re.search(
r"\b(?:woman|man|person),\s+with\s+[^.;]{0,120}\bfigure\s+with\b", r"\b(?:woman|man|person),\s+with\s+[^.;]{0,120}\bfigure\s+with\b",
krea_prompt, krea_prompt,
flags=re.IGNORECASE, flags=re.IGNORECASE,
): ):
return [f"{name}.krea_prompt: subject_appearance_with_grammar"] issues.append(f"{name}.krea_prompt: subject_appearance_with_grammar")
return [] if re.search(r",\s+[A-Z][A-Za-z -]+ camera layout\b", krea_prompt):
issues.append(f"{name}.krea_prompt: comma_joined_camera_layout")
return issues
def _composition_label_issues(name: str, prompts: dict[str, str]) -> list[str]: def _composition_label_issues(name: str, prompts: dict[str, str]) -> list[str]:
+9
View File
@@ -1426,6 +1426,7 @@ def smoke_krea_normal_row_routes() -> None:
"item": "silk dress", "item": "silk dress",
"pose": "standing beside a window", "pose": "standing beside a window",
"scene_text": "quiet studio with warm daylight", "scene_text": "quiet studio with warm daylight",
"camera_scene_directive": "Camera-aware studio layout with window depth.",
"expression": "soft smile", "expression": "soft smile",
"composition": "vertical centered portrait", "composition": "vertical centered portrait",
"camera_directive": "Camera: eye-level medium shot", "camera_directive": "Camera: eye-level medium shot",
@@ -1454,6 +1455,14 @@ def smoke_krea_normal_row_routes() -> None:
"adult woman, showing slim busty figure with" not in figure_note_prompt, "adult woman, showing slim busty figure with" not in figure_note_prompt,
"Krea single route kept awkward showing figure-note grammar", "Krea single route kept awkward showing figure-note grammar",
) )
_expect(
"warm daylight, Camera-aware studio layout" not in figure_note_prompt,
"Krea single route joined camera-scene directive to scene with a comma",
)
_expect(
"warm daylight. Camera-aware studio layout" in figure_note_prompt,
"Krea single route did not split camera-scene directive into its own sentence",
)
style_metadata = dict( style_metadata = dict(
single, single,
style="metadata style phrase", style="metadata style phrase",