File size: 771 Bytes
32c5da4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from backend.app.core.prompting import compile_prompts


def test_compile_prompts_applies_type_and_style() -> None:
    result = compile_prompts(
        prompt="a dragon over city",
        negative_prompt="",
        image_type="poster",
        style_preset="cinematic",
        style_strength=80,
    )
    assert "Target:" in result.prompt
    assert "style influence 80%" in result.prompt
    assert "watermark" in result.negative_prompt


def test_compile_prompts_merges_negative_prompt() -> None:
    result = compile_prompts(
        prompt="logo for bakery",
        negative_prompt="busy background",
        image_type="logo",
        style_preset="minimal",
        style_strength=50,
    )
    assert result.negative_prompt.startswith("busy background")