microsoft/VibeVoice · error · ValueError

Can only pass one of `num_inference_steps` or `custom_timest

Error message

Can only pass one of `num_inference_steps` or `custom_timesteps`.

What it means

`set_timesteps()` raises this ValueError when both `num_inference_steps` and `timesteps` are provided, because the two would define conflicting timestep grids (the message text says `custom_timesteps`, carried over from diffusers, but it refers to the `timesteps` argument). Exactly one of the two must be non-None.

Source

Thrown at vibevoice/schedule/dpm_solver.py:343

        timesteps: Optional[List[int]] = None,
    ):
        """
        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]

View on GitHub (pinned to 94da20d98b)

Solutions

  1. If you want an evenly spaced schedule, drop the `timesteps` argument.
  2. If you need specific timesteps (e.g. SDEdit partial denoising), drop `num_inference_steps` — the count is derived as `len(timesteps)`.
  3. In config-driven code, gate the two fields so exactly one is emitted.

Example fix

# before
scheduler.set_timesteps(num_inference_steps=30, timesteps=[950, 500, 100])

# after
scheduler.set_timesteps(timesteps=[950, 500, 100])
Defensive patterns

Strategy: validation

Validate before calling

if num_inference_steps is not None and timesteps is not None:
    raise ValueError("Pass either num_inference_steps or timesteps, not both")
if num_inference_steps is None and timesteps is None:
    raise ValueError("Pass one of num_inference_steps or timesteps")
scheduler.set_timesteps(num_inference_steps=num_inference_steps, timesteps=timesteps)

Prevention

When it happens

Trigger: `scheduler.set_timesteps(num_inference_steps=30, timesteps=[999, 749, ...])` — a partial refactor where old positional step counts collide with newly added custom-timestep support.

Common situations: Pipelines that add LEdits++/SDEdit-style custom timesteps while keeping the step-count code path; config systems that always populate both fields.

Related errors


AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15). Data as JSON: /api/errors/5878d2b6db412ce3. Report an issue: GitHub.