Use atlas cues for exact Krea2 POV routes

This commit is contained in:
2026-06-30 21:11:26 +02:00
parent 3832044256
commit 4689cc7942
5 changed files with 215 additions and 8 deletions
+79 -4
View File
@@ -6781,6 +6781,80 @@ def smoke_krea2_pov_pose_variant_catalog() -> None:
_expect(required_keys.issubset(seen_keys), "Krea2 POV pose-variant catalog lost a proven starter variant")
def _atlas_variant_include_key(variant_key: str) -> str:
key = "".join(char if char.isalnum() else "_" for char in str(variant_key).lower().removeprefix("pov_")).strip("_")
while "__" in key:
key = key.replace("__", "_")
return f"include_{key}"
def smoke_krea2_pov_atlas_variant_prompt_routes() -> None:
filter_by_action_family = {
"penetration": "SxCPKrea2POVPenetrationFilter",
"oral": "SxCPKrea2POVOralFilter",
"outercourse": "SxCPKrea2POVOutercourseFilter",
"manual": "SxCPKrea2POVManualFilter",
"toy": "SxCPKrea2POVToyFilter",
"climax": "SxCPKrea2POVClimaxFilter",
"interaction": "SxCPKrea2POVInteractionFilter",
}
variants = krea2_pose_variant_catalog.variants()
_expect(variants, "Krea2 POV atlas prompt route smoke found no variants")
for offset, variant in enumerate(variants, start=4510):
key = _expect_text("krea2_pov_atlas_variant_prompt_routes.key", variant.get("key"), 8)
action_family = _expect_text(f"{key}.action_family", variant.get("action_family"), 3)
node_name = filter_by_action_family.get(action_family)
_expect(node_name in sxcp_nodes.NODE_CLASS_MAPPINGS, f"{key} has no Krea2 POV filter node for action family {action_family!r}")
include_key = _atlas_variant_include_key(key)
node_cls = sxcp_nodes.NODE_CLASS_MAPPINGS[node_name]
_expect(include_key in (node_cls.INPUT_TYPES().get("required") or {}), f"{node_name} does not expose {include_key}")
variant_config = node_cls().build("replace", "", **{include_key: True})[0]
pair = pb.build_insta_of_pair(
row_number=1,
start_index=1,
seed=offset,
ethnicity="any",
figure="random",
no_plus_women=False,
no_black=False,
trigger=Trigger,
prepend_trigger_to_prompt=True,
options_json=_insta_options(
softcore_camera_mode="from_camera_config",
hardcore_camera_mode="from_camera_config",
camera_detail="compact",
),
character_cast=_character_cast(pov_man=True),
hardcore_position_config=variant_config,
location_config=_coworking_location_config(),
hardcore_camera_config=_orbit_camera(
horizontal_angle=45,
vertical_angle=0,
zoom=7.5,
subject_focus="action",
),
)
_expect_pair(pair, f"krea2_pov_atlas_variant_prompt_routes.{key}")
hard_row = pair.get("hardcore_row") or {}
variant_keys = (hard_row.get("hardcore_position_config") or {}).get("krea2_variant_keys") or []
_expect(variant_keys == [key], f"{key} row lost exact variant metadata: {variant_keys}")
krea = krea_formatter.format_krea2_prompt("", metadata_json=_json(pair), target="hardcore")
prompt = _expect_text(f"{key}.krea_prompt", krea.get("krea_prompt"), 80).lower()
for cue in variant.get("prompt_cues") or []:
cue_text = _expect_text(f"{key}.prompt_cue", cue, 8).lower()
_expect(cue_text in prompt, f"{key} final Krea prompt lost atlas cue {cue_text!r}: {prompt}")
_expect(
"framed as " not in prompt and "the image is framed as " not in prompt,
f"{key} final Krea prompt kept generic composition text after atlas route: {prompt}",
)
atlas_geometry = " ".join([str(variant.get("canonical_geometry") or ""), *[str(cue) for cue in variant.get("prompt_cues") or []]]).lower()
if any(term in atlas_geometry for term in ("top-down", "top view", "top-view", "nadir", "overhead")):
_expect("eye-level shot" not in prompt, f"{key} final Krea prompt kept contradictory eye-level camera text: {prompt}")
for avoid in variant.get("avoid_cues") or []:
avoid_text = _expect_text(f"{key}.avoid_cue", avoid, 4).lower()
_expect(avoid_text not in prompt, f"{key} final Krea prompt leaked avoid cue {avoid_text!r}: {prompt}")
def smoke_krea2_pose_variant_catalog_policy() -> None:
catalog = krea2_pose_variant_catalog.load_catalog()
_expect(catalog.get("version") == 1, "Krea2 pose-variant loader returned wrong catalog")
@@ -8390,10 +8464,10 @@ def smoke_pov_oral_position_routes() -> None:
).lower()
for term in (
"pov upright sitting oral position",
"woman sits low between his open thighs",
"face lowered close to the exact center contact point",
"open mouth covers the tip",
"hands stay low at the base",
"woman sits low between the viewer's open thighs",
"face lowers close to the exact center contact point",
"open mouth covers the centered tip",
"hands wrapped low at the base",
):
_expect(term in sitting_variant_prompt, f"Sitting oral variant prompt missing {term!r}: {sitting_variant_prompt}")
_expect(
@@ -12058,6 +12132,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
("insta_pair_camera_split", smoke_insta_pair_camera_split),
("pov_camera_scene", smoke_pov_camera_scene),
("krea2_pov_pose_variant_catalog", smoke_krea2_pov_pose_variant_catalog),
("krea2_pov_atlas_variant_prompt_routes", smoke_krea2_pov_atlas_variant_prompt_routes),
("krea2_pose_variant_catalog_policy", smoke_krea2_pose_variant_catalog_policy),
("krea2_eval_log_policy", smoke_krea2_eval_log_policy),
("krea2_prompt_guide_policy", smoke_krea2_prompt_guide_policy),