Extract shared POV policy

This commit is contained in:
2026-06-27 03:22:25 +02:00
parent 9ca2320df2
commit 61535cc60d
6 changed files with 197 additions and 96 deletions
+28
View File
@@ -42,6 +42,7 @@ import krea_formatter # noqa: E402
import location_config # noqa: E402
import loop_nodes # noqa: E402
import prompt_builder as pb # noqa: E402
import pov_policy # noqa: E402
import row_normalization # noqa: E402
import route_metadata # noqa: E402
import row_camera # noqa: E402
@@ -50,6 +51,7 @@ import server_routes # noqa: E402
import sdxl_formatter # noqa: E402
import sdxl_presets # noqa: E402
import seed_config # noqa: E402
import krea_pov # noqa: E402
Trigger = "sxcppnl7"
@@ -798,6 +800,32 @@ def smoke_character_config_policy() -> None:
_expect(hair.get("styles") == ["messy_bun", "straight"], "Hair style config merge changed")
_expect(pb._hair_phrase_from_parts("platinum_blonde", "long", "messy_bun") == "long platinum-blonde hair in a messy bun", "Hair phrase helper changed")
_expect(character_config.normalize_presence_mode("pov", "woman") == "visible", "POV presence should stay man-only")
pov_slot = {"subject_type": "man", "presence_mode": "pov"}
visible_slot = {"subject_type": "man", "presence_mode": "visible"}
_expect(pb._slot_is_pov(pov_slot) is True, "Prompt builder POV slot helper should delegate to POV policy")
_expect(pov_policy.slot_is_pov(visible_slot) is False, "Visible man slot should not be POV")
_expect(
pb._pov_character_labels({"Man A": pov_slot, "Man B": visible_slot}, 2) == ["Man A"],
"POV label selection should keep only POV men in count order",
)
_expect(
pb._pov_role_graph_prompt("Man A is positioned behind Woman A", ["Man A"])
== "First-person POV from Man A; the POV camera is positioned behind Woman A",
"Builder POV role graph prompt should use shared viewer replacement",
)
_expect(
pb._pov_composition_prompt("wide group-sex composition with all bodies visible", ["Man A"])
== "first-person group-sex POV composition with visible partners readable",
"Builder POV composition prompt should use shared POV composition replacements",
)
_expect(
krea_pov.pov_composition_text(
"wide group-sex composition with all bodies visible, adapted for first-person POV with the POV participant kept off-camera",
["Man A"],
)
== "first-person group-sex POV composition with visible partners readable",
"Krea POV composition cleanup should delegate shared replacements and strip builder annotation",
)
_expect(character_config.normalize_slot_seed(0xFFFFFFFF + 99) == 0xFFFFFFFF, "Slot seed clamp changed")