Filter atlas clothing restore foreground cues
This commit is contained in:
@@ -11,6 +11,7 @@ except ImportError: # Allows local smoke tests with top-level imports.
|
||||
|
||||
MOUTH_EXPRESSION_TERMS = ("mouth", "oral", "tongue", "lips", "gagging", "saliva", "drool")
|
||||
TOP_VIEW_ORAL_VARIANT = "pov_blowjob_top_down_vertical_shaft"
|
||||
SIDE_PROFILE_ORAL_VARIANT = "pov_blowjob_side_profile_oral"
|
||||
ORAL_CONTACT_VARIANTS = frozenset(
|
||||
(
|
||||
TOP_VIEW_ORAL_VARIANT,
|
||||
@@ -107,6 +108,46 @@ def _restores_krea2_prompt_axis(row: dict[str, Any], axis_name: str) -> bool:
|
||||
return axis_name in restored_axes
|
||||
|
||||
|
||||
def _side_profile_hidden_lower_clothing_clause(clause: str) -> bool:
|
||||
lower = clause.lower()
|
||||
if "below the hips" in lower or "lower body" in lower:
|
||||
return True
|
||||
return any(
|
||||
term in lower
|
||||
for term in (
|
||||
"panty",
|
||||
"panties",
|
||||
"brief",
|
||||
"briefs",
|
||||
"thong",
|
||||
"shorts",
|
||||
"jeans",
|
||||
"trousers",
|
||||
"pants",
|
||||
"skirt",
|
||||
)
|
||||
) and any(term in lower for term in ("pulled aside", "removed", "lowered", "visible"))
|
||||
|
||||
|
||||
def _krea2_atlas_clothing_text(row: dict[str, Any], text: Any) -> str:
|
||||
clothing = str(text or "").strip()
|
||||
if not clothing or not _has_krea2_atlas_variant(row):
|
||||
return clothing
|
||||
side_profile_oral = _has_krea2_variant(row, SIDE_PROFILE_ORAL_VARIANT)
|
||||
kept: list[str] = []
|
||||
for clause in clothing.split(";"):
|
||||
clause = clause.strip(" .")
|
||||
if not clause:
|
||||
continue
|
||||
lower = clause.lower()
|
||||
if lower.startswith(("pov foreground clothing cue:", "pov foreground body cue:")):
|
||||
continue
|
||||
if side_profile_oral and _side_profile_hidden_lower_clothing_clause(clause):
|
||||
continue
|
||||
kept.append(clause)
|
||||
return "; ".join(kept)
|
||||
|
||||
|
||||
def _has_krea2_top_down_variant(row: dict[str, Any]) -> bool:
|
||||
for key in _krea2_variant_keys(row):
|
||||
variant = krea2_pose_variant_catalog.get_variant(key)
|
||||
@@ -232,6 +273,7 @@ def format_insta_pair_result(request: KreaPairFormatRequest, deps: KreaPairForma
|
||||
),
|
||||
hard_labels,
|
||||
)
|
||||
hard_clothing = _krea2_atlas_clothing_text(hard, hard_clothing)
|
||||
same_soft_cast = options.get("softcore_cast") == "same_as_hardcore"
|
||||
soft_output_composition = deps.pov_composition_text(soft.get("composition"), pov_labels if same_soft_cast else [])
|
||||
soft_cast_presence = deps.softcore_cast_presence_phrase(
|
||||
|
||||
Reference in New Issue
Block a user