{"record":{"id":"84b2e9dff3cc23f4","repo":"lllyasviel/ControlNet","slug":"solver-type-must-be-either-dpm-solver-or-tayl","errorCode":null,"errorMessage":"'solver_type' must be either 'dpm_solver' or 'taylor', got {}","messagePattern":"'solver_type' must be either 'dpm_solver' or 'taylor', got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"ldm/models/diffusion/dpm_solver/dpm_solver.py","lineNumber":533,"sourceCode":"    def singlestep_dpm_solver_second_update(self, x, s, t, r1=0.5, model_s=None, return_intermediate=False,\n                                            solver_type='dpm_solver'):\n        \"\"\"\n        Singlestep solver DPM-Solver-2 from time `s` to time `t`.\n        Args:\n            x: A pytorch tensor. The initial value at time `s`.\n            s: A pytorch tensor. The starting time, with the shape (x.shape[0],).\n            t: A pytorch tensor. The ending time, with the shape (x.shape[0],).\n            r1: A `float`. The hyperparameter of the second-order solver.\n            model_s: A pytorch tensor. The model function evaluated at time `s`.\n                If `model_s` is None, we evaluate the model by `x` and `s`; otherwise we directly use it.\n            return_intermediate: A `bool`. If true, also return the model value at time `s` and `s1` (the intermediate time).\n            solver_type: either 'dpm_solver' or 'taylor'. The type for the high-order solvers.\n                The type slightly impacts the performance. We recommend to use 'dpm_solver' type.\n        Returns:\n            x_t: A pytorch tensor. The approximated solution at time `t`.\n        \"\"\"\n        if solver_type not in ['dpm_solver', 'taylor']:\n            raise ValueError(\"'solver_type' must be either 'dpm_solver' or 'taylor', got {}\".format(solver_type))\n        if r1 is None:\n            r1 = 0.5\n        ns = self.noise_schedule\n        dims = x.dim()\n        lambda_s, lambda_t = ns.marginal_lambda(s), ns.marginal_lambda(t)\n        h = lambda_t - lambda_s\n        lambda_s1 = lambda_s + r1 * h\n        s1 = ns.inverse_lambda(lambda_s1)\n        log_alpha_s, log_alpha_s1, log_alpha_t = ns.marginal_log_mean_coeff(s), ns.marginal_log_mean_coeff(\n            s1), ns.marginal_log_mean_coeff(t)\n        sigma_s, sigma_s1, sigma_t = ns.marginal_std(s), ns.marginal_std(s1), ns.marginal_std(t)\n        alpha_s1, alpha_t = torch.exp(log_alpha_s1), torch.exp(log_alpha_t)\n\n        if self.predict_x0:\n            phi_11 = torch.expm1(-r1 * h)\n            phi_1 = torch.expm1(-h)\n\n            if model_s is None:","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/dpm_solver/dpm_solver.py#L515-L551","documentation":"Second-order singlestep updates accept solver_type 'dpm_solver' (recommended) or 'taylor' (Taylor expansion variant). Any other string raises this ValueError at the start of singlestep_dpm_solver_second_update, reached via singlestep_dpm_solver_update or dpm_solver_adaptive.","triggerScenarios":"Passing solver_type='dpm_solver++', 'DPM', 'taylor1', or None to a second-order update path (order=2 sampling or adaptive solver).","commonSituations":"Confusing this DPM-Solver release with DPM-Solver++ option names; typos in sampler parameter dicts.","solutions":["Use solver_type='dpm_solver' (default, recommended) or 'taylor'","Omit the parameter to take the default rather than passing a guess","Validate against the allowed set in your sampling config loader"],"exampleFix":"# before\nupdate = dpm.singlestep_dpm_solver_update(x, s, t, order=2, solver_type='dpm_solver++')\n# after\nupdate = dpm.singlestep_dpm_solver_update(x, s, t, order=2, solver_type='dpm_solver')","handlingStrategy":"validation","validationCode":"assert solver_type in ('dpm_solver', 'taylor'), f\"unsupported solver_type {solver_type!r}\"","typeGuard":"def is_valid_solver_type(s: str) -> bool:\n    return s in ('dpm_solver', 'taylor')","tryCatchPattern":null,"preventionTips":["Leave solver_type at its default unless benchmarking","Whitelist sampler parameter dicts before invoking DPM-Solver"],"tags":["dpm-solver","sampling","solver-type","value-error"],"backgroundTag":"unsupported-config-option","analyzedSha":"ed85cd1e25a5ed592f7d8178495b4483de0331bf","analyzedAt":"2026-08-27T12:58:54.167Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}