Keep SDXL character tags metadata driven

This commit is contained in:
2026-06-27 17:22:13 +02:00
parent 7c615bdf7b
commit f110ee6a89
3 changed files with 52 additions and 7 deletions
+49
View File
@@ -4417,6 +4417,32 @@ def smoke_sdxl_tag_policy() -> None:
_expect(deps.explicit_tags is sdxl_tag_policy.explicit_tags, "SDXL route deps lost explicit tag policy")
_expect(deps.softcore_pair_tags is sdxl_tag_policy.softcore_pair_tags, "SDXL route deps lost softcore pair tag policy")
stale_character_row = {
"prompt": "Characters: 99-year-old adult man, stale body, stale skin, stale hair, stale eyes.",
"age_band": "27-year-old adult",
"subject_phrase": "woman",
"body_phrase": "athletic figure",
"skin": "warm olive skin",
"hair": "short black hair",
"eyes": "green eyes",
}
stale_character_tags = sdxl_tag_policy.normal_character_tags(stale_character_row)
_expect("27-year-old adult" in stale_character_tags, "SDXL character tags lost structured age")
_expect("warm olive skin" in stale_character_tags, "SDXL character tags lost structured skin")
_expect(
all("stale" not in tag for tag in stale_character_tags),
"SDXL character tags should not parse stale raw prompt character labels",
)
descriptor_tags = sdxl_tag_policy.normal_character_tags(
{
"prompt": "Characters: stale prompt descriptor.",
"cast_descriptor_text": "Woman A: 30-year-old adult woman, toned figure, fair skin, red hair, gray eyes",
}
)
_expect("30-year-old adult woman" in descriptor_tags, "SDXL character tags lost cast descriptor metadata")
_expect("toned build" in descriptor_tags, "SDXL character tags did not normalize descriptor figure tag")
_expect(all("stale" not in tag for tag in descriptor_tags), "SDXL cast descriptor metadata should beat stale prompt labels")
def smoke_sdxl_tag_routes() -> None:
row = _fixture_hardcore_row(
@@ -4435,6 +4461,29 @@ def smoke_sdxl_tag_routes() -> None:
"Typed SDXL row tag route should match legacy wrapper output",
)
_expect("sdxl route tag" in typed_row.as_text(), "Typed SDXL row tag route lost route-specific formatter hint")
stale_character_route_row = _fixture_hardcore_row(
prompt="Characters: stale prompt subject, stale body, stale skin, stale hair, stale eyes.",
cast_descriptor_text="",
cast_descriptors=[],
subject_type="woman",
subject_phrase="woman",
primary_subject="woman",
age_band="27-year-old adult",
body_phrase="athletic figure",
skin="warm olive skin",
hair="short black hair",
eyes="green eyes",
women_count=1,
men_count=0,
person_count=1,
)
stale_character_route_tags = sdxl_tag_routes.row_core_tags_result(
sdxl_tag_routes.SDXLRowTagRequest(stale_character_route_row, 1.29),
deps,
).as_text()
_expect("27-year-old adult" in stale_character_route_tags, "SDXL route lost structured character age")
_expect("warm olive skin" in stale_character_route_tags, "SDXL route lost structured character skin")
_expect("stale" not in stale_character_route_tags, "SDXL route should not parse stale prompt character labels")
stale_prompt_row = _fixture_hardcore_row(
prompt="stale raw prompt mentions fully nude naked pussy penis oral anal semen penetration",
item="standing portrait setup",