[diffusion] fix: fix temporary resolution workaround (#20046)
This commit is contained in:
+22
@@ -1,6 +1,10 @@
|
||||
import math
|
||||
import unittest
|
||||
|
||||
from sglang.multimodal_gen.configs.sample.diffusers_generic import (
|
||||
DiffusersGenericSamplingParams,
|
||||
)
|
||||
from sglang.multimodal_gen.configs.sample.flux import FluxSamplingParams
|
||||
from sglang.multimodal_gen.configs.sample.sampling_params import SamplingParams
|
||||
|
||||
|
||||
@@ -45,5 +49,23 @@ class TestSamplingParamsValidate(unittest.TestCase):
|
||||
SamplingParams(boundary_ratio=math.nan)
|
||||
|
||||
|
||||
class TestSamplingParamsSubclass(unittest.TestCase):
|
||||
def test_flux_defaults_resolution_when_not_provided(self):
|
||||
params = FluxSamplingParams()
|
||||
|
||||
self.assertEqual(params.height, 1024)
|
||||
self.assertEqual(params.width, 1024)
|
||||
|
||||
def test_flux_preserves_user_resolution(self):
|
||||
params = FluxSamplingParams(height=640, width=768)
|
||||
|
||||
self.assertEqual(params.height, 640)
|
||||
self.assertEqual(params.width, 768)
|
||||
|
||||
def test_diffusers_generic_calls_base_post_init(self):
|
||||
with self.assertRaises(AssertionError):
|
||||
DiffusersGenericSamplingParams(num_frames=0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user