{"record":{"id":"3ee21f0a3276bc1c","repo":"lllyasviel/ControlNet","slug":"unsupported-noise-schedule-the-schedule-needs","errorCode":null,"errorMessage":"Unsupported noise schedule {}. The schedule needs to be 'discrete' or 'linear' or 'cosine'","messagePattern":"Unsupported noise schedule (.+?)\\. The schedule needs to be 'discrete' or 'linear' or 'cosine'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"ldm/models/diffusion/dpm_solver/dpm_solver.py","lineNumber":74,"sourceCode":"        ===============================================================\n        Args:\n            schedule: A `str`. The noise schedule of the forward SDE. 'discrete' for discrete-time DPMs,\n                    'linear' or 'cosine' for continuous-time DPMs.\n        Returns:\n            A wrapper object of the forward SDE (VP type).\n\n        ===============================================================\n        Example:\n        # For discrete-time DPMs, given betas (the beta array for n = 0, 1, ..., N - 1):\n        >>> ns = NoiseScheduleVP('discrete', betas=betas)\n        # For discrete-time DPMs, given alphas_cumprod (the \\hat{alpha_n} array for n = 0, 1, ..., N - 1):\n        >>> ns = NoiseScheduleVP('discrete', alphas_cumprod=alphas_cumprod)\n        # For continuous-time DPMs (VPSDE), linear schedule:\n        >>> ns = NoiseScheduleVP('linear', continuous_beta_0=0.1, continuous_beta_1=20.)\n        \"\"\"\n\n        if schedule not in ['discrete', 'linear', 'cosine']:\n            raise ValueError(\n                \"Unsupported noise schedule {}. The schedule needs to be 'discrete' or 'linear' or 'cosine'\".format(\n                    schedule))\n\n        self.schedule = schedule\n        if schedule == 'discrete':\n            if betas is not None:\n                log_alphas = 0.5 * torch.log(1 - betas).cumsum(dim=0)\n            else:\n                assert alphas_cumprod is not None\n                log_alphas = 0.5 * torch.log(alphas_cumprod)\n            self.total_N = len(log_alphas)\n            self.T = 1.\n            self.t_array = torch.linspace(0., 1., self.total_N + 1)[1:].reshape((1, -1))\n            self.log_alpha_array = log_alphas.reshape((1, -1,))\n        else:\n            self.total_N = 1000\n            self.beta_0 = continuous_beta_0\n            self.beta_1 = continuous_beta_1","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/dpm_solver/dpm_solver.py#L56-L92","documentation":"NoiseScheduleVP (DPM-Solver) supports exactly three noise schedules: 'discrete' (uses alphas_cumprod or betas), 'linear' (continuous beta_0/beta_1), and 'cosine'. Any other schedule string is rejected at construction.","triggerScenarios":"Creating NoiseScheduleVP with schedule='Discrete', 'sigmoid', 'vp', etc., or a typo'd value passed from a sampling script config.","commonSituations":"Porting sampler code from k-diffusion or newer DPM-Solver++ forks with more schedule names; case-sensitivity mistakes; passing schedule=None.","solutions":["Use exactly 'discrete', 'linear', or 'cosine'","For a trained DDPM, use NoiseScheduleVP('discrete', alphas_cumprod=model.alphas_cumprod)","Update to a newer DPM-Solver version if you need additional schedules"],"exampleFix":"# before\nNoiseScheduleVP('Discrete', alphas_cumprod=ac)\n# after\nNoiseScheduleVP('discrete', alphas_cumprod=ac)","handlingStrategy":"validation","validationCode":"assert schedule in ('discrete', 'linear', 'cosine'), f\"unsupported schedule {schedule!r}\"","typeGuard":"def is_valid_schedule(s: str) -> bool:\n    return s in ('discrete', 'linear', 'cosine')","tryCatchPattern":null,"preventionTips":["Use lowercase exact strings from the docstring","Build samplers from validated option enums, not raw UI text"],"tags":["dpm-solver","sampling","diffusion","config"],"backgroundTag":"unsupported-config-option","analyzedSha":"ed85cd1e25a5ed592f7d8178495b4483de0331bf","analyzedAt":"2026-08-27T12:58:54.167Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}