{"record":{"id":"affd132ffc024640","repo":"microsoft/VibeVoice","slug":"cannot-use-timesteps-with-config-use-lu-lambdas","errorCode":null,"errorMessage":"Cannot use `timesteps` with `config.use_lu_lambdas = True`","messagePattern":"Cannot use `timesteps` with `config\\.use_lu_lambdas = True`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vibevoice/schedule/dpm_solver.py","lineNumber":347,"sourceCode":"\n        Args:\n            num_inference_steps (`int`):\n                The number of diffusion steps used when generating samples with a pre-trained model.\n            device (`str` or `torch.device`, *optional*):\n                The device to which the timesteps should be moved to. If `None`, the timesteps are not moved.\n            timesteps (`List[int]`, *optional*):\n                Custom timesteps used to support arbitrary timesteps schedule. If `None`, timesteps will be generated\n                based on the `timestep_spacing` attribute. If `timesteps` is passed, `num_inference_steps` and `sigmas`\n                must be `None`, and `timestep_spacing` attribute will be ignored.\n        \"\"\"\n        if num_inference_steps is None and timesteps is None:\n            raise ValueError(\"Must pass exactly one of `num_inference_steps` or `timesteps`.\")\n        if num_inference_steps is not None and timesteps is not None:\n            raise ValueError(\"Can only pass one of `num_inference_steps` or `custom_timesteps`.\")\n        if timesteps is not None and self.config.use_karras_sigmas:\n            raise ValueError(\"Cannot use `timesteps` with `config.use_karras_sigmas = True`\")\n        if timesteps is not None and self.config.use_lu_lambdas:\n            raise ValueError(\"Cannot use `timesteps` with `config.use_lu_lambdas = True`\")\n\n        if timesteps is not None:\n            timesteps = np.array(timesteps).astype(np.int64)\n        else:\n            # Clipping the minimum of all lambda(t) for numerical stability.\n            # This is critical for cosine (squaredcos_cap_v2) noise schedule.\n            clipped_idx = torch.searchsorted(torch.flip(self.lambda_t, [0]), self.config.lambda_min_clipped)\n            last_timestep = ((self.config.num_train_timesteps - clipped_idx).numpy()).item()\n\n            # \"linspace\", \"leading\", \"trailing\" corresponds to annotation of Table 2. of https://arxiv.org/abs/2305.08891\n            if self.config.timestep_spacing == \"linspace\":\n                timesteps = (\n                    np.linspace(0, last_timestep - 1, num_inference_steps + 1)\n                    .round()[::-1][:-1]\n                    .copy()\n                    .astype(np.int64)\n                )\n            elif self.config.timestep_spacing == \"leading\":","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/schedule/dpm_solver.py#L329-L365","documentation":"Custom `timesteps` conflict with `use_lu_lambdas=True`: the Lu schedule derives sigmas from a log-linear interpolation of the model's lambda(t) values and then back-maps them to timesteps, so a hand-supplied timestep list cannot coexist with it. `set_timesteps` enforces this with a ValueError, mirroring diffusers.","triggerScenarios":"`DPMSolverMultistepScheduler(..., use_lu_lambdas=True)` followed by `scheduler.set_timesteps(timesteps=[...])`.","commonSituations":"Config templates that enable Lu lambdas for quality while a pipeline branch (e.g. audio editing / partial denoising) supplies explicit timesteps; porting diffusers img2img code into vibevoice.","solutions":["Set `use_lu_lambdas=False` when you need custom timesteps.","Or keep Lu lambdas and call `set_timesteps(num_inference_steps=N)`.","Audit scheduler config defaults merged from files so use_lu_lambdas is not silently True."],"exampleFix":"# before\nsched = DPMSolverMultistepScheduler(..., use_lu_lambdas=True)\nsched.set_timesteps(timesteps=[880, 600, 200])\n\n# after\nsched = DPMSolverMultistepScheduler(..., use_lu_lambdas=False)\nsched.set_timesteps(timesteps=[880, 600, 200])","handlingStrategy":"validation","validationCode":"if timesteps is not None and scheduler.config.use_lu_lambdas:\n    raise ValueError(\"Custom timesteps require a scheduler built with use_lu_lambdas=False\")\nscheduler.set_timesteps(num_inference_steps=n, timesteps=timesteps)","typeGuard":"def can_use_custom_timesteps(scheduler) -> bool:\n    return not (scheduler.config.use_karras_sigmas or scheduler.config.use_lu_lambdas)","tryCatchPattern":null,"preventionTips":["Audit merged scheduler configs for use_lu_lambdas before calling with timesteps.","Keep one calling convention per pipeline run: step count OR explicit timesteps.","Both use_karras_sigmas and use_lu_lambdas remap timesteps, so neither composes with custom grids."],"tags":["python","diffusion","scheduler","config","lu-lambdas","timesteps"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}