[diffusion] chore: further refine output resolution adjustment logic (#14558)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -8,9 +8,6 @@ from sglang.multimodal_gen.configs.sample.sampling_params import SamplingParams
|
||||
|
||||
@dataclass
|
||||
class FluxSamplingParams(SamplingParams):
|
||||
# Video parameters
|
||||
# height: int = 1024
|
||||
# width: int = 1024
|
||||
num_frames: int = 1
|
||||
# Denoising stage
|
||||
guidance_scale: float = 1.0
|
||||
|
||||
@@ -8,9 +8,6 @@ from sglang.multimodal_gen.configs.sample.sampling_params import SamplingParams
|
||||
|
||||
@dataclass
|
||||
class QwenImageSamplingParams(SamplingParams):
|
||||
# Video parameters
|
||||
# height: int = 1024
|
||||
# width: int = 1024
|
||||
negative_prompt: str = " "
|
||||
num_frames: int = 1
|
||||
# Denoising stage
|
||||
|
||||
@@ -192,10 +192,8 @@ class SamplingParams:
|
||||
|
||||
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"):
|
||||
|
||||
@@ -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 <= 0 or 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}"
|
||||
|
||||
@@ -219,9 +219,7 @@ class Req:
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user