From c09f5b956d3a228d12ff677691037cd68b5948fa Mon Sep 17 00:00:00 2001 From: Mick Date: Sun, 7 Dec 2025 10:23:48 +0800 Subject: [PATCH 1/3] [diffusion] chore: further refine output resolution adjustment logic --- python/sglang/multimodal_gen/configs/sample/qwenimage.py | 3 --- .../sglang/multimodal_gen/configs/sample/sampling_params.py | 2 -- python/sglang/multimodal_gen/runtime/entrypoints/utils.py | 2 +- .../multimodal_gen/runtime/pipelines_core/schedule_batch.py | 4 +--- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/python/sglang/multimodal_gen/configs/sample/qwenimage.py b/python/sglang/multimodal_gen/configs/sample/qwenimage.py index c32703955599..9bec1b1727d4 100644 --- a/python/sglang/multimodal_gen/configs/sample/qwenimage.py +++ b/python/sglang/multimodal_gen/configs/sample/qwenimage.py @@ -8,9 +8,6 @@ @dataclass class QwenImageSamplingParams(SamplingParams): - # Video parameters - # height: int = 1024 - # width: int = 1024 negative_prompt: str = " " num_frames: int = 1 # Denoising stage diff --git a/python/sglang/multimodal_gen/configs/sample/sampling_params.py b/python/sglang/multimodal_gen/configs/sample/sampling_params.py index 0e756337702f..0a754b82d8d4 100644 --- a/python/sglang/multimodal_gen/configs/sample/sampling_params.py +++ b/python/sglang/multimodal_gen/configs/sample/sampling_params.py @@ -191,10 +191,8 @@ def __post_init__(self) -> None: if self.width is None: self.width_not_provided = True - self.width = 1280 if self.height is None: self.height_not_provided = True - self.height = 720 def check_sampling_param(self): if self.prompt_path and not self.prompt_path.endswith(".txt"): diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/utils.py b/python/sglang/multimodal_gen/runtime/entrypoints/utils.py index 74171a8650b1..6f6096933ec2 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/utils.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/utils.py @@ -35,7 +35,7 @@ def prepare_request( req = Req(**filtered_params, VSA_sparsity=server_args.VSA_sparsity) req.adjust_size(server_args) - if req.width <= 0 or req.height <= 0: + if (req.width and req.width <= 0) or (req.height and req.height <= 0): raise ValueError( f"Height, width must be positive integers, got " f"height={req.height}, width={req.width}" diff --git a/python/sglang/multimodal_gen/runtime/pipelines_core/schedule_batch.py b/python/sglang/multimodal_gen/runtime/pipelines_core/schedule_batch.py index 26bb392d6535..6ae0d7f87290 100644 --- a/python/sglang/multimodal_gen/runtime/pipelines_core/schedule_batch.py +++ b/python/sglang/multimodal_gen/runtime/pipelines_core/schedule_batch.py @@ -218,9 +218,7 @@ def __post_init__(self): self.guidance_scale_2 = self.guidance_scale def adjust_size(self, server_args: ServerArgs): - if self.height is None or self.width is None: - self.width = 1280 - self.height = 720 + pass def __str__(self): return pprint.pformat(asdict(self), indent=2, width=120) From 988491cdc53e18158f58018b5c86a77f58435743 Mon Sep 17 00:00:00 2001 From: Mick Date: Sun, 7 Dec 2025 10:30:00 +0800 Subject: [PATCH 2/3] Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- python/sglang/multimodal_gen/runtime/entrypoints/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/utils.py b/python/sglang/multimodal_gen/runtime/entrypoints/utils.py index 6f6096933ec2..259e9f1cda2b 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/utils.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/utils.py @@ -35,7 +35,7 @@ def prepare_request( req = Req(**filtered_params, VSA_sparsity=server_args.VSA_sparsity) req.adjust_size(server_args) - if (req.width and req.width <= 0) or (req.height and req.height <= 0): + if (req.width is not None and req.width <= 0) or (req.height is not None and req.height <= 0): raise ValueError( f"Height, width must be positive integers, got " f"height={req.height}, width={req.width}" From 24d7928bca814356b8531b45604c99db08b979d6 Mon Sep 17 00:00:00 2001 From: Mick Date: Sun, 7 Dec 2025 21:20:49 +0800 Subject: [PATCH 3/3] upd --- python/sglang/multimodal_gen/configs/sample/flux.py | 3 --- python/sglang/multimodal_gen/runtime/entrypoints/utils.py | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/sglang/multimodal_gen/configs/sample/flux.py b/python/sglang/multimodal_gen/configs/sample/flux.py index 657142f2f9a7..7f95cd98d759 100644 --- a/python/sglang/multimodal_gen/configs/sample/flux.py +++ b/python/sglang/multimodal_gen/configs/sample/flux.py @@ -8,9 +8,6 @@ @dataclass class FluxSamplingParams(SamplingParams): - # Video parameters - # height: int = 1024 - # width: int = 1024 num_frames: int = 1 # Denoising stage guidance_scale: float = 1.0 diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/utils.py b/python/sglang/multimodal_gen/runtime/entrypoints/utils.py index 259e9f1cda2b..7d84602a99cd 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/utils.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/utils.py @@ -35,7 +35,9 @@ def prepare_request( req = Req(**filtered_params, VSA_sparsity=server_args.VSA_sparsity) req.adjust_size(server_args) - if (req.width is not None and req.width <= 0) or (req.height is not None and req.height <= 0): + if (req.width is not None and req.width <= 0) or ( + req.height is not None and req.height <= 0 + ): raise ValueError( f"Height, width must be positive integers, got " f"height={req.height}, width={req.width}"