import{S as es,i as ts,s as rs,e as s,k as a,w as _,t as i,M as ss,c as o,d as r,m as c,a as n,x as g,h as l,b as d,G as e,g as f,y as S,q as M,o as b,B as D,v as os}from"../../../chunks/vendor-hf-doc-builder.js";import{T as ns}from"../../../chunks/Tip-hf-doc-builder.js";import{D as A}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as at}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function is(Be){let m,C;return{c(){m=s("p"),C=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){m=o(v,"P",{});var y=n(m);C=l(y,`The algorithm and model type are decoupled. You can use either DPMSolver or DPMSolver++ for both noise
prediction and data prediction models.`),y.forEach(r)},m(v,y){f(v,m,y),e(m,C)},d(v){v&&r(m)}}}function ls(Be){let m,C,v,y,Me,Z,ct,be,pt,Je,T,De,ut,ht,U,ft,mt,X,vt,_t,Ye,P,gt,K,St,Mt,ye,bt,Dt,j,yt,Pt,He,x,k,Pe,Q,$t,$e,Tt,Re,$,It,ee,xt,Et,Te,wt,Ft,Ie,Ot,At,We,E,L,xe,te,Ct,Ee,kt,Ze,p,re,Lt,N,we,Nt,qt,me,Vt,zt,Gt,w,Bt,ve,Jt,Yt,_e,Ht,Rt,Wt,I,se,Zt,Fe,Ut,Xt,q,Kt,V,oe,jt,Oe,Qt,er,z,ne,tr,Ae,rr,sr,G,ie,or,Ce,nr,ir,B,le,lr,ke,dr,ar,J,de,cr,Le,pr,ur,Y,ae,hr,Ne,fr,Ue,F,H,qe,ce,mr,Ve,vr,Xe,O,pe,_r,ue,gr,ze,Sr,Mr,Ke;return Z=new at({}),Q=new at({}),te=new at({}),re=new A({props:{name:"class diffusers.DPMSolverMultistepInverseScheduler",anchor:"diffusers.DPMSolverMultistepInverseScheduler",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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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_inverse.py#L73"}}),se=new A({props:{name:"convert_model_output",anchor:"diffusers.DPMSolverMultistepInverseScheduler.convert_model_output",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.convert_model_output.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverMultistepInverseScheduler.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_inverse.py#L343",returnDescription:`
<p>The converted model output.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),q=new ns({props:{$$slots:{default:[is]},$$scope:{ctx:Be}}}),oe=new A({props:{name:"dpm_solver_first_order_update",anchor:"diffusers.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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_inverse.py#L423",returnDescription:`
<p>The sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),ne=new A({props:{name:"multistep_dpm_solver_second_order_update",anchor:"diffusers.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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_inverse.py#L462",returnDescription:`
<p>The sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),ie=new A({props:{name:"multistep_dpm_solver_third_order_update",anchor:"diffusers.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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_inverse.py#L530",returnDescription:`
<p>The sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),le=new A({props:{name:"scale_model_input",anchor:"diffusers.DPMSolverMultistepInverseScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepInverseScheduler.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_inverse.py#L674",returnDescription:`
<p>A scaled input sample.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),de=new A({props:{name:"set_timesteps",anchor:"diffusers.DPMSolverMultistepInverseScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int = None"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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_inverse.py#L208"}}),ae=new A({props:{name:"step",anchor:"diffusers.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.step.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverMultistepInverseScheduler.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.DPMSolverMultistepInverseScheduler.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/dpm_discrete#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_inverse.py#L588",returnDescription:`
<p>If return_dict is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/schedulers/dpm_discrete#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/dpm_discrete#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> or <code>tuple</code></p>
`}}),ce=new at({}),pe=new A({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(){m=s("meta"),C=a(),v=s("h1"),y=s("a"),Me=s("span"),_(Z.$$.fragment),ct=a(),be=s("span"),pt=i("DPMSolverMultistepInverse"),Je=a(),T=s("p"),De=s("code"),ut=i("DPMSolverMultistepInverse"),ht=i(" is the inverted scheduler from "),U=s("a"),ft=i("DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps"),mt=i(" and "),X=s("a"),vt=i("DPM-Solver++: Fast Solver for Guided Sampling of Diffusion Probabilistic Models"),_t=i(" by Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu."),Ye=a(),P=s("p"),gt=i("The implementation is mostly based on the DDIM inversion definition of "),K=s("a"),St=i("Null-text Inversion for Editing Real Images using Guided Diffusion Models"),Mt=i(" and notebook implementation of the "),ye=s("code"),bt=i("DiffEdit"),Dt=i(" latent inversion from "),j=s("a"),yt=i("Xiang-cd/DiffEdit-stable-diffusion"),Pt=i("."),He=a(),x=s("h2"),k=s("a"),Pe=s("span"),_(Q.$$.fragment),$t=a(),$e=s("span"),Tt=i("Tips"),Re=a(),$=s("p"),It=i("Dynamic thresholding from Imagen ("),ee=s("a"),xt=i("https://huggingface.co/papers/2205.11487"),Et=i(`) is supported, and for pixel-space
diffusion models, you can set both `),Te=s("code"),wt=i('algorithm_type="dpmsolver++"'),Ft=i(" and "),Ie=s("code"),Ot=i("thresholding=True"),At=i(` to use the dynamic
thresholding. This thresholding method is unsuitable for latent-space diffusion models such as
Stable Diffusion.`),We=a(),E=s("h2"),L=s("a"),xe=s("span"),_(te.$$.fragment),Ct=a(),Ee=s("span"),kt=i("DPMSolverMultistepInverseScheduler"),Ze=a(),p=s("div"),_(re.$$.fragment),Lt=a(),N=s("p"),we=s("code"),Nt=i("DPMSolverMultistepInverseScheduler"),qt=i(" is the reverse scheduler of "),me=s("a"),Vt=i("DPMSolverMultistepScheduler"),zt=i("."),Gt=a(),w=s("p"),Bt=i("This model inherits from "),ve=s("a"),Jt=i("SchedulerMixin"),Yt=i(" and "),_e=s("a"),Ht=i("ConfigMixin"),Rt=i(`. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`),Wt=a(),I=s("div"),_(se.$$.fragment),Zt=a(),Fe=s("p"),Ut=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(),_(q.$$.fragment),Kt=a(),V=s("div"),_(oe.$$.fragment),jt=a(),Oe=s("p"),Qt=i("One step for the first-order DPMSolver (equivalent to DDIM)."),er=a(),z=s("div"),_(ne.$$.fragment),tr=a(),Ae=s("p"),rr=i("One step for the second-order multistep DPMSolver."),sr=a(),G=s("div"),_(ie.$$.fragment),or=a(),Ce=s("p"),nr=i("One step for the third-order multistep DPMSolver."),ir=a(),B=s("div"),_(le.$$.fragment),lr=a(),ke=s("p"),dr=i(`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),ar=a(),J=s("div"),_(de.$$.fragment),cr=a(),Le=s("p"),pr=i("Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),ur=a(),Y=s("div"),_(ae.$$.fragment),hr=a(),Ne=s("p"),fr=i(`Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with
the multistep DPMSolver.`),Ue=a(),F=s("h2"),H=s("a"),qe=s("span"),_(ce.$$.fragment),mr=a(),Ve=s("span"),vr=i("SchedulerOutput"),Xe=a(),O=s("div"),_(pe.$$.fragment),_r=a(),ue=s("p"),gr=i("Base class for the output of a scheduler\u2019s "),ze=s("code"),Sr=i("step"),Mr=i(" function."),this.h()},l(t){const u=ss('[data-svelte="svelte-1phssyn"]',document.head);m=o(u,"META",{name:!0,content:!0}),u.forEach(r),C=c(t),v=o(t,"H1",{class:!0});var he=n(v);y=o(he,"A",{id:!0,class:!0,href:!0});var br=n(y);Me=o(br,"SPAN",{});var Dr=n(Me);g(Z.$$.fragment,Dr),Dr.forEach(r),br.forEach(r),ct=c(he),be=o(he,"SPAN",{});var yr=n(be);pt=l(yr,"DPMSolverMultistepInverse"),yr.forEach(r),he.forEach(r),Je=c(t),T=o(t,"P",{});var fe=n(T);De=o(fe,"CODE",{});var Pr=n(De);ut=l(Pr,"DPMSolverMultistepInverse"),Pr.forEach(r),ht=l(fe," is the inverted scheduler from "),U=o(fe,"A",{href:!0,rel:!0});var $r=n(U);ft=l($r,"DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps"),$r.forEach(r),mt=l(fe," and "),X=o(fe,"A",{href:!0,rel:!0});var Tr=n(X);vt=l(Tr,"DPM-Solver++: Fast Solver for Guided Sampling of Diffusion Probabilistic Models"),Tr.forEach(r),_t=l(fe," by Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu."),fe.forEach(r),Ye=c(t),P=o(t,"P",{});var R=n(P);gt=l(R,"The implementation is mostly based on the DDIM inversion definition of "),K=o(R,"A",{href:!0,rel:!0});var Ir=n(K);St=l(Ir,"Null-text Inversion for Editing Real Images using Guided Diffusion Models"),Ir.forEach(r),Mt=l(R," and notebook implementation of the "),ye=o(R,"CODE",{});var xr=n(ye);bt=l(xr,"DiffEdit"),xr.forEach(r),Dt=l(R," latent inversion from "),j=o(R,"A",{href:!0,rel:!0});var Er=n(j);yt=l(Er,"Xiang-cd/DiffEdit-stable-diffusion"),Er.forEach(r),Pt=l(R,"."),R.forEach(r),He=c(t),x=o(t,"H2",{class:!0});var je=n(x);k=o(je,"A",{id:!0,class:!0,href:!0});var wr=n(k);Pe=o(wr,"SPAN",{});var Fr=n(Pe);g(Q.$$.fragment,Fr),Fr.forEach(r),wr.forEach(r),$t=c(je),$e=o(je,"SPAN",{});var Or=n($e);Tt=l(Or,"Tips"),Or.forEach(r),je.forEach(r),Re=c(t),$=o(t,"P",{});var W=n($);It=l(W,"Dynamic thresholding from Imagen ("),ee=o(W,"A",{href:!0,rel:!0});var Ar=n(ee);xt=l(Ar,"https://huggingface.co/papers/2205.11487"),Ar.forEach(r),Et=l(W,`) is supported, and for pixel-space
diffusion models, you can set both `),Te=o(W,"CODE",{});var Cr=n(Te);wt=l(Cr,'algorithm_type="dpmsolver++"'),Cr.forEach(r),Ft=l(W," and "),Ie=o(W,"CODE",{});var kr=n(Ie);Ot=l(kr,"thresholding=True"),kr.forEach(r),At=l(W,` to use the dynamic
thresholding. This thresholding method is unsuitable for latent-space diffusion models such as
Stable Diffusion.`),W.forEach(r),We=c(t),E=o(t,"H2",{class:!0});var Qe=n(E);L=o(Qe,"A",{id:!0,class:!0,href:!0});var Lr=n(L);xe=o(Lr,"SPAN",{});var Nr=n(xe);g(te.$$.fragment,Nr),Nr.forEach(r),Lr.forEach(r),Ct=c(Qe),Ee=o(Qe,"SPAN",{});var qr=n(Ee);kt=l(qr,"DPMSolverMultistepInverseScheduler"),qr.forEach(r),Qe.forEach(r),Ze=c(t),p=o(t,"DIV",{class:!0});var h=n(p);g(re.$$.fragment,h),Lt=c(h),N=o(h,"P",{});var Ge=n(N);we=o(Ge,"CODE",{});var Vr=n(we);Nt=l(Vr,"DPMSolverMultistepInverseScheduler"),Vr.forEach(r),qt=l(Ge," is the reverse scheduler of "),me=o(Ge,"A",{href:!0});var zr=n(me);Vt=l(zr,"DPMSolverMultistepScheduler"),zr.forEach(r),zt=l(Ge,"."),Ge.forEach(r),Gt=c(h),w=o(h,"P",{});var ge=n(w);Bt=l(ge,"This model inherits from "),ve=o(ge,"A",{href:!0});var Gr=n(ve);Jt=l(Gr,"SchedulerMixin"),Gr.forEach(r),Yt=l(ge," and "),_e=o(ge,"A",{href:!0});var Br=n(_e);Ht=l(Br,"ConfigMixin"),Br.forEach(r),Rt=l(ge,`. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`),ge.forEach(r),Wt=c(h),I=o(h,"DIV",{class:!0});var Se=n(I);g(se.$$.fragment,Se),Zt=c(Se),Fe=o(Se,"P",{});var Jr=n(Fe);Ut=l(Jr,`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.`),Jr.forEach(r),Xt=c(Se),g(q.$$.fragment,Se),Se.forEach(r),Kt=c(h),V=o(h,"DIV",{class:!0});var et=n(V);g(oe.$$.fragment,et),jt=c(et),Oe=o(et,"P",{});var Yr=n(Oe);Qt=l(Yr,"One step for the first-order DPMSolver (equivalent to DDIM)."),Yr.forEach(r),et.forEach(r),er=c(h),z=o(h,"DIV",{class:!0});var tt=n(z);g(ne.$$.fragment,tt),tr=c(tt),Ae=o(tt,"P",{});var Hr=n(Ae);rr=l(Hr,"One step for the second-order multistep DPMSolver."),Hr.forEach(r),tt.forEach(r),sr=c(h),G=o(h,"DIV",{class:!0});var rt=n(G);g(ie.$$.fragment,rt),or=c(rt),Ce=o(rt,"P",{});var Rr=n(Ce);nr=l(Rr,"One step for the third-order multistep DPMSolver."),Rr.forEach(r),rt.forEach(r),ir=c(h),B=o(h,"DIV",{class:!0});var st=n(B);g(le.$$.fragment,st),lr=c(st),ke=o(st,"P",{});var Wr=n(ke);dr=l(Wr,`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),Wr.forEach(r),st.forEach(r),ar=c(h),J=o(h,"DIV",{class:!0});var ot=n(J);g(de.$$.fragment,ot),cr=c(ot),Le=o(ot,"P",{});var Zr=n(Le);pr=l(Zr,"Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),Zr.forEach(r),ot.forEach(r),ur=c(h),Y=o(h,"DIV",{class:!0});var nt=n(Y);g(ae.$$.fragment,nt),hr=c(nt),Ne=o(nt,"P",{});var Ur=n(Ne);fr=l(Ur,`Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with
the multistep DPMSolver.`),Ur.forEach(r),nt.forEach(r),h.forEach(r),Ue=c(t),F=o(t,"H2",{class:!0});var it=n(F);H=o(it,"A",{id:!0,class:!0,href:!0});var Xr=n(H);qe=o(Xr,"SPAN",{});var Kr=n(qe);g(ce.$$.fragment,Kr),Kr.forEach(r),Xr.forEach(r),mr=c(it),Ve=o(it,"SPAN",{});var jr=n(Ve);vr=l(jr,"SchedulerOutput"),jr.forEach(r),it.forEach(r),Xe=c(t),O=o(t,"DIV",{class:!0});var lt=n(O);g(pe.$$.fragment,lt),_r=c(lt),ue=o(lt,"P",{});var dt=n(ue);gr=l(dt,"Base class for the output of a scheduler\u2019s "),ze=o(dt,"CODE",{});var Qr=n(ze);Sr=l(Qr,"step"),Qr.forEach(r),Mr=l(dt," function."),dt.forEach(r),lt.forEach(r),this.h()},h(){d(m,"name","hf:doc:metadata"),d(m,"content",JSON.stringify(ds)),d(y,"id","dpmsolvermultistepinverse"),d(y,"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(y,"href","#dpmsolvermultistepinverse"),d(v,"class","relative group"),d(U,"href","https://huggingface.co/papers/2206.00927"),d(U,"rel","nofollow"),d(X,"href","https://huggingface.co/papers/2211.01095"),d(X,"rel","nofollow"),d(K,"href","https://huggingface.co/papers/2211.09794.pdf"),d(K,"rel","nofollow"),d(j,"href","https://github.com/Xiang-cd/DiffEdit-stable-diffusion/blob/main/diffedit.ipynb"),d(j,"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(x,"class","relative group"),d(ee,"href","https://huggingface.co/papers/2205.11487"),d(ee,"rel","nofollow"),d(L,"id","diffusers.DPMSolverMultistepInverseScheduler"),d(L,"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(L,"href","#diffusers.DPMSolverMultistepInverseScheduler"),d(E,"class","relative group"),d(me,"href","/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler"),d(ve,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),d(_e,"href","/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin"),d(I,"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(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(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(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(p,"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(F,"class","relative group"),d(O,"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,u){e(document.head,m),f(t,C,u),f(t,v,u),e(v,y),e(y,Me),S(Z,Me,null),e(v,ct),e(v,be),e(be,pt),f(t,Je,u),f(t,T,u),e(T,De),e(De,ut),e(T,ht),e(T,U),e(U,ft),e(T,mt),e(T,X),e(X,vt),e(T,_t),f(t,Ye,u),f(t,P,u),e(P,gt),e(P,K),e(K,St),e(P,Mt),e(P,ye),e(ye,bt),e(P,Dt),e(P,j),e(j,yt),e(P,Pt),f(t,He,u),f(t,x,u),e(x,k),e(k,Pe),S(Q,Pe,null),e(x,$t),e(x,$e),e($e,Tt),f(t,Re,u),f(t,$,u),e($,It),e($,ee),e(ee,xt),e($,Et),e($,Te),e(Te,wt),e($,Ft),e($,Ie),e(Ie,Ot),e($,At),f(t,We,u),f(t,E,u),e(E,L),e(L,xe),S(te,xe,null),e(E,Ct),e(E,Ee),e(Ee,kt),f(t,Ze,u),f(t,p,u),S(re,p,null),e(p,Lt),e(p,N),e(N,we),e(we,Nt),e(N,qt),e(N,me),e(me,Vt),e(N,zt),e(p,Gt),e(p,w),e(w,Bt),e(w,ve),e(ve,Jt),e(w,Yt),e(w,_e),e(_e,Ht),e(w,Rt),e(p,Wt),e(p,I),S(se,I,null),e(I,Zt),e(I,Fe),e(Fe,Ut),e(I,Xt),S(q,I,null),e(p,Kt),e(p,V),S(oe,V,null),e(V,jt),e(V,Oe),e(Oe,Qt),e(p,er),e(p,z),S(ne,z,null),e(z,tr),e(z,Ae),e(Ae,rr),e(p,sr),e(p,G),S(ie,G,null),e(G,or),e(G,Ce),e(Ce,nr),e(p,ir),e(p,B),S(le,B,null),e(B,lr),e(B,ke),e(ke,dr),e(p,ar),e(p,J),S(de,J,null),e(J,cr),e(J,Le),e(Le,pr),e(p,ur),e(p,Y),S(ae,Y,null),e(Y,hr),e(Y,Ne),e(Ne,fr),f(t,Ue,u),f(t,F,u),e(F,H),e(H,qe),S(ce,qe,null),e(F,mr),e(F,Ve),e(Ve,vr),f(t,Xe,u),f(t,O,u),S(pe,O,null),e(O,_r),e(O,ue),e(ue,gr),e(ue,ze),e(ze,Sr),e(ue,Mr),Ke=!0},p(t,[u]){const he={};u&2&&(he.$$scope={dirty:u,ctx:t}),q.$set(he)},i(t){Ke||(M(Z.$$.fragment,t),M(Q.$$.fragment,t),M(te.$$.fragment,t),M(re.$$.fragment,t),M(se.$$.fragment,t),M(q.$$.fragment,t),M(oe.$$.fragment,t),M(ne.$$.fragment,t),M(ie.$$.fragment,t),M(le.$$.fragment,t),M(de.$$.fragment,t),M(ae.$$.fragment,t),M(ce.$$.fragment,t),M(pe.$$.fragment,t),Ke=!0)},o(t){b(Z.$$.fragment,t),b(Q.$$.fragment,t),b(te.$$.fragment,t),b(re.$$.fragment,t),b(se.$$.fragment,t),b(q.$$.fragment,t),b(oe.$$.fragment,t),b(ne.$$.fragment,t),b(ie.$$.fragment,t),b(le.$$.fragment,t),b(de.$$.fragment,t),b(ae.$$.fragment,t),b(ce.$$.fragment,t),b(pe.$$.fragment,t),Ke=!1},d(t){r(m),t&&r(C),t&&r(v),D(Z),t&&r(Je),t&&r(T),t&&r(Ye),t&&r(P),t&&r(He),t&&r(x),D(Q),t&&r(Re),t&&r($),t&&r(We),t&&r(E),D(te),t&&r(Ze),t&&r(p),D(re),D(se),D(q),D(oe),D(ne),D(ie),D(le),D(de),D(ae),t&&r(Ue),t&&r(F),D(ce),t&&r(Xe),t&&r(O),D(pe)}}}const ds={local:"dpmsolvermultistepinverse",sections:[{local:"tips",title:"Tips"},{local:"diffusers.DPMSolverMultistepInverseScheduler",title:"DPMSolverMultistepInverseScheduler"},{local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",title:"SchedulerOutput"}],title:"DPMSolverMultistepInverse"};function as(Be){return os(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fs extends es{constructor(m){super();ts(this,m,as,ls,rs,{})}}export{fs as default,ds as metadata};
