You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EDMEulerScheduler.set_timesteps fails with a list of sigmas, and custom sigmas are passed through the karras ramp #15266
EDMEulerScheduler.set_timesteps is annotated sigmas: torch.Tensor | list[float] | None and documented as "Custom sigmas to use for the denoising process", but:
A list raises AttributeError: 'list' object has no attribute 'to'. Only None, a single float and a tensor are handled (scheduling_edm_euler.py, the isinstance(sigmas, float) / sigmas.to(...) branch). retrieve_timesteps in the pipelines documents sigmas as list[float], so a list from a pipeline call hits this.
A tensor is not used as the sigma schedule: it goes through _compute_karras_sigmas (or _compute_exponential_sigmas) as if it were the ramp in [0, 1]. Actual sigmas such as [80, 10, 1, 0.1] produce a meaningless schedule.
Which behaviour is intended for sigmas here: actual sigma values (used as given, like most other schedulers' sigmas=), or ramp positions in [0, 1] that the configured schedule maps to sigmas (which is how the default torch.linspace(0, 1, n) path works)? I'm happy to open a PR for whichever you prefer: accept lists in both cases, and either skip the ramp transform for custom sigmas or document that the values are ramp positions and validate the range.
AI disclosure: I used Claude Code (Anthropic) to scan the schedulers and draft the reproduction; I ran the reproduction myself and wrote this up after checking the code paths named above.
The list-of-sigmas crash and the karras ramp both come from set_timesteps running custom values through _compute_karras_sigmas — that transform only makes sense for the default torch.linspace(0, 1, n) ramp.
Opened #15296 to use custom sigmas as given (lists included), and documented the expected order (largest to smallest) so it matches what the default schedule produces. With that, sigmas=[80.0, 9.723, 0.47, 0.002] and num_inference_steps=4 give the same schedule.
@sunhouy thanks, but I filed this and asked above which semantics sigmas should have (actual sigma values vs ramp positions), since the two lead to different fixes. Per CONTRIBUTING I'm waiting for a maintainer to pick one before opening a PR, so I'd rather leave that call to @yiyixuxu.
Activity
sunhouy commentedon Nov 15, 2026
The list-of-sigmas crash and the karras ramp both come from
set_timestepsrunning custom values through_compute_karras_sigmas— that transform only makes sense for the defaulttorch.linspace(0, 1, n)ramp.Opened #15296 to use custom sigmas as given (lists included), and documented the expected order (largest to smallest) so it matches what the default schedule produces. With that,
sigmas=[80.0, 9.723, 0.47, 0.002]andnum_inference_steps=4give the same schedule.MaiAditya commentedon Nov 18, 2026
@sunhouy thanks, but I filed this and asked above which semantics
sigmasshould have (actual sigma values vs ramp positions), since the two lead to different fixes. Per CONTRIBUTING I'm waiting for a maintainer to pick one before opening a PR, so I'd rather leave that call to @yiyixuxu.