[Bugfix] Fix Qwen-Image min-size normalization for tiny requests (#2637)
Signed-off-by: David Chen <530634352@qq.com>
This commit is contained in:
1 parent
956f53b278
commit
85d63c47f9
6 files changed
+65
-18
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import pytest
|
||||
|
||||
from vllm_omni.diffusion.utils.size_utils import (
|
||||
normalize_min_aligned_size,
|
||||
)
|
||||
|
||||
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("height", "width", "expected"),
|
||||
[
|
||||
(1, 1, (16, 16)),
|
||||
(15, 15, (16, 16)),
|
||||
(17, 17, (16, 16)),
|
||||
(31, 33, (16, 32)),
|
||||
(64, 80, (64, 80)),
|
||||
],
|
||||
)
|
||||
def test_normalize_min_aligned_size_clamps_to_minimum_aligned_shape(height, width, expected):
|
||||
assert normalize_min_aligned_size(height, width, alignment=16) == expected
|
||||
|
||||
|
||||
def test_normalize_min_aligned_size_rejects_invalid_alignment():
|
||||
with pytest.raises(ValueError, match="positive alignment"):
|
||||
normalize_min_aligned_size(16, 16, alignment=0)
|
||||
Reference in new issue
Block a user