daily
This commit is contained in:
@@ -1,18 +1,34 @@
|
||||
from app.homelab.anima_prompt import (
|
||||
build_character_image_prompt,
|
||||
build_draw_self_prompt,
|
||||
build_scene_tags_prompt,
|
||||
looks_like_booru_tags,
|
||||
)
|
||||
from app.homelab.scene_tags import extract_scene_tags, looks_like_booru_tags, rule_based_scene_tags
|
||||
|
||||
|
||||
def test_build_draw_self_prompt_includes_appearance():
|
||||
bundle = build_draw_self_prompt("silver_hair, wolf_ears, blue_eyes")
|
||||
def test_build_character_image_prompt_full_body():
|
||||
bundle = build_character_image_prompt(
|
||||
"wolfgirl, white_hair, pumped_up",
|
||||
action_tags="full_body, standing, looking_at_viewer",
|
||||
outfit_tags="apron",
|
||||
environment_tags="indoors, soft_lighting",
|
||||
)
|
||||
assert "full_body" in bundle.positive
|
||||
assert "standing" in bundle.positive
|
||||
assert "apron" in bundle.positive
|
||||
assert "pumped_up" not in bundle.positive
|
||||
assert "upper_body" not in bundle.positive
|
||||
assert "portrait" not in bundle.positive
|
||||
|
||||
|
||||
def test_build_draw_self_prompt_with_action():
|
||||
bundle = build_draw_self_prompt(
|
||||
"silver_hair, wolf_ears",
|
||||
action_tags="full_body, standing",
|
||||
outfit_tags="",
|
||||
)
|
||||
assert "full_body" in bundle.positive
|
||||
assert "silver_hair" in bundle.positive
|
||||
assert "wolf_ears" in bundle.positive
|
||||
assert "looking_at_viewer" in bundle.positive
|
||||
assert "POV:" not in bundle.positive
|
||||
assert ". " not in bundle.positive
|
||||
assert "worst quality" in bundle.negative
|
||||
|
||||
|
||||
def test_build_draw_self_prompt_lora():
|
||||
@@ -23,3 +39,14 @@ def test_build_draw_self_prompt_lora():
|
||||
def test_looks_like_booru_tags():
|
||||
assert looks_like_booru_tags("1girl, smile, indoors")
|
||||
assert not looks_like_booru_tags("draw a picture of a cat on the moon")
|
||||
|
||||
|
||||
def test_rule_based_full_body_russian():
|
||||
tags = rule_based_scene_tags("Очень, а в полный рост можешь?", [])
|
||||
assert "full_body" in tags["action_tags"]
|
||||
assert "portrait" not in tags["action_tags"]
|
||||
|
||||
|
||||
def test_rule_based_outfit_apron():
|
||||
tags = rule_based_scene_tags("", [{"role": "assistant", "content": "В фартуке стою у плиты"}])
|
||||
assert "apron" in tags["outfit_tags"]
|
||||
|
||||
Reference in New Issue
Block a user