Add separate style pool config
This commit is contained in:
@@ -477,6 +477,7 @@ def _prompt_row(
|
||||
camera_config: str | dict[str, Any] | None = "",
|
||||
location_config: str | dict[str, Any] | None = "",
|
||||
composition_config: str | dict[str, Any] | None = "",
|
||||
style_config: str | dict[str, Any] | None = "",
|
||||
) -> dict[str, Any]:
|
||||
row = pb.build_prompt(
|
||||
category=category,
|
||||
@@ -507,6 +508,7 @@ def _prompt_row(
|
||||
camera_config=camera_config,
|
||||
location_config=location_config,
|
||||
composition_config=composition_config,
|
||||
style_config=style_config,
|
||||
)
|
||||
_expect_row_base(row, name)
|
||||
return row
|
||||
@@ -3385,6 +3387,16 @@ def smoke_row_rendering_policy() -> None:
|
||||
_expect(default_text_fields.positive_suffix == row_rendering.GENERIC_POSITIVE_SUFFIX, "Row text fields lost suffix default")
|
||||
_expect(default_text_fields.style == row_rendering.DEFAULT_STYLE, "Row text fields lost style default")
|
||||
_expect(default_text_fields.item_label == "Default Category", "Row text fields lost category-name label default")
|
||||
style_config = pb.build_style_config_json(preset="comic_pinup_colored_pencil")
|
||||
styled_fields = row_rendering.resolve_row_text_fields(category_text, subcategory_text, item_text, style_config)
|
||||
_expect("comic pin-up" in styled_fields.style, "Style Pool did not override row style")
|
||||
_expect("comic linework" in styled_fields.positive_suffix, "Style Pool did not override row style suffix")
|
||||
negative_style_config = pb.build_style_config_json(
|
||||
preset="realistic_photo",
|
||||
custom_negative="flat vector, comic paper texture",
|
||||
)
|
||||
negative_fields = row_rendering.resolve_row_text_fields(category_text, subcategory_text, item_text, negative_style_config)
|
||||
_expect("comic paper texture" in negative_fields.negative_prompt, "Style Pool did not merge style negatives")
|
||||
|
||||
context = {
|
||||
"trigger": Trigger,
|
||||
@@ -5713,6 +5725,20 @@ def smoke_hardcore_category_routes() -> None:
|
||||
_expect(sdxl_tag in (sdxl.get("sdxl_prompt") or "").lower(), f"{name} SDXL prompt did not include family tag {sdxl_tag!r}")
|
||||
caption, _method = caption_naturalizer.naturalize_caption("", metadata_json=_json(row), trigger=Trigger, include_trigger=True)
|
||||
_expect(caption_label in caption.lower(), f"{name} caption did not include family label {caption_label!r}")
|
||||
styled_row = _prompt_row(
|
||||
name="hardcore_style_pool_override",
|
||||
category="Hardcore sexual poses",
|
||||
subcategory="Penetrative sex",
|
||||
seed=1181,
|
||||
character_cast=cast,
|
||||
women_count=1,
|
||||
men_count=1,
|
||||
hardcore_position_config=_action_filter("penetration_only"),
|
||||
style_config=pb.build_style_config_json(preset="comic_pinup_colored_pencil"),
|
||||
)
|
||||
_expect("comic pin-up" in styled_row.get("style", ""), "Style Pool did not reach generated hardcore row style")
|
||||
_expect("comic linework" in styled_row.get("positive_suffix", ""), "Style Pool did not reach generated hardcore row suffix")
|
||||
_expect("comic pin-up" in styled_row.get("prompt", ""), "Style Pool style was not rendered into hardcore prompt")
|
||||
multi_cases = [
|
||||
("hardcore_threesome", "Threesomes", "threesome_only", "threesome", {"threesome", "toy_double"}, "threesome", "three-person action", 1, 2),
|
||||
("hardcore_group", "Group sex and orgy", "group_only", "group", {"group", "toy_double"}, "group sex", "group action", 2, 2),
|
||||
@@ -8239,6 +8265,7 @@ def smoke_node_route_config_registration() -> None:
|
||||
"SxCPLocationPool",
|
||||
"SxCPCompositionPool",
|
||||
"SxCPLocationTheme",
|
||||
"SxCPStylePool",
|
||||
"SxCPCastControl",
|
||||
"SxCPCastBias",
|
||||
]
|
||||
@@ -8286,6 +8313,23 @@ def smoke_node_route_config_registration() -> None:
|
||||
_expect(json.loads(theme_composition).get("composition_entries"), "Location Theme did not output compositions")
|
||||
_expect("semi_public_affair" in theme_summary, "Location Theme summary lost theme name")
|
||||
|
||||
style_node = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPStylePool"]
|
||||
style_inputs = style_node.INPUT_TYPES().get("required") or {}
|
||||
_expect("preset" in style_inputs, "Style Pool lost preset input")
|
||||
_expect("tooltip" in style_inputs["preset"][1], "Style Pool tooltip injection missing")
|
||||
style_config, style_summary = style_node().build(
|
||||
True,
|
||||
"replace",
|
||||
"comic_pinup_colored_pencil",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
)
|
||||
parsed_style = json.loads(style_config)
|
||||
_expect(parsed_style.get("schema") == "sxcp_style_config_v1", "Style Pool emitted wrong schema")
|
||||
_expect("comic pin-up" in parsed_style.get("style", ""), "Style Pool lost comic preset style")
|
||||
_expect("comic pin-up" in style_summary, "Style Pool summary lost preset label")
|
||||
|
||||
cast_config, women_count, men_count, cast_summary = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPCastControl"]().build(
|
||||
"mixed_couple",
|
||||
1,
|
||||
|
||||
Reference in New Issue
Block a user