import{S as es,i as ts,s as rs,e as s,k as d,w as _,t as i,M as ss,c as o,d as r,m as p,a as n,x as g,h as l,b as a,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 dt}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,pt,be,ct,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,c,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,ar,dr,J,ae,pr,Le,cr,ur,Y,de,hr,Ne,fr,Ue,F,H,qe,pe,mr,Ve,vr,Xe,O,ce,_r,ue,gr,ze,Sr,Mr,Ke;return Z=new dt({}),Q=new dt({}),te=new dt({}),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>
`}}),ae=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"}}),de=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/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_inverse.py#L588",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>
`}}),pe=new dt({}),ce=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=d(),v=s("h1"),y=s("a"),Me=s("span"),_(Z.$$.fragment),pt=d(),be=s("span"),ct=i("DPMSolverMultistepInverse"),Je=d(),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=d(),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=d(),x=s("h2"),k=s("a"),Pe=s("span"),_(Q.$$.fragment),$t=d(),$e=s("span"),Tt=i("Tips"),Re=d(),$=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=d(),E=s("h2"),L=s("a"),xe=s("span"),_(te.$$.fragment),Ct=d(),Ee=s("span"),kt=i("DPMSolverMultistepInverseScheduler"),Ze=d(),c=s("div"),_(re.$$.fragment),Lt=d(),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=d(),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=d(),I=s("div"),_(se.$$.fragment),Zt=d(),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=d(),_(q.$$.fragment),Kt=d(),V=s("div"),_(oe.$$.fragment),jt=d(),Oe=s("p"),Qt=i("One step for the first-order DPMSolver (equivalent to DDIM)."),er=d(),z=s("div"),_(ne.$$.fragment),tr=d(),Ae=s("p"),rr=i("One step for the second-order multistep DPMSolver."),sr=d(),G=s("div"),_(ie.$$.fragment),or=d(),Ce=s("p"),nr=i("One step for the third-order multistep DPMSolver."),ir=d(),B=s("div"),_(le.$$.fragment),lr=d(),ke=s("p"),ar=i(`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),dr=d(),J=s("div"),_(ae.$$.fragment),pr=d(),Le=s("p"),cr=i("Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),ur=d(),Y=s("div"),_(de.$$.fragment),hr=d(),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=d(),F=s("h2"),H=s("a"),qe=s("span"),_(pe.$$.fragment),mr=d(),Ve=s("span"),vr=i("SchedulerOutput"),Xe=d(),O=s("div"),_(ce.$$.fragment),_r=d(),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=p(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),pt=p(he),be=o(he,"SPAN",{});var yr=n(be);ct=l(yr,"DPMSolverMultistepInverse"),yr.forEach(r),he.forEach(r),Je=p(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=p(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=p(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=p(je),$e=o(je,"SPAN",{});var Or=n($e);Tt=l(Or,"Tips"),Or.forEach(r),je.forEach(r),Re=p(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=p(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=p(Qe),Ee=o(Qe,"SPAN",{});var qr=n(Ee);kt=l(qr,"DPMSolverMultistepInverseScheduler"),qr.forEach(r),Qe.forEach(r),Ze=p(t),c=o(t,"DIV",{class:!0});var h=n(c);g(re.$$.fragment,h),Lt=p(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=p(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=p(h),I=o(h,"DIV",{class:!0});var Se=n(I);g(se.$$.fragment,Se),Zt=p(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=p(Se),g(q.$$.fragment,Se),Se.forEach(r),Kt=p(h),V=o(h,"DIV",{class:!0});var et=n(V);g(oe.$$.fragment,et),jt=p(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=p(h),z=o(h,"DIV",{class:!0});var tt=n(z);g(ne.$$.fragment,tt),tr=p(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=p(h),G=o(h,"DIV",{class:!0});var rt=n(G);g(ie.$$.fragment,rt),or=p(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=p(h),B=o(h,"DIV",{class:!0});var st=n(B);g(le.$$.fragment,st),lr=p(st),ke=o(st,"P",{});var Wr=n(ke);ar=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),dr=p(h),J=o(h,"DIV",{class:!0});var ot=n(J);g(ae.$$.fragment,ot),pr=p(ot),Le=o(ot,"P",{});var Zr=n(Le);cr=l(Zr,"Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),Zr.forEach(r),ot.forEach(r),ur=p(h),Y=o(h,"DIV",{class:!0});var nt=n(Y);g(de.$$.fragment,nt),hr=p(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=p(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(pe.$$.fragment,Kr),Kr.forEach(r),Xr.forEach(r),mr=p(it),Ve=o(it,"SPAN",{});var jr=n(Ve);vr=l(jr,"SchedulerOutput"),jr.forEach(r),it.forEach(r),Xe=p(t),O=o(t,"DIV",{class:!0});var lt=n(O);g(ce.$$.fragment,lt),_r=p(lt),ue=o(lt,"P",{});var at=n(ue);gr=l(at,"Base class for the output of a scheduler\u2019s "),ze=o(at,"CODE",{});var Qr=n(ze);Sr=l(Qr,"step"),Qr.forEach(r),Mr=l(at," function."),at.forEach(r),lt.forEach(r),this.h()},h(){a(m,"name","hf:doc:metadata"),a(m,"content",JSON.stringify(as)),a(y,"id","dpmsolvermultistepinverse"),a(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"),a(y,"href","#dpmsolvermultistepinverse"),a(v,"class","relative group"),a(U,"href","https://huggingface.co/papers/2206.00927"),a(U,"rel","nofollow"),a(X,"href","https://huggingface.co/papers/2211.01095"),a(X,"rel","nofollow"),a(K,"href","https://huggingface.co/papers/2211.09794.pdf"),a(K,"rel","nofollow"),a(j,"href","https://github.com/Xiang-cd/DiffEdit-stable-diffusion/blob/main/diffedit.ipynb"),a(j,"rel","nofollow"),a(k,"id","tips"),a(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"),a(k,"href","#tips"),a(x,"class","relative group"),a(ee,"href","https://huggingface.co/papers/2205.11487"),a(ee,"rel","nofollow"),a(L,"id","diffusers.DPMSolverMultistepInverseScheduler"),a(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"),a(L,"href","#diffusers.DPMSolverMultistepInverseScheduler"),a(E,"class","relative group"),a(me,"href","/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler"),a(ve,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),a(_e,"href","/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin"),a(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(H,"id","diffusers.schedulers.scheduling_utils.SchedulerOutput"),a(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"),a(H,"href","#diffusers.schedulers.scheduling_utils.SchedulerOutput"),a(F,"class","relative group"),a(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,pt),e(v,be),e(be,ct),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,c,u),S(re,c,null),e(c,Lt),e(c,N),e(N,we),e(we,Nt),e(N,qt),e(N,me),e(me,Vt),e(N,zt),e(c,Gt),e(c,w),e(w,Bt),e(w,ve),e(ve,Jt),e(w,Yt),e(w,_e),e(_e,Ht),e(w,Rt),e(c,Wt),e(c,I),S(se,I,null),e(I,Zt),e(I,Fe),e(Fe,Ut),e(I,Xt),S(q,I,null),e(c,Kt),e(c,V),S(oe,V,null),e(V,jt),e(V,Oe),e(Oe,Qt),e(c,er),e(c,z),S(ne,z,null),e(z,tr),e(z,Ae),e(Ae,rr),e(c,sr),e(c,G),S(ie,G,null),e(G,or),e(G,Ce),e(Ce,nr),e(c,ir),e(c,B),S(le,B,null),e(B,lr),e(B,ke),e(ke,ar),e(c,dr),e(c,J),S(ae,J,null),e(J,pr),e(J,Le),e(Le,cr),e(c,ur),e(c,Y),S(de,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(pe,qe,null),e(F,mr),e(F,Ve),e(Ve,vr),f(t,Xe,u),f(t,O,u),S(ce,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(ae.$$.fragment,t),M(de.$$.fragment,t),M(pe.$$.fragment,t),M(ce.$$.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(ae.$$.fragment,t),b(de.$$.fragment,t),b(pe.$$.fragment,t),b(ce.$$.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(c),D(re),D(se),D(q),D(oe),D(ne),D(ie),D(le),D(ae),D(de),t&&r(Ue),t&&r(F),D(pe),t&&r(Xe),t&&r(O),D(ce)}}}const as={local:"dpmsolvermultistepinverse",sections:[{local:"tips",title:"Tips"},{local:"diffusers.DPMSolverMultistepInverseScheduler",title:"DPMSolverMultistepInverseScheduler"},{local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",title:"SchedulerOutput"}],title:"DPMSolverMultistepInverse"};function ds(Be){return os(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fs extends es{constructor(m){super();ts(this,m,ds,ls,rs,{})}}export{fs as default,as as metadata};
