Centralize softcore pair wording
This commit is contained in:
+30
-6
@@ -145,6 +145,21 @@ def _expect_no_duplicate_comma_items(name: str, value: Any) -> None:
|
||||
_expect(not duplicates, f"{name} has duplicate comma items: {duplicates[:5]}")
|
||||
|
||||
|
||||
def _expect_no_softcore_noise(name: str, value: Any) -> None:
|
||||
text = str(value or "").lower()
|
||||
noisy = (
|
||||
"the image focuses",
|
||||
"softcore version",
|
||||
"non-explicit teaser setup",
|
||||
"no sex act",
|
||||
"genital contact",
|
||||
"keep the softcore version",
|
||||
"focused on woman a alone",
|
||||
)
|
||||
found = [phrase for phrase in noisy if phrase in text]
|
||||
_expect(not found, f"{name} has softcore prompt noise: {found}")
|
||||
|
||||
|
||||
def _trigger_count(text: str, trigger: str) -> int:
|
||||
return len(re.findall(rf"(?<![a-z0-9_]){re.escape(trigger)}(?![a-z0-9_])", text, flags=re.IGNORECASE))
|
||||
|
||||
@@ -3850,10 +3865,10 @@ def smoke_caption_metadata_routes() -> None:
|
||||
_expect(hard_route is not None, "Caption pair hardcore target did not match")
|
||||
assert soft_route is not None
|
||||
assert hard_route is not None
|
||||
_expect("Softcore version:" not in soft_route.prose, "Caption softcore target should not keep combined pair labels")
|
||||
_expect("Hardcore version:" not in soft_route.prose, "Caption softcore target should not include hard label")
|
||||
_expect("Softcore version:" not in hard_route.prose, "Caption hardcore target should not include soft label")
|
||||
_expect("Hardcore version:" not in hard_route.prose, "Caption hardcore target should not keep combined pair labels")
|
||||
_expect("Softcore side:" not in soft_route.prose, "Caption softcore target should not keep combined pair labels")
|
||||
_expect("Hardcore side:" not in soft_route.prose, "Caption softcore target should not include hard label")
|
||||
_expect("Softcore side:" not in hard_route.prose, "Caption hardcore target should not include soft label")
|
||||
_expect("Hardcore side:" not in hard_route.prose, "Caption hardcore target should not keep combined pair labels")
|
||||
_expect(soft_route.prose != hard_route.prose, "Caption pair soft/hard targets should produce distinct prose")
|
||||
public_hard, public_hard_method = caption_naturalizer.naturalize_caption(
|
||||
"",
|
||||
@@ -5368,6 +5383,12 @@ def smoke_insta_pair() -> None:
|
||||
)
|
||||
_expect_pair(pair, "insta_pair_same_cast")
|
||||
_expect(pair["softcore_row"].get("scene_text") == pair["hardcore_row"].get("scene_text"), "pair scene continuity broke")
|
||||
_expect_no_softcore_noise("insta_pair_same_cast.softcore_prompt", pair.get("softcore_prompt"))
|
||||
_expect("styled creator-teaser frame" in str(pair.get("softcore_prompt", "")).lower(), "pair softcore prompt lost clean cast-presence wording")
|
||||
krea_soft = krea_formatter.format_krea2_prompt("", metadata_json=_json(pair), target="softcore")
|
||||
krea_soft_prompt = _expect_text("insta_pair_same_cast.krea_soft_prompt", krea_soft.get("krea_prompt"), 40)
|
||||
_expect_no_softcore_noise("insta_pair_same_cast.krea_soft_prompt", krea_soft_prompt)
|
||||
_expect("styled creator-teaser frame" in krea_soft_prompt.lower(), "Krea softcore prompt lost clean same-cast wording")
|
||||
clothing_state = _clean_key(pair.get("hardcore_clothing_state"))
|
||||
_expect("body is fully exposed" in clothing_state, "explicit nude pair should keep body exposure state")
|
||||
_expect("teaser outfit detail" not in clothing_state, "explicit nude pair should not repeat softcore outfit detail")
|
||||
@@ -6546,6 +6567,8 @@ def smoke_formatter_metadata_fixtures() -> None:
|
||||
krea_hard = _expect_text("fixture_external_pair.krea_hard", krea_pair.get("krea_hardcore_prompt"), 40).lower()
|
||||
_expect(krea_pair.get("method") == "metadata_json:krea2(insta_of_pair)", "External pair Krea route changed method")
|
||||
_expect("black buttoned shirt" in krea_soft, "External pair Krea soft route lost embedded partner styling")
|
||||
_expect_no_softcore_noise("fixture_external_pair.krea_soft", krea_pair.get("krea_softcore_prompt"))
|
||||
_expect("styled creator-teaser frame" in krea_soft, "External pair Krea soft route lost clean cast-presence wording")
|
||||
_expect("red satin lingerie set" in krea_hard, "External pair Krea hard route lost embedded clothing state")
|
||||
_expect("row hard right-side view" in krea_hard, "External pair Krea hard route lost embedded camera directive")
|
||||
_expect_no_duplicate_comma_items("fixture_external_pair.krea_negative", krea_pair.get("negative_prompt"))
|
||||
@@ -6578,8 +6601,9 @@ def smoke_formatter_metadata_fixtures() -> None:
|
||||
_expect(method == "metadata_json:metadata(insta_of_pair)", "External pair caption route changed method")
|
||||
_expect_trigger_once("fixture_external_pair.caption", caption, Trigger)
|
||||
_expect("black buttoned shirt" in caption_text, "External pair caption route lost embedded partner styling")
|
||||
_expect("softcore version" in caption_text, "External pair caption route lost softcore side")
|
||||
_expect("hardcore version" in caption_text, "External pair caption route lost hardcore side")
|
||||
_expect("softcore side" in caption_text, "External pair caption route lost softcore side")
|
||||
_expect("hardcore side" in caption_text, "External pair caption route lost hardcore side")
|
||||
_expect("softcore version" not in caption_text and "hardcore version" not in caption_text, "External pair caption kept version labels")
|
||||
|
||||
generated = _prompt_row(
|
||||
name="fixture_generated_formatter_invariants",
|
||||
|
||||
Reference in New Issue
Block a user