Use route-owned formatter style choices

This commit is contained in:
2026-06-27 14:04:00 +02:00
parent 4fdef3875b
commit c34886b362
4 changed files with 31 additions and 5 deletions
+7
View File
@@ -2989,6 +2989,9 @@ def smoke_krea_format_route_policy() -> None:
_expect(typed_fallback.target == "auto", "Typed Krea format route should normalize invalid target")
_expect(typed_fallback.detail_level == "balanced", "Typed Krea format route should normalize invalid detail level")
_expect(typed_fallback.style_mode == "preserve", "Typed Krea format route should normalize invalid style mode")
_expect(krea_format_route.style_mode_choices() == ["preserve", "photographic", "minimal"], "Krea style mode choices changed")
_expect(krea_format_route.normalize_style_mode("photographic") == "photographic", "Krea style mode lost photographic")
_expect(krea_format_route.normalize_style_mode("bad") == "preserve", "Krea style mode invalid fallback changed")
_expect("blur" in typed_fallback.output.get("negative_prompt", ""), "Typed Krea fallback route lost Avoid negative")
@@ -3035,6 +3038,8 @@ def smoke_caption_policy() -> None:
"Caption naturalizer action labels should delegate to caption_policy",
)
_expect(caption_policy.normalize_detail_level("bad") == "balanced", "Caption invalid detail fallback changed")
_expect(caption_policy.normalize_style_policy("bad") == "drop_style_tail", "Caption invalid style fallback changed")
_expect(caption_policy.style_policy_choices() == ["drop_style_tail", "keep_style_terms"], "Caption style policy choices changed")
_expect(caption_policy.keep_style_terms("keep_style_terms") is True, "Caption style policy keep flag changed")
_expect(caption_policy.detail_allows("concise") is False, "Caption concise detail gate changed")
_expect(caption_policy.detail_allows("dense", dense_only=True) is True, "Caption dense-only gate changed")
@@ -6309,9 +6314,11 @@ def smoke_node_formatter_registration() -> None:
_expect("target" in caption_inputs, "Caption Naturalizer lost target input")
_expect(caption_inputs["target"][0] == formatter_target.target_choices(), "Caption Naturalizer target choices drifted")
_expect(caption_inputs["detail_level"][0] == formatter_detail.detail_level_choices(), "Caption Naturalizer detail choices drifted")
_expect(caption_inputs["style_policy"][0] == caption_policy.style_policy_choices(), "Caption Naturalizer style choices drifted")
_expect("tooltip" in caption_inputs["caption_profile"][1], "Caption profile tooltip injection missing")
_expect(krea_inputs["target"][0] == formatter_target.target_choices(), "Krea2 Formatter target choices drifted")
_expect(krea_inputs["detail_level"][0] == formatter_detail.detail_level_choices(), "Krea2 Formatter detail choices drifted")
_expect(krea_inputs["style_mode"][0] == krea_format_route.style_mode_choices(), "Krea2 Formatter style choices drifted")
krea_output = krea_node().build(
"sxcppnl7 A woman standing by a window",