{"record":{"id":"17be7c50d3ee2e59","repo":"sgl-project/sglang","slug":"the-current-scheduler-class-scheduler-class-17be7c","errorCode":null,"errorMessage":"The current scheduler class {scheduler.__class__}'s `set_timesteps` does not support custom sigmas schedules. Please check whether you are using the correct scheduler.","messagePattern":"The current scheduler class (.+?)'s `set_timesteps` does not support custom sigmas schedules\\. Please check whether you are using the correct scheduler\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/qwen_image_layered.py","lineNumber":145,"sourceCode":"        )\n    if timesteps is not None:\n        accepts_timesteps = \"timesteps\" in set(\n            inspect.signature(scheduler.set_timesteps).parameters.keys()\n        )\n        if not accepts_timesteps:\n            raise ValueError(\n                f\"The current scheduler class {scheduler.__class__}'s `set_timesteps` does not support custom\"\n                f\" timestep schedules. Please check whether you are using the correct scheduler.\"\n            )\n        scheduler.set_timesteps(timesteps=timesteps, device=device, **kwargs)\n        timesteps = scheduler.timesteps\n        num_inference_steps = len(timesteps)\n    elif sigmas is not None:\n        accept_sigmas = \"sigmas\" in set(\n            inspect.signature(scheduler.set_timesteps).parameters.keys()\n        )\n        if not accept_sigmas:\n            raise ValueError(\n                f\"The current scheduler class {scheduler.__class__}'s `set_timesteps` does not support custom\"\n                f\" sigmas schedules. Please check whether you are using the correct scheduler.\"\n            )\n        scheduler.set_timesteps(sigmas=sigmas, device=device, **kwargs)\n        timesteps = scheduler.timesteps\n        num_inference_steps = len(timesteps)\n    else:\n        scheduler.set_timesteps(num_inference_steps, device=device, **kwargs)\n        timesteps = scheduler.timesteps\n    return timesteps, num_inference_steps\n\n\nclass QwenImageLayeredBeforeDenoisingStage(PipelineStage):\n    def __init__(\n        self,\n        vae,\n        text_encoder,\n        tokenizer,","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/qwen_image_layered.py#L127-L163","documentation":"Mirror of the timesteps check: when a custom sigmas array is passed, the scheduler's set_timesteps must accept a sigmas parameter. Classic timestep-based schedulers (DDPM/DDIM) do not, so custom sigma schedules are rejected with this error.","triggerScenarios":"Passing sigmas=[...] while the pipeline is configured with a scheduler whose set_timesteps only takes num_inference_steps/timesteps (e.g. DDPMScheduler, LMSDiscreteScheduler variants without sigma support).","commonSituations":"Copy-pasting flow-matching inference code (Qwen-Image, SD3-style) into a pipeline with a DDIM/DDPM scheduler; scheduler swap via config without updating call sites.","solutions":["Use timesteps=[...] instead for timestep-based schedulers.","Or set a sigma-capable scheduler (FlowMatchEulerDiscreteScheduler etc.) in the pipeline config.","Use num_inference_steps and let the scheduler build its own schedule."],"exampleFix":"# before\nstage(..., sigmas=[14.6, 5.0, 0.0])  # scheduler is DDPM\n\n# after\nstage(..., timesteps=[999, 500, 100])","handlingStrategy":"validation","validationCode":"import inspect\nif sigmas is not None:\n    assert \"sigmas\" in inspect.signature(scheduler.set_timesteps).parameters, \"scheduler lacks sigmas support; use timesteps\"","typeGuard":"def scheduler_accepts_sigmas(scheduler) -> bool:\n    return \"sigmas\" in inspect.signature(scheduler.set_timesteps).parameters","tryCatchPattern":null,"preventionTips":["Check the scheduler class name before choosing the schedule parameter.","Write an integration test asserting your custom schedule works with the configured scheduler."],"tags":["qwen-image","diffusers","scheduler","sigmas","scheduler-unsupported"],"backgroundTag":"unsupported-scheduler-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}