import{S as so,i as no,s as io,e as o,k as a,w as _,t as i,M as lo,c as s,d as r,m as p,a as n,x as g,h as l,b as d,G as e,g as h,y as S,q as M,o as D,B as b,v as ao}from"../../../chunks/vendor-hf-doc-builder.js";import{T as po}from"../../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as ut}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function co(Ge){let f,I;return{c(){f=o("p"),I=i(`The algorithm and model type are decoupled. You can use either DPMSolver or DPMSolver++ for both noise
prediction and data prediction models.`)},l(v){f=s(v,"P",{});var P=n(f);I=l(P,`The algorithm and model type are decoupled. You can use either DPMSolver or DPMSolver++ for both noise
prediction and data prediction models.`),P.forEach(r)},m(v,P){h(v,f,P),e(f,I)},d(v){v&&r(f)}}}function uo(Ge){let f,I,v,P,Se,Z,ht,Me,mt,Je,$,De,ft,vt,U,_t,gt,R,St,Mt,Ye,ue,Dt,He,E,k,be,K,bt,Pe,Pt,We,T,yt,ye,$t,Tt,$e,xt,Et,Ze,y,wt,j,Ft,Ot,Te,At,Ct,xe,It,kt,Ue,L,Lt,Ee,qt,Nt,Re,w,q,we,Q,Vt,Fe,zt,Ke,u,X,Bt,he,Oe,Gt,Jt,Yt,F,Ht,me,Wt,Zt,fe,Ut,Rt,Kt,x,ee,jt,Ae,Qt,Xt,N,er,V,te,tr,Ce,rr,or,z,re,sr,Ie,nr,ir,B,oe,lr,ke,dr,ar,G,se,pr,Le,cr,ur,J,ne,hr,qe,mr,fr,Y,ie,vr,Ne,_r,je,O,H,Ve,le,gr,ze,Sr,Qe,A,de,Mr,ae,Dr,Be,br,Pr,Xe;return Z=new ut({}),K=new ut({}),Q=new ut({}),X=new C({props:{name:"class diffusers.DPMSolverMultistepScheduler",anchor:"diffusers.DPMSolverMultistepScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.0001"},{name:"beta_end",val:": float = 0.02"},{name:"beta_schedule",val:": str = 'linear'"},{name:"trained_betas",val:": typing.Union[numpy.ndarray, typing.List[float], NoneType] = None"},{name:"solver_order",val:": int = 2"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"thresholding",val:": bool = False"},{name:"dynamic_thresholding_ratio",val:": float = 0.995"},{name:"sample_max_value",val:": float = 1.0"},{name:"algorithm_type",val:": str = 'dpmsolver++'"},{name:"solver_type",val:": str = 'midpoint'"},{name:"lower_order_final",val:": bool = True"},{name:"use_karras_sigmas",val:": typing.Optional[bool] = False"},{name:"lambda_min_clipped",val:": float = -inf"},{name:"variance_type",val:": typing.Optional[str] = None"},{name:"timestep_spacing",val:": str = 'linspace'"},{name:"steps_offset",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.num_train_timesteps",description:`<strong>num_train_timesteps</strong> (<code>int</code>, defaults to 1000) &#x2014;
The number of diffusion steps to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.DPMSolverMultistepScheduler.beta_start",description:`<strong>beta_start</strong> (<code>float</code>, defaults to 0.0001) &#x2014;
The starting <code>beta</code> value of inference.`,name:"beta_start"},{anchor:"diffusers.DPMSolverMultistepScheduler.beta_end",description:`<strong>beta_end</strong> (<code>float</code>, defaults to 0.02) &#x2014;
The final <code>beta</code> value.`,name:"beta_end"},{anchor:"diffusers.DPMSolverMultistepScheduler.beta_schedule",description:`<strong>beta_schedule</strong> (<code>str</code>, defaults to <code>&quot;linear&quot;</code>) &#x2014;
The beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from
<code>linear</code>, <code>scaled_linear</code>, or <code>squaredcos_cap_v2</code>.`,name:"beta_schedule"},{anchor:"diffusers.DPMSolverMultistepScheduler.trained_betas",description:`<strong>trained_betas</strong> (<code>np.ndarray</code>, <em>optional</em>) &#x2014;
Pass an array of betas directly to the constructor to bypass <code>beta_start</code> and <code>beta_end</code>.`,name:"trained_betas"},{anchor:"diffusers.DPMSolverMultistepScheduler.solver_order",description:`<strong>solver_order</strong> (<code>int</code>, defaults to 2) &#x2014;
The DPMSolver order which can be <code>1</code> or <code>2</code> or <code>3</code>. It is recommended to use <code>solver_order=2</code> for guided
sampling, and <code>solver_order=3</code> for unconditional sampling.`,name:"solver_order"},{anchor:"diffusers.DPMSolverMultistepScheduler.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, defaults to <code>epsilon</code>, <em>optional</em>) &#x2014;
Prediction type of the scheduler function; can be <code>epsilon</code> (predicts the noise of the diffusion process),
<code>sample</code> (directly predicts the noisy sample<code>) or </code>v_prediction\` (see section 2.4 of <a href="https://imagen.research.google/video/paper.pdf" rel="nofollow">Imagen
Video</a> paper).`,name:"prediction_type"},{anchor:"diffusers.DPMSolverMultistepScheduler.thresholding",description:`<strong>thresholding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the &#x201C;dynamic thresholding&#x201D; method. This is unsuitable for latent-space diffusion models such
as Stable Diffusion.`,name:"thresholding"},{anchor:"diffusers.DPMSolverMultistepScheduler.dynamic_thresholding_ratio",description:`<strong>dynamic_thresholding_ratio</strong> (<code>float</code>, defaults to 0.995) &#x2014;
The ratio for the dynamic thresholding method. Valid only when <code>thresholding=True</code>.`,name:"dynamic_thresholding_ratio"},{anchor:"diffusers.DPMSolverMultistepScheduler.sample_max_value",description:`<strong>sample_max_value</strong> (<code>float</code>, defaults to 1.0) &#x2014;
The threshold value for dynamic thresholding. Valid only when <code>thresholding=True</code> and
<code>algorithm_type=&quot;dpmsolver++&quot;</code>.`,name:"sample_max_value"},{anchor:"diffusers.DPMSolverMultistepScheduler.algorithm_type",description:`<strong>algorithm_type</strong> (<code>str</code>, defaults to <code>dpmsolver++</code>) &#x2014;
Algorithm type for the solver; can be <code>dpmsolver</code>, <code>dpmsolver++</code>, <code>sde-dpmsolver</code> or <code>sde-dpmsolver++</code>. The
<code>dpmsolver</code> type implements the algorithms in the <a href="https://huggingface.co/papers/2206.00927" rel="nofollow">DPMSolver</a>
paper, and the <code>dpmsolver++</code> type implements the algorithms in the
<a href="https://huggingface.co/papers/2211.01095" rel="nofollow">DPMSolver++</a> paper. It is recommended to use <code>dpmsolver++</code> or
<code>sde-dpmsolver++</code> with <code>solver_order=2</code> for guided sampling like in Stable Diffusion.`,name:"algorithm_type"},{anchor:"diffusers.DPMSolverMultistepScheduler.solver_type",description:`<strong>solver_type</strong> (<code>str</code>, defaults to <code>midpoint</code>) &#x2014;
Solver type for the second-order solver; can be <code>midpoint</code> or <code>heun</code>. The solver type slightly affects the
sample quality, especially for a small number of steps. It is recommended to use <code>midpoint</code> solvers.`,name:"solver_type"},{anchor:"diffusers.DPMSolverMultistepScheduler.lower_order_final",description:`<strong>lower_order_final</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to use lower-order solvers in the final steps. Only valid for &lt; 15 inference steps. This can
stabilize the sampling of DPMSolver for steps &lt; 15, especially for steps &lt;= 10.`,name:"lower_order_final"},{anchor:"diffusers.DPMSolverMultistepScheduler.use_karras_sigmas",description:`<strong>use_karras_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use Karras sigmas for step sizes in the noise schedule during the sampling process. If <code>True</code>,
the sigmas are determined according to a sequence of noise levels {&#x3C3;i}.`,name:"use_karras_sigmas"},{anchor:"diffusers.DPMSolverMultistepScheduler.lambda_min_clipped",description:`<strong>lambda_min_clipped</strong> (<code>float</code>, defaults to <code>-inf</code>) &#x2014;
Clipping threshold for the minimum value of <code>lambda(t)</code> for numerical stability. This is critical for the
cosine (<code>squaredcos_cap_v2</code>) noise schedule.`,name:"lambda_min_clipped"},{anchor:"diffusers.DPMSolverMultistepScheduler.variance_type",description:`<strong>variance_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Set to &#x201C;learned&#x201D; or &#x201C;learned_range&#x201D; for diffusion models that predict variance. If set, the model&#x2019;s output
contains the predicted Gaussian variance.`,name:"variance_type"},{anchor:"diffusers.DPMSolverMultistepScheduler.timestep_spacing",description:`<strong>timestep_spacing</strong> (<code>str</code>, defaults to <code>&quot;linspace&quot;</code>) &#x2014;
The way the timesteps should be scaled. Refer to Table 2 of the <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and
Sample Steps are Flawed</a> for more information.`,name:"timestep_spacing"},{anchor:"diffusers.DPMSolverMultistepScheduler.steps_offset",description:`<strong>steps_offset</strong> (<code>int</code>, defaults to 0) &#x2014;
An offset added to the inference steps. You can use a combination of <code>offset=1</code> and
<code>set_alpha_to_one=False</code> to make the last step use step 0 for the previous alpha product like in Stable
Diffusion.`,name:"steps_offset"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L73"}}),ee=new C({props:{name:"convert_model_output",anchor:"diffusers.DPMSolverMultistepScheduler.convert_model_output",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.convert_model_output.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014;
The direct output from the learned diffusion model.`,name:"model_output"},{anchor:"diffusers.DPMSolverMultistepScheduler.convert_model_output.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.convert_model_output.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L340",returnDescription:`
<p>The converted model output.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),N=new po({props:{$$slots:{default:[co]},$$scope:{ctx:Ge}}}),te=new C({props:{name:"dpm_solver_first_order_update",anchor:"diffusers.DPMSolverMultistepScheduler.dpm_solver_first_order_update",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"prev_timestep",val:": int"},{name:"sample",val:": FloatTensor"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.dpm_solver_first_order_update.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014;
The direct output from the learned diffusion model.`,name:"model_output"},{anchor:"diffusers.DPMSolverMultistepScheduler.dpm_solver_first_order_update.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.dpm_solver_first_order_update.prev_timestep",description:`<strong>prev_timestep</strong> (<code>int</code>) &#x2014;
The previous discrete timestep in the diffusion chain.`,name:"prev_timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.dpm_solver_first_order_update.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L420",returnDescription:`
<p>The sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),re=new C({props:{name:"multistep_dpm_solver_second_order_update",anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_second_order_update",parameters:[{name:"model_output_list",val:": typing.List[torch.FloatTensor]"},{name:"timestep_list",val:": typing.List[int]"},{name:"prev_timestep",val:": int"},{name:"sample",val:": FloatTensor"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_second_order_update.model_output_list",description:`<strong>model_output_list</strong> (<code>List[torch.FloatTensor]</code>) &#x2014;
The direct outputs from learned diffusion model at current and latter timesteps.`,name:"model_output_list"},{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_second_order_update.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current and latter discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_second_order_update.prev_timestep",description:`<strong>prev_timestep</strong> (<code>int</code>) &#x2014;
The previous discrete timestep in the diffusion chain.`,name:"prev_timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_second_order_update.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L469",returnDescription:`
<p>The sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),oe=new C({props:{name:"multistep_dpm_solver_third_order_update",anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_third_order_update",parameters:[{name:"model_output_list",val:": typing.List[torch.FloatTensor]"},{name:"timestep_list",val:": typing.List[int]"},{name:"prev_timestep",val:": int"},{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_third_order_update.model_output_list",description:`<strong>model_output_list</strong> (<code>List[torch.FloatTensor]</code>) &#x2014;
The direct outputs from learned diffusion model at current and latter timesteps.`,name:"model_output_list"},{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_third_order_update.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current and latter discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_third_order_update.prev_timestep",description:`<strong>prev_timestep</strong> (<code>int</code>) &#x2014;
The previous discrete timestep in the diffusion chain.`,name:"prev_timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.multistep_dpm_solver_third_order_update.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
A current instance of a sample created by diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L564",returnDescription:`
<p>The sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),se=new C({props:{name:"scale_model_input",anchor:"diffusers.DPMSolverMultistepScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The input sample.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L707",returnDescription:`
<p>A scaled input sample.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),ne=new C({props:{name:"set_timesteps",anchor:"diffusers.DPMSolverMultistepScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int = None"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) &#x2014;
The number of diffusion steps used when generating samples with a pre-trained model.`,name:"num_inference_steps"},{anchor:"diffusers.DPMSolverMultistepScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, <em>optional</em>) &#x2014;
The device to which the timesteps should be moved to. If <code>None</code>, the timesteps are not moved.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L207"}}),ie=new C({props:{name:"step",anchor:"diffusers.DPMSolverMultistepScheduler.step",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"sample",val:": FloatTensor"},{name:"generator",val:" = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014;
The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.DPMSolverMultistepScheduler.step.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverMultistepScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.DPMSolverMultistepScheduler.step.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"},{anchor:"diffusers.DPMSolverMultistepScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/schedulers/singlestep_dpm_solver#diffusers.schedulers.scheduling_utils.SchedulerOutput">SchedulerOutput</a> or <code>tuple</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L622",returnDescription:`
<p>If return_dict is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/schedulers/singlestep_dpm_solver#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> is returned, otherwise a
tuple is returned where the first element is the sample tensor.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/schedulers/singlestep_dpm_solver#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> or <code>tuple</code></p>
`}}),le=new ut({}),de=new C({props:{name:"class diffusers.schedulers.scheduling_utils.SchedulerOutput",anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput",parameters:[{name:"prev_sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput.prev_sample",description:`<strong>prev_sample</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) &#x2014;
Computed sample <code>(x_{t-1})</code> of previous timestep. <code>prev_sample</code> should be used as next model input in the
denoising loop.`,name:"prev_sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L50"}}),{c(){f=o("meta"),I=a(),v=o("h1"),P=o("a"),Se=o("span"),_(Z.$$.fragment),ht=a(),Me=o("span"),mt=i("DPMSolverMultistepScheduler"),Je=a(),$=o("p"),De=o("code"),ft=i("DPMSolverMultistep"),vt=i(" is a multistep scheduler from "),U=o("a"),_t=i("DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps"),gt=i(" and "),R=o("a"),St=i("DPM-Solver++: Fast Solver for Guided Sampling of Diffusion Probabilistic Models"),Mt=i(" by Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu."),Ye=a(),ue=o("p"),Dt=i(`DPMSolver (and the improved version DPMSolver++) is a fast dedicated high-order solver for diffusion ODEs with convergence order guarantee. Empirically, DPMSolver sampling with only 20 steps can generate high-quality
samples, and it can generate quite good samples even in 10 steps.`),He=a(),E=o("h2"),k=o("a"),be=o("span"),_(K.$$.fragment),bt=a(),Pe=o("span"),Pt=i("Tips"),We=a(),T=o("p"),yt=i("It is recommended to set "),ye=o("code"),$t=i("solver_order"),Tt=i(" to 2 for guide sampling, and "),$e=o("code"),xt=i("solver_order=3"),Et=i(" for unconditional sampling."),Ze=a(),y=o("p"),wt=i("Dynamic thresholding from Imagen ("),j=o("a"),Ft=i("https://huggingface.co/papers/2205.11487"),Ot=i(`) is supported, and for pixel-space
diffusion models, you can set both `),Te=o("code"),At=i('algorithm_type="dpmsolver++"'),Ct=i(" and "),xe=o("code"),It=i("thresholding=True"),kt=i(` to use the dynamic
thresholding. This thresholding method is unsuitable for latent-space diffusion models such as
Stable Diffusion.`),Ue=a(),L=o("p"),Lt=i("The SDE variant of DPMSolver and DPM-Solver++ is also supported, but only for the first and second-order solvers. This is a fast SDE solver for the reverse diffusion SDE. It is recommended to use the second-order "),Ee=o("code"),qt=i("sde-dpmsolver++"),Nt=i("."),Re=a(),w=o("h2"),q=o("a"),we=o("span"),_(Q.$$.fragment),Vt=a(),Fe=o("span"),zt=i("DPMSolverMultistepScheduler"),Ke=a(),u=o("div"),_(X.$$.fragment),Bt=a(),he=o("p"),Oe=o("code"),Gt=i("DPMSolverMultistepScheduler"),Jt=i(" is a fast dedicated high-order solver for diffusion ODEs."),Yt=a(),F=o("p"),Ht=i("This model inherits from "),me=o("a"),Wt=i("SchedulerMixin"),Zt=i(" and "),fe=o("a"),Ut=i("ConfigMixin"),Rt=i(`. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`),Kt=a(),x=o("div"),_(ee.$$.fragment),jt=a(),Ae=o("p"),Qt=i(`Convert the model output to the corresponding type the DPMSolver/DPMSolver++ algorithm needs. DPM-Solver is
designed to discretize an integral of the noise prediction model, and DPM-Solver++ is designed to discretize an
integral of the data prediction model.`),Xt=a(),_(N.$$.fragment),er=a(),V=o("div"),_(te.$$.fragment),tr=a(),Ce=o("p"),rr=i("One step for the first-order DPMSolver (equivalent to DDIM)."),or=a(),z=o("div"),_(re.$$.fragment),sr=a(),Ie=o("p"),nr=i("One step for the second-order multistep DPMSolver."),ir=a(),B=o("div"),_(oe.$$.fragment),lr=a(),ke=o("p"),dr=i("One step for the third-order multistep DPMSolver."),ar=a(),G=o("div"),_(se.$$.fragment),pr=a(),Le=o("p"),cr=i(`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),ur=a(),J=o("div"),_(ne.$$.fragment),hr=a(),qe=o("p"),mr=i("Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),fr=a(),Y=o("div"),_(ie.$$.fragment),vr=a(),Ne=o("p"),_r=i(`Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with
the multistep DPMSolver.`),je=a(),O=o("h2"),H=o("a"),Ve=o("span"),_(le.$$.fragment),gr=a(),ze=o("span"),Sr=i("SchedulerOutput"),Qe=a(),A=o("div"),_(de.$$.fragment),Mr=a(),ae=o("p"),Dr=i("Base class for the output of a scheduler\u2019s "),Be=o("code"),br=i("step"),Pr=i(" function."),this.h()},l(t){const c=lo('[data-svelte="svelte-1phssyn"]',document.head);f=s(c,"META",{name:!0,content:!0}),c.forEach(r),I=p(t),v=s(t,"H1",{class:!0});var pe=n(v);P=s(pe,"A",{id:!0,class:!0,href:!0});var $r=n(P);Se=s($r,"SPAN",{});var Tr=n(Se);g(Z.$$.fragment,Tr),Tr.forEach(r),$r.forEach(r),ht=p(pe),Me=s(pe,"SPAN",{});var xr=n(Me);mt=l(xr,"DPMSolverMultistepScheduler"),xr.forEach(r),pe.forEach(r),Je=p(t),$=s(t,"P",{});var ce=n($);De=s(ce,"CODE",{});var Er=n(De);ft=l(Er,"DPMSolverMultistep"),Er.forEach(r),vt=l(ce," is a multistep scheduler from "),U=s(ce,"A",{href:!0,rel:!0});var wr=n(U);_t=l(wr,"DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps"),wr.forEach(r),gt=l(ce," and "),R=s(ce,"A",{href:!0,rel:!0});var Fr=n(R);St=l(Fr,"DPM-Solver++: Fast Solver for Guided Sampling of Diffusion Probabilistic Models"),Fr.forEach(r),Mt=l(ce," by Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu."),ce.forEach(r),Ye=p(t),ue=s(t,"P",{});var Or=n(ue);Dt=l(Or,`DPMSolver (and the improved version DPMSolver++) is a fast dedicated high-order solver for diffusion ODEs with convergence order guarantee. Empirically, DPMSolver sampling with only 20 steps can generate high-quality
samples, and it can generate quite good samples even in 10 steps.`),Or.forEach(r),He=p(t),E=s(t,"H2",{class:!0});var et=n(E);k=s(et,"A",{id:!0,class:!0,href:!0});var Ar=n(k);be=s(Ar,"SPAN",{});var Cr=n(be);g(K.$$.fragment,Cr),Cr.forEach(r),Ar.forEach(r),bt=p(et),Pe=s(et,"SPAN",{});var Ir=n(Pe);Pt=l(Ir,"Tips"),Ir.forEach(r),et.forEach(r),We=p(t),T=s(t,"P",{});var ve=n(T);yt=l(ve,"It is recommended to set "),ye=s(ve,"CODE",{});var kr=n(ye);$t=l(kr,"solver_order"),kr.forEach(r),Tt=l(ve," to 2 for guide sampling, and "),$e=s(ve,"CODE",{});var Lr=n($e);xt=l(Lr,"solver_order=3"),Lr.forEach(r),Et=l(ve," for unconditional sampling."),ve.forEach(r),Ze=p(t),y=s(t,"P",{});var W=n(y);wt=l(W,"Dynamic thresholding from Imagen ("),j=s(W,"A",{href:!0,rel:!0});var qr=n(j);Ft=l(qr,"https://huggingface.co/papers/2205.11487"),qr.forEach(r),Ot=l(W,`) is supported, and for pixel-space
diffusion models, you can set both `),Te=s(W,"CODE",{});var Nr=n(Te);At=l(Nr,'algorithm_type="dpmsolver++"'),Nr.forEach(r),Ct=l(W," and "),xe=s(W,"CODE",{});var Vr=n(xe);It=l(Vr,"thresholding=True"),Vr.forEach(r),kt=l(W,` to use the dynamic
thresholding. This thresholding method is unsuitable for latent-space diffusion models such as
Stable Diffusion.`),W.forEach(r),Ue=p(t),L=s(t,"P",{});var tt=n(L);Lt=l(tt,"The SDE variant of DPMSolver and DPM-Solver++ is also supported, but only for the first and second-order solvers. This is a fast SDE solver for the reverse diffusion SDE. It is recommended to use the second-order "),Ee=s(tt,"CODE",{});var zr=n(Ee);qt=l(zr,"sde-dpmsolver++"),zr.forEach(r),Nt=l(tt,"."),tt.forEach(r),Re=p(t),w=s(t,"H2",{class:!0});var rt=n(w);q=s(rt,"A",{id:!0,class:!0,href:!0});var Br=n(q);we=s(Br,"SPAN",{});var Gr=n(we);g(Q.$$.fragment,Gr),Gr.forEach(r),Br.forEach(r),Vt=p(rt),Fe=s(rt,"SPAN",{});var Jr=n(Fe);zt=l(Jr,"DPMSolverMultistepScheduler"),Jr.forEach(r),rt.forEach(r),Ke=p(t),u=s(t,"DIV",{class:!0});var m=n(u);g(X.$$.fragment,m),Bt=p(m),he=s(m,"P",{});var yr=n(he);Oe=s(yr,"CODE",{});var Yr=n(Oe);Gt=l(Yr,"DPMSolverMultistepScheduler"),Yr.forEach(r),Jt=l(yr," is a fast dedicated high-order solver for diffusion ODEs."),yr.forEach(r),Yt=p(m),F=s(m,"P",{});var _e=n(F);Ht=l(_e,"This model inherits from "),me=s(_e,"A",{href:!0});var Hr=n(me);Wt=l(Hr,"SchedulerMixin"),Hr.forEach(r),Zt=l(_e," and "),fe=s(_e,"A",{href:!0});var Wr=n(fe);Ut=l(Wr,"ConfigMixin"),Wr.forEach(r),Rt=l(_e,`. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`),_e.forEach(r),Kt=p(m),x=s(m,"DIV",{class:!0});var ge=n(x);g(ee.$$.fragment,ge),jt=p(ge),Ae=s(ge,"P",{});var Zr=n(Ae);Qt=l(Zr,`Convert the model output to the corresponding type the DPMSolver/DPMSolver++ algorithm needs. DPM-Solver is
designed to discretize an integral of the noise prediction model, and DPM-Solver++ is designed to discretize an
integral of the data prediction model.`),Zr.forEach(r),Xt=p(ge),g(N.$$.fragment,ge),ge.forEach(r),er=p(m),V=s(m,"DIV",{class:!0});var ot=n(V);g(te.$$.fragment,ot),tr=p(ot),Ce=s(ot,"P",{});var Ur=n(Ce);rr=l(Ur,"One step for the first-order DPMSolver (equivalent to DDIM)."),Ur.forEach(r),ot.forEach(r),or=p(m),z=s(m,"DIV",{class:!0});var st=n(z);g(re.$$.fragment,st),sr=p(st),Ie=s(st,"P",{});var Rr=n(Ie);nr=l(Rr,"One step for the second-order multistep DPMSolver."),Rr.forEach(r),st.forEach(r),ir=p(m),B=s(m,"DIV",{class:!0});var nt=n(B);g(oe.$$.fragment,nt),lr=p(nt),ke=s(nt,"P",{});var Kr=n(ke);dr=l(Kr,"One step for the third-order multistep DPMSolver."),Kr.forEach(r),nt.forEach(r),ar=p(m),G=s(m,"DIV",{class:!0});var it=n(G);g(se.$$.fragment,it),pr=p(it),Le=s(it,"P",{});var jr=n(Le);cr=l(jr,`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),jr.forEach(r),it.forEach(r),ur=p(m),J=s(m,"DIV",{class:!0});var lt=n(J);g(ne.$$.fragment,lt),hr=p(lt),qe=s(lt,"P",{});var Qr=n(qe);mr=l(Qr,"Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),Qr.forEach(r),lt.forEach(r),fr=p(m),Y=s(m,"DIV",{class:!0});var dt=n(Y);g(ie.$$.fragment,dt),vr=p(dt),Ne=s(dt,"P",{});var Xr=n(Ne);_r=l(Xr,`Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with
the multistep DPMSolver.`),Xr.forEach(r),dt.forEach(r),m.forEach(r),je=p(t),O=s(t,"H2",{class:!0});var at=n(O);H=s(at,"A",{id:!0,class:!0,href:!0});var eo=n(H);Ve=s(eo,"SPAN",{});var to=n(Ve);g(le.$$.fragment,to),to.forEach(r),eo.forEach(r),gr=p(at),ze=s(at,"SPAN",{});var ro=n(ze);Sr=l(ro,"SchedulerOutput"),ro.forEach(r),at.forEach(r),Qe=p(t),A=s(t,"DIV",{class:!0});var pt=n(A);g(de.$$.fragment,pt),Mr=p(pt),ae=s(pt,"P",{});var ct=n(ae);Dr=l(ct,"Base class for the output of a scheduler\u2019s "),Be=s(ct,"CODE",{});var oo=n(Be);br=l(oo,"step"),oo.forEach(r),Pr=l(ct," function."),ct.forEach(r),pt.forEach(r),this.h()},h(){d(f,"name","hf:doc:metadata"),d(f,"content",JSON.stringify(ho)),d(P,"id","dpmsolvermultistepscheduler"),d(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(P,"href","#dpmsolvermultistepscheduler"),d(v,"class","relative group"),d(U,"href","https://huggingface.co/papers/2206.00927"),d(U,"rel","nofollow"),d(R,"href","https://huggingface.co/papers/2211.01095"),d(R,"rel","nofollow"),d(k,"id","tips"),d(k,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(k,"href","#tips"),d(E,"class","relative group"),d(j,"href","https://huggingface.co/papers/2205.11487"),d(j,"rel","nofollow"),d(q,"id","diffusers.DPMSolverMultistepScheduler"),d(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(q,"href","#diffusers.DPMSolverMultistepScheduler"),d(w,"class","relative group"),d(me,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),d(fe,"href","/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin"),d(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(H,"id","diffusers.schedulers.scheduling_utils.SchedulerOutput"),d(H,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(H,"href","#diffusers.schedulers.scheduling_utils.SchedulerOutput"),d(O,"class","relative group"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,c){e(document.head,f),h(t,I,c),h(t,v,c),e(v,P),e(P,Se),S(Z,Se,null),e(v,ht),e(v,Me),e(Me,mt),h(t,Je,c),h(t,$,c),e($,De),e(De,ft),e($,vt),e($,U),e(U,_t),e($,gt),e($,R),e(R,St),e($,Mt),h(t,Ye,c),h(t,ue,c),e(ue,Dt),h(t,He,c),h(t,E,c),e(E,k),e(k,be),S(K,be,null),e(E,bt),e(E,Pe),e(Pe,Pt),h(t,We,c),h(t,T,c),e(T,yt),e(T,ye),e(ye,$t),e(T,Tt),e(T,$e),e($e,xt),e(T,Et),h(t,Ze,c),h(t,y,c),e(y,wt),e(y,j),e(j,Ft),e(y,Ot),e(y,Te),e(Te,At),e(y,Ct),e(y,xe),e(xe,It),e(y,kt),h(t,Ue,c),h(t,L,c),e(L,Lt),e(L,Ee),e(Ee,qt),e(L,Nt),h(t,Re,c),h(t,w,c),e(w,q),e(q,we),S(Q,we,null),e(w,Vt),e(w,Fe),e(Fe,zt),h(t,Ke,c),h(t,u,c),S(X,u,null),e(u,Bt),e(u,he),e(he,Oe),e(Oe,Gt),e(he,Jt),e(u,Yt),e(u,F),e(F,Ht),e(F,me),e(me,Wt),e(F,Zt),e(F,fe),e(fe,Ut),e(F,Rt),e(u,Kt),e(u,x),S(ee,x,null),e(x,jt),e(x,Ae),e(Ae,Qt),e(x,Xt),S(N,x,null),e(u,er),e(u,V),S(te,V,null),e(V,tr),e(V,Ce),e(Ce,rr),e(u,or),e(u,z),S(re,z,null),e(z,sr),e(z,Ie),e(Ie,nr),e(u,ir),e(u,B),S(oe,B,null),e(B,lr),e(B,ke),e(ke,dr),e(u,ar),e(u,G),S(se,G,null),e(G,pr),e(G,Le),e(Le,cr),e(u,ur),e(u,J),S(ne,J,null),e(J,hr),e(J,qe),e(qe,mr),e(u,fr),e(u,Y),S(ie,Y,null),e(Y,vr),e(Y,Ne),e(Ne,_r),h(t,je,c),h(t,O,c),e(O,H),e(H,Ve),S(le,Ve,null),e(O,gr),e(O,ze),e(ze,Sr),h(t,Qe,c),h(t,A,c),S(de,A,null),e(A,Mr),e(A,ae),e(ae,Dr),e(ae,Be),e(Be,br),e(ae,Pr),Xe=!0},p(t,[c]){const pe={};c&2&&(pe.$$scope={dirty:c,ctx:t}),N.$set(pe)},i(t){Xe||(M(Z.$$.fragment,t),M(K.$$.fragment,t),M(Q.$$.fragment,t),M(X.$$.fragment,t),M(ee.$$.fragment,t),M(N.$$.fragment,t),M(te.$$.fragment,t),M(re.$$.fragment,t),M(oe.$$.fragment,t),M(se.$$.fragment,t),M(ne.$$.fragment,t),M(ie.$$.fragment,t),M(le.$$.fragment,t),M(de.$$.fragment,t),Xe=!0)},o(t){D(Z.$$.fragment,t),D(K.$$.fragment,t),D(Q.$$.fragment,t),D(X.$$.fragment,t),D(ee.$$.fragment,t),D(N.$$.fragment,t),D(te.$$.fragment,t),D(re.$$.fragment,t),D(oe.$$.fragment,t),D(se.$$.fragment,t),D(ne.$$.fragment,t),D(ie.$$.fragment,t),D(le.$$.fragment,t),D(de.$$.fragment,t),Xe=!1},d(t){r(f),t&&r(I),t&&r(v),b(Z),t&&r(Je),t&&r($),t&&r(Ye),t&&r(ue),t&&r(He),t&&r(E),b(K),t&&r(We),t&&r(T),t&&r(Ze),t&&r(y),t&&r(Ue),t&&r(L),t&&r(Re),t&&r(w),b(Q),t&&r(Ke),t&&r(u),b(X),b(ee),b(N),b(te),b(re),b(oe),b(se),b(ne),b(ie),t&&r(je),t&&r(O),b(le),t&&r(Qe),t&&r(A),b(de)}}}const ho={local:"dpmsolvermultistepscheduler",sections:[{local:"tips",title:"Tips"},{local:"diffusers.DPMSolverMultistepScheduler",title:"DPMSolverMultistepScheduler"},{local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",title:"SchedulerOutput"}],title:"DPMSolverMultistepScheduler"};function mo(Ge){return ao(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class So extends so{constructor(f){super();no(this,f,mo,uo,io,{})}}export{So as default,ho as metadata};
