{"record":{"id":"e8a45cac2ecd66b0","repo":"sgl-project/sglang","slug":"the-current-scheduler-class-scheduler-class-e8a45c","errorCode":null,"errorMessage":"The current scheduler class {scheduler.__class__}'s `set_timesteps` does not support custom timestep schedules. Please check whether you are using the correct scheduler.","messagePattern":"The current scheduler class (.+?)'s `set_timesteps` does not support custom timestep 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":133,"sourceCode":"            `num_inference_steps` and `sigmas` must be `None`.\n        sigmas (`List[float]`, *optional*):\n            Custom sigmas used to override the timestep spacing strategy of the scheduler. If `sigmas` is passed,\n            `num_inference_steps` and `timesteps` must be `None`.\n\n    Returns:\n        `Tuple[torch.Tensor, int]`: A tuple where the first element is the timestep schedule from the scheduler and the\n        second element is the number of inference steps.\n    \"\"\"\n    if timesteps is not None and sigmas is not None:\n        raise ValueError(\n            \"Only one of `timesteps` or `sigmas` can be passed. Please choose one to set custom values\"\n        )\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)","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/qwen_image_layered.py#L115-L151","documentation":"When you pass a custom timesteps array, retrieve_timesteps introspects scheduler.set_timesteps and requires it to accept a timesteps parameter. Some schedulers (notably sigma/flow-matching schedulers like FlowMatchEulerDiscreteScheduler) only accept sigmas, so a custom timestep schedule is unsupported and rejected.","triggerScenarios":"Passing timesteps=[...] to a pipeline whose scheduler's set_timesteps signature has no timesteps parameter — common when the default scheduler for Qwen-Image (a flow-matching scheduler) is configured.","commonSituations":"Reusing DDPM/DDIM-style custom-schedule code with a flow-matching model; swapping schedulers in config while keeping timesteps-based call sites; version changes that alter scheduler signatures.","solutions":["Switch to sigmas=[...] for flow-matching schedulers (compute sigmas from timesteps via the scheduler's sigma formula if needed).","Or configure a scheduler that supports timesteps (e.g. DDIMScheduler / DPMSolverMultistepScheduler) if the model permits.","Drop the custom schedule and use num_inference_steps."],"exampleFix":"# before\nstage(..., timesteps=[1000, 500, 100])\n\n# after\nstage(..., sigmas=[14.6146, 5.0, 0.0])  # flow-matching schedule","handlingStrategy":"validation","validationCode":"import inspect\nif timesteps is not None:\n    assert \"timesteps\" in inspect.signature(scheduler.set_timesteps).parameters, \"scheduler lacks timesteps support; use sigmas\"","typeGuard":"def scheduler_accepts_timesteps(scheduler) -> bool:\n    return \"timesteps\" in inspect.signature(scheduler.set_timesteps).parameters","tryCatchPattern":null,"preventionTips":["Know your scheduler family (flow-matching -> sigmas; DDPM/DDIM -> timesteps).","Centralize schedule construction in one helper keyed by scheduler type."],"tags":["qwen-image","diffusers","scheduler","timesteps","scheduler-unsupported"],"backgroundTag":"unsupported-scheduler-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}