microsoft/VibeVoice · error · ValueError
Number of inference steps is 'None', you need to run 'set_ti
Error message
Number of inference steps is 'None', you need to run 'set_timesteps' after creating the scheduler
What it means
`step()` requires a prepared sigma/timestep grid; `self.num_inference_steps` is None until `set_timesteps()` has run, so stepping first raises this ValueError. The scheduler deliberately stores no default schedule — every sampling loop must call set_timesteps (with a step count or custom timesteps) after construction and before the first step().
Source
Thrown at vibevoice/schedule/dpm_solver.py:970
The current discrete timestep in the diffusion chain.
sample (`torch.Tensor`):
A current instance of a sample created by the diffusion process.
generator (`torch.Generator`, *optional*):
A random number generator.
variance_noise (`torch.Tensor`):
Alternative to generating noise with `generator` by directly providing the noise for the variance
itself. Useful for methods such as [`LEdits++`].
return_dict (`bool`):
Whether or not to return a [`~schedulers.scheduling_utils.SchedulerOutput`] or `tuple`.
Returns:
[`~schedulers.scheduling_utils.SchedulerOutput`] or `tuple`:
If return_dict is `True`, [`~schedulers.scheduling_utils.SchedulerOutput`] is returned; otherwise, a
tuple is returned where the first element is the sample tensor.
"""
if self.num_inference_steps is None:
raise ValueError(
"Number of inference steps is 'None', you need to run 'set_timesteps' after creating the scheduler"
)
if self.step_index is None:
self._init_step_index(timestep)
# Improve numerical stability for small number of steps
lower_order_final = (self.step_index == len(self.timesteps) - 1) and (
self.config.euler_at_final
or (self.config.lower_order_final and len(self.timesteps) < 15)
or self.config.final_sigmas_type == "zero"
)
lower_order_second = (
(self.step_index == len(self.timesteps) - 2) and self.config.lower_order_final and len(self.timesteps) < 15
)
model_output = self.convert_model_output(model_output, sample=sample)
for i in range(self.config.solver_order - 1):View on GitHub (pinned to 94da20d98b)
Solutions
- Call `scheduler.set_timesteps(num_inference_steps=N)` once after creating the scheduler and before the sampling loop.
- If using custom timesteps: `scheduler.set_timesteps(timesteps=[...])`.
- Add a guard in your loop: `if scheduler.num_inference_steps is None: scheduler.set_timesteps(30)`.
Example fix
# before
for t in scheduler.timesteps:
scheduler.step(model_output, t, sample) # num_inference_steps is None
# after
scheduler.set_timesteps(num_inference_steps=30)
for t in scheduler.timesteps:
scheduler.step(model_output, t, sample) Defensive patterns
Strategy: validation
Validate before calling
if scheduler.num_inference_steps is None:
scheduler.set_timesteps(num_inference_steps=30)
for t in scheduler.timesteps:
scheduler.step(model_output, t, sample) Type guard
def scheduler_is_ready(scheduler) -> bool:
return scheduler.num_inference_steps is not None and scheduler.timesteps is not None Prevention
- Encapsulate scheduler creation + set_timesteps in one setup function so they cannot be separated.
- After loading or re-creating a scheduler mid-run, always re-run set_timesteps.
- Assert num_inference_steps is not None at the top of your sampling loop as a cheap invariant.
When it happens
Trigger: `scheduler.step(model_output, t, sample)` before any `scheduler.set_timesteps(30)` call; also after re-creating or re-loading a scheduler mid-loop, or when an exception earlier in the pipeline skipped the set_timesteps line.
Common situations: Reordering pipeline code so the denoise loop runs first; wrapping schedulers in objects that lazy-init; copying example code that omitted the set_timesteps line; resuming from a checkpoint without re-running setup.
Related errors
- Must pass exactly one of `num_inference_steps` or `timesteps
- Can only pass one of `num_inference_steps` or `custom_timest
- missing `sample` as a required keyword argument
- missing `sample` as a required keyword argument
- missing`sample` as a required keyword argument
AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15).
Data as JSON: /api/errors/0d541b3936a91565.
Report an issue: GitHub.