{"record":{"id":"6aabb3c9b40d6d25","repo":"sgl-project/sglang","slug":"denoising-strength-must-be-positive","errorCode":null,"errorMessage":"denoising_strength must be positive","messagePattern":"denoising_strength must be positive","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/flow_match_pair.py","lineNumber":385,"sourceCode":"                    raise TypeError(\"pairs must be a torch.Tensor\")\n                if pairs.ndim != 2 or pairs.shape[1] != 2:\n                    raise ValueError(\"pairs must be a torch.Tensor of shape [N, 2]\")\n                if pairs.shape[0] == 0:\n                    raise ValueError(\"pairs length must be greater than 0\")\n                if source not in (\"timesteps\", \"sigmas\"):\n                    raise ValueError(\"source must be 'timesteps' or 'sigmas'\")\n\n                num_steps = pairs.shape[0]\n                device = pairs.device\n                dtype = pairs.dtype\n\n                def _build_column(\n                    shift_value: float, denoising_strength: float, mu_override\n                ):\n                    if shift_value <= 0:\n                        raise ValueError(\"shift must be positive\")\n                    if denoising_strength <= 0:\n                        raise ValueError(\"denoising_strength must be positive\")\n\n                    sigma_start = (\n                        self.sigma_min\n                        + (self.sigma_max - self.sigma_min) * denoising_strength\n                    )\n                    if self.extra_one_step:\n                        base = torch.linspace(\n                            sigma_start,\n                            self.sigma_min,\n                            num_steps + 1,\n                            device=device,\n                            dtype=dtype,\n                        )[:-1]\n                    else:\n                        base = torch.linspace(\n                            sigma_start,\n                            self.sigma_min,\n                            num_steps,","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/flow_match_pair.py#L367-L403","documentation":"Raised by the pair scheduler when building a per-modality sigma column with a non-positive denoising_strength. denoising_strength scales the sigma range (sigma_min + (sigma_max - sigma_min) * denoising_strength), so it must be > 0. It is part of _dual_sigma_shift setup, typically invoked via set_pair_postprocess_by_name('dual_sigma_shift', ...).","triggerScenarios":"Calling set_pair_postprocess_by_name with a dual-shift configuration where audio_denoising_strength (or image) is 0 or negative; reading the value from a config dict that defaults to 0 or was parsed as int(0).","commonSituations":"YAML/JSON generation configs omitting denoising_strength causing a 0 default; multiplying a strength by a resolution ratio that evaluates to 0; passing strength as a fraction >1 typo like 0.0.","solutions":["Set denoising_strength to a positive fraction, e.g. 0.5–1.0 (1.0 uses the full sigma range)","Check the config source that populates the strength value and add a default like 1.0","Validate strengths > 0 before calling set_pair_postprocess_by_name"],"exampleFix":"// before\nsched.set_pair_postprocess_by_name(\"dual_sigma_shift\", audio_shift=1.0, audio_denoising_strength=0.0, ...)\n// after\nsched.set_pair_postprocess_by_name(\"dual_sigma_shift\", audio_shift=1.0, audio_denoising_strength=0.5, ...)","handlingStrategy":"validation","validationCode":"strength = cfg.get(\"audio_denoising_strength\", 1.0)\nassert strength > 0, f\"denoising_strength must be > 0, got {strength}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default denoising_strength to 1.0 in config loaders","Assert positivity of shift/strength values before configuring the scheduler"],"tags":["scheduler","flow-matching","validation","diffusion","config"],"backgroundTag":"invalid-config-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}