microsoft/VibeVoice · error · ValueError
Cannot use `timesteps` with `config.use_karras_sigmas = True
Error message
Cannot use `timesteps` with `config.use_karras_sigmas = True`
What it means
Custom `timesteps` and the Karras sigma schedule (`use_karras_sigmas=True` in the scheduler config) are mutually exclusive: Karras sigmas are generated from the trained sigma schedule and then mapped back to timesteps, so a user-supplied timestep list would be overwritten/inconsistent. `set_timesteps` rejects the combination with this ValueError.
Source
Thrown at vibevoice/schedule/dpm_solver.py:345
"""
Sets the discrete timesteps used for the diffusion chain (to be run before inference).
Args:
num_inference_steps (`int`):
The number of diffusion steps used when generating samples with a pre-trained model.
device (`str` or `torch.device`, *optional*):
The device to which the timesteps should be moved to. If `None`, the timesteps are not moved.
timesteps (`List[int]`, *optional*):
Custom timesteps used to support arbitrary timesteps schedule. If `None`, timesteps will be generated
based on the `timestep_spacing` attribute. If `timesteps` is passed, `num_inference_steps` and `sigmas`
must be `None`, and `timestep_spacing` attribute will be ignored.
"""
if num_inference_steps is None and timesteps is None:
raise ValueError("Must pass exactly one of `num_inference_steps` or `timesteps`.")
if num_inference_steps is not None and timesteps is not None:
raise ValueError("Can only pass one of `num_inference_steps` or `custom_timesteps`.")
if timesteps is not None and self.config.use_karras_sigmas:
raise ValueError("Cannot use `timesteps` with `config.use_karras_sigmas = True`")
if timesteps is not None and self.config.use_lu_lambdas:
raise ValueError("Cannot use `timesteps` with `config.use_lu_lambdas = True`")
if timesteps is not None:
timesteps = np.array(timesteps).astype(np.int64)
else:
# Clipping the minimum of all lambda(t) for numerical stability.
# This is critical for cosine (squaredcos_cap_v2) noise schedule.
clipped_idx = torch.searchsorted(torch.flip(self.lambda_t, [0]), self.config.lambda_min_clipped)
last_timestep = ((self.config.num_train_timesteps - clipped_idx).numpy()).item()
# "linspace", "leading", "trailing" corresponds to annotation of Table 2. of https://arxiv.org/abs/2305.08891
if self.config.timestep_spacing == "linspace":
timesteps = (
np.linspace(0, last_timestep - 1, num_inference_steps + 1)
.round()[::-1][:-1]
.copy()
.astype(np.int64)View on GitHub (pinned to 94da20d98b)
Solutions
- Construct the scheduler with `use_karras_sigmas=False` if you need custom timesteps.
- Or keep Karras sigmas and pass `num_inference_steps` instead of `timesteps`.
- If you need both (custom grid + Karras spacing), compute the Karras sigmas yourself and set `scheduler.sigmas`/`timesteps` manually after set_timesteps.
Example fix
# before sched = DPMSolverMultistepScheduler(..., use_karras_sigmas=True) sched.set_timesteps(timesteps=[900, 700, 400, 100]) # after sched = DPMSolverMultistepScheduler(..., use_karras_sigmas=False) sched.set_timesteps(timesteps=[900, 700, 400, 100])
Defensive patterns
Strategy: validation
Validate before calling
if timesteps is not None and scheduler.config.use_karras_sigmas:
raise ValueError("Custom timesteps require a scheduler built with use_karras_sigmas=False")
scheduler.set_timesteps(num_inference_steps=n, timesteps=timesteps) Type guard
def can_use_custom_timesteps(scheduler) -> bool:
return not (scheduler.config.use_karras_sigmas or scheduler.config.use_lu_lambdas) Prevention
- Decide the sigma strategy (karras/lu/standard) at scheduler construction and keep the set_timesteps call style consistent with it.
- Check scheduler.config.use_karras_sigmas before passing timesteps.
- Use num_inference_steps when you just want fewer steps with Karras spacing.
When it happens
Trigger: `DPMSolverMultistepScheduler(..., use_karras_sigmas=True)` later followed by `scheduler.set_timesteps(timesteps=[...])`.
Common situations: SDEdit/img2img flows that specify timesteps while the scheduler was built with karras sigmas for quality; reusing one scheduler config across pipelines with different calling conventions.
Related errors
- Cannot use `timesteps` with `config.use_lu_lambdas = True`
- {self.config.timestep_spacing} is not supported. Please make
- Unsupported alpha_transform_type: {alpha_transform_type}
- {beta_schedule} is not implemented for {self.__class__}
- {algorithm_type} is not implemented for {self.__class__}
AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15).
Data as JSON: /api/errors/6b8b046a95273c1d.
Report an issue: GitHub.