{"record":{"id":"e9b4e528defec80d","repo":"invoke-ai/InvokeAI","slug":"type-scheduler-name-does-not-accept-an-expl","errorCode":null,"errorMessage":"{type(scheduler).__name__} does not accept an explicit sigma schedule, so it cannot honor denoising_start/denoising_end. Use the euler or lcm scheduler for partial denoising.","messagePattern":"(.+?) does not accept an explicit sigma schedule, so it cannot honor denoising_start/denoising_end\\. Use the euler or lcm scheduler for partial denoising\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/ernie_image/denoise.py","lineNumber":93,"sourceCode":"\n    if use_scheduler:\n        set_timesteps_sig = inspect.signature(scheduler.set_timesteps)\n        if \"sigmas\" in set_timesteps_sig.parameters:\n            # Hand the scheduler the *whole* window -- terminal sigma included -- and then drop the\n            # extra zero it unconditionally appends. Passing `timesteps[:-1]` instead would let that\n            # appended zero stand in for the requested end sigma, so `denoising_end < 1.0` would\n            # silently run a full denoise in fewer, coarser steps rather than stopping early.\n            # Truncating (instead of patching the last sigma by hand) keeps the scheduler's own\n            # `shift` applied to the terminal sigma, which manual math here would get wrong.\n            scheduler.set_timesteps(sigmas=list(timesteps), device=img.device)\n            scheduler.sigmas = scheduler.sigmas[:-1]\n            scheduler.timesteps = scheduler.timesteps[:-1]\n        else:\n            # FlowMatchHeunDiscreteScheduler.set_timesteps only takes a step count and derives its\n            # own sigmas, so a partial-denoise range cannot be honored. Refuse instead of silently\n            # running a full denoise with the wrong schedule.\n            if not (math.isclose(timesteps[0], 1.0) and math.isclose(timesteps[-1], 0.0, abs_tol=1e-6)):\n                raise ValueError(\n                    f\"{type(scheduler).__name__} does not accept an explicit sigma schedule, so it cannot honor \"\n                    \"denoising_start/denoising_end. Use the euler or lcm scheduler for partial denoising.\"\n                )\n            scheduler.set_timesteps(num_inference_steps=len(timesteps) - 1, device=img.device)\n\n        if init_latents is not None:\n            # `scheduler.sigmas[0]` is the *shifted* first sigma; `timesteps[0]` is the raw one.\n            # Blending at the raw value would build a sample at one sigma and then tell the first\n            # model call it is at another. Equivalent to `scheduler.scale_noise`, spelled out\n            # because it has to agree with the Euler math below.\n            img = _blend_init_latents(init_latents, img, float(scheduler.sigmas[0]))\n\n        # Higher-order solvers evaluate the model more than once per requested step (Heun's\n        # `set_timesteps(N)` yields 2N-1 timesteps), so drive progress off the actual iteration\n        # count rather than the requested step count.\n        total_steps = len(scheduler.timesteps)\n\n        pbar = tqdm(total=total_steps, desc=\"ERNIE-Image denoising\")","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/ernie_image/denoise.py#L75-L111","documentation":"In ernie_image denoise, partial denoising (denoising_start/denoising_end) requires installing an explicit sigma schedule on the scheduler. FlowMatchHeunDiscreteScheduler.set_timesteps only accepts a step count and derives its own sigmas, so when the requested window doesn't span the full 1.0->0.0 range, the library raises ValueError instead of silently running a full denoise with the wrong schedule.","triggerScenarios":"Calling denoise() with scheduler=FlowMatchHeunDiscreteScheduler and either denoising_start > 0 or denoising_end < 1.0 (i.e. timesteps slice endpoints not ~1.0 and ~0.0 within 1e-6).","commonSituations":"Users selecting the Heun scheduler in the UI and then setting a denoise start/end for img2img or preview; graphs that pass partial-denoise windows with Heun after switching schedulers from euler/lcm.","solutions":["Switch the scheduler to euler or lcm, which accept explicit sigma schedules and honor partial denoising.","Set denoising_start=0.0 and denoising_end=1.0 if you must keep Heun (full denoise only).","Adjust graph/UI logic to restrict the Heun option to full denoise runs."],"exampleFix":"// before\ndenoise(model, scheduler=FlowMatchHeunDiscreteScheduler(...), denoising_start=0.4)\n// after\ndenoise(model, scheduler=EulerDiscreteScheduler(...), denoising_start=0.4)","handlingStrategy":"fallback","validationCode":"is_heun = isinstance(scheduler, FlowMatchHeunDiscreteScheduler)\nis_partial = denoising_start > 0.0 or denoising_end < 1.0\nif is_heun and is_partial:\n    scheduler = switch_to_euler(scheduler)","typeGuard":"def supports_explicit_sigmas(scheduler) -> bool:\n    return not isinstance(scheduler, FlowMatchHeunDiscreteScheduler)","tryCatchPattern":"try:\n    denoise(model, scheduler=scheduler, denoising_start=s, denoising_end=e)\nexcept ValueError as e:\n    if \"explicit sigma schedule\" in str(e):\n        scheduler = EulerDiscreteScheduler.from_config(scheduler.config)\n        return denoise(model, scheduler=scheduler, denoising_start=s, denoising_end=e)\n    raise","preventionTips":["Restrict partial-denoise UI controls to euler/lcm schedulers.","Assert scheduler capability before setting denoising_start/end.","Default new graphs to euler when partial denoising is enabled."],"tags":["diffusion","scheduler","pytorch"],"backgroundTag":"unsupported-scheduler-capability","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}