Let stdin_prompt image gen tests be more lightweight

This commit is contained in:
filipstrand 2025-06-13 00:26:43 +02:00
parent d2296ec197
commit dac08fdfdc

View File

@ -30,6 +30,12 @@ def test_stdin_prompt_with_actual_generation(temp_output_dir):
"1", "1",
"--seed", "--seed",
"42", "42",
"--height",
"256",
"--width",
"256",
"-q",
"4",
"--output", "--output",
str(output_image), str(output_image),
"--metadata", "--metadata",
@ -80,6 +86,12 @@ def test_stdin_prompt_multiline_with_actual_generation(temp_output_dir):
"1", "1",
"--seed", "--seed",
"123", "123",
"--height",
"256",
"--width",
"256",
"-q",
"4",
"--output", "--output",
str(output_image), str(output_image),
"--metadata", "--metadata",
@ -111,6 +123,12 @@ def test_empty_stdin_fails_generation(temp_output_dir):
"dev", "dev",
"--steps", "--steps",
"1", "1",
"--height",
"256",
"--width",
"256",
"-q",
"4",
"--output", "--output",
str(output_image), str(output_image),
] ]
@ -135,7 +153,7 @@ def test_pipe_from_echo_command(temp_output_dir):
metadata_file = temp_output_dir / "test_echo.json" metadata_file = temp_output_dir / "test_echo.json"
# Simulate: echo "prompt" | mflux-generate --prompt - ... # Simulate: echo "prompt" | mflux-generate --prompt - ...
echo_cmd = f'echo "{prompt}" | {sys.executable} -m mflux.generate --prompt - --model dev --steps 1 --output {output_image} --metadata' echo_cmd = f'echo "{prompt}" | {sys.executable} -m mflux.generate --prompt - --model dev --steps 1 --height 256 --width 256 -q 4 --output {output_image} --metadata'
process = subprocess.run(echo_cmd, shell=True, capture_output=True, text=True) process = subprocess.run(echo_cmd, shell=True, capture_output=True, text=True)