import{S as zr,i as Hr,s as jr,e as s,k as c,w as g,t as i,M as Kr,c as o,d as r,m as p,a as n,x as v,h as a,b as d,G as e,g as _,y as S,L as Rr,q as b,o as E,B as D,v as Ur}from"../../../chunks/vendor-hf-doc-builder.js";import{D as z}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as ar}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Br(dr){let I,Pe,x,O,he,H,Je,fe,Ye,ke,oe,Qe,Ae,$,P,me,j,Xe,_e,Ze,Ce,y,et,K,tt,rt,R,st,ot,Le,w,k,ge,U,nt,ve,it,qe,l,B,at,M,dt,G,lt,ct,J,pt,ut,ht,T,ft,Se,mt,_t,be,gt,vt,St,F,bt,Y,Et,Dt,Ee,yt,It,xt,h,ne,$t,wt,De,Mt,Tt,ye,Ft,Ot,Ie,Pt,kt,ie,At,Ct,ae,Lt,qt,de,Nt,Vt,Wt,A,Q,zt,xe,Ht,jt,C,X,Kt,$e,Rt,Ut,L,Z,Bt,we,Gt,Jt,q,ee,Yt,Me,Qt,Xt,N,te,Zt,Te,er,tr,V,re,rr,Fe,sr,or,W,se,nr,Oe,ir,Ne;return H=new ar({}),j=new ar({}),U=new ar({}),B=new z({props:{name:"class diffusers.DEISMultistepScheduler",anchor:"diffusers.DEISMultistepScheduler",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.Optional[numpy.ndarray] = 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 = 'deis'"},{name:"solver_type",val:": str = 'logrho'"},{name:"lower_order_final",val:": bool = True"},{name:"use_karras_sigmas",val:": typing.Optional[bool] = False"},{name:"timestep_spacing",val:": str = 'linspace'"},{name:"steps_offset",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.DEISMultistepScheduler.num_train_timesteps",description:"<strong>num_train_timesteps</strong> (<code>int</code>) &#x2014; number of diffusion steps used to train the model.",name:"num_train_timesteps"},{anchor:"diffusers.DEISMultistepScheduler.beta_start",description:"<strong>beta_start</strong> (<code>float</code>) &#x2014; the starting <code>beta</code> value of inference.",name:"beta_start"},{anchor:"diffusers.DEISMultistepScheduler.beta_end",description:"<strong>beta_end</strong> (<code>float</code>) &#x2014; the final <code>beta</code> value.",name:"beta_end"},{anchor:"diffusers.DEISMultistepScheduler.beta_schedule",description:`<strong>beta_schedule</strong> (<code>str</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.DEISMultistepScheduler.trained_betas",description:`<strong>trained_betas</strong> (<code>np.ndarray</code>, optional) &#x2014;
option to pass an array of betas directly to the constructor to bypass <code>beta_start</code>, <code>beta_end</code> etc.`,name:"trained_betas"},{anchor:"diffusers.DEISMultistepScheduler.solver_order",description:`<strong>solver_order</strong> (<code>int</code>, default <code>2</code>) &#x2014;
the order of DEIS; can be <code>1</code> or <code>2</code> or <code>3</code>. We recommend to use <code>solver_order=2</code> for guided sampling, and
<code>solver_order=3</code> for unconditional sampling.`,name:"solver_order"},{anchor:"diffusers.DEISMultistepScheduler.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, default <code>epsilon</code>) &#x2014;
indicates whether the model predicts the noise (epsilon), or the data / <code>x0</code>. One of <code>epsilon</code>, <code>sample</code>,
or <code>v-prediction</code>.`,name:"prediction_type"},{anchor:"diffusers.DEISMultistepScheduler.thresholding",description:`<strong>thresholding</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
whether to use the &#x201C;dynamic thresholding&#x201D; method (introduced by Imagen, <a href="https://arxiv.org/abs/2205.11487" rel="nofollow">https://arxiv.org/abs/2205.11487</a>).
Note that the thresholding method is unsuitable for latent-space diffusion models (such as
stable-diffusion).`,name:"thresholding"},{anchor:"diffusers.DEISMultistepScheduler.dynamic_thresholding_ratio",description:`<strong>dynamic_thresholding_ratio</strong> (<code>float</code>, default <code>0.995</code>) &#x2014;
the ratio for the dynamic thresholding method. Default is <code>0.995</code>, the same as Imagen
(<a href="https://arxiv.org/abs/2205.11487" rel="nofollow">https://arxiv.org/abs/2205.11487</a>).`,name:"dynamic_thresholding_ratio"},{anchor:"diffusers.DEISMultistepScheduler.sample_max_value",description:`<strong>sample_max_value</strong> (<code>float</code>, default <code>1.0</code>) &#x2014;
the threshold value for dynamic thresholding. Valid only when <code>thresholding=True</code>`,name:"sample_max_value"},{anchor:"diffusers.DEISMultistepScheduler.algorithm_type",description:`<strong>algorithm_type</strong> (<code>str</code>, default <code>deis</code>) &#x2014;
the algorithm type for the solver. current we support multistep deis, we will add other variants of DEIS in
the future`,name:"algorithm_type"},{anchor:"diffusers.DEISMultistepScheduler.lower_order_final",description:`<strong>lower_order_final</strong> (<code>bool</code>, default <code>True</code>) &#x2014;
whether to use lower-order solvers in the final steps. Only valid for &lt; 15 inference steps. We empirically
find this trick can stabilize the sampling of DEIS for steps &lt; 15, especially for steps &lt;= 10.`,name:"lower_order_final"},{anchor:"diffusers.DEISMultistepScheduler.use_karras_sigmas",description:`<strong>use_karras_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This parameter controls whether to use Karras sigmas (Karras et al. (2022) scheme) for step sizes in the
noise schedule during the sampling process. If True, the sigmas will be determined according to a sequence
of noise levels {&#x3C3;i} as defined in Equation (5) of the paper <a href="https://arxiv.org/pdf/2206.00364.pdf" rel="nofollow">https://arxiv.org/pdf/2206.00364.pdf</a>.`,name:"use_karras_sigmas"},{anchor:"diffusers.DEISMultistepScheduler.timestep_spacing",description:`<strong>timestep_spacing</strong> (<code>str</code>, default <code>&quot;linspace&quot;</code>) &#x2014;
The way the timesteps should be scaled. Refer to Table 2. of <a href="https://arxiv.org/abs/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample
Steps are Flawed</a> for more information.`,name:"timestep_spacing"},{anchor:"diffusers.DEISMultistepScheduler.steps_offset",description:`<strong>steps_offset</strong> (<code>int</code>, default <code>0</code>) &#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, as done in
stable diffusion.`,name:"steps_offset"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L73"}}),Q=new z({props:{name:"convert_model_output",anchor:"diffusers.DEISMultistepScheduler.convert_model_output",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.DEISMultistepScheduler.convert_model_output.model_output",description:"<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014; direct output from learned diffusion model.",name:"model_output"},{anchor:"diffusers.DEISMultistepScheduler.convert_model_output.timestep",description:"<strong>timestep</strong> (<code>int</code>) &#x2014; current discrete timestep in the diffusion chain.",name:"timestep"},{anchor:"diffusers.DEISMultistepScheduler.convert_model_output.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
current instance of sample being created by diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L295",returnDescription:`
<p>the converted model output.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),X=new z({props:{name:"deis_first_order_update",anchor:"diffusers.DEISMultistepScheduler.deis_first_order_update",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"prev_timestep",val:": int"},{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.DEISMultistepScheduler.deis_first_order_update.model_output",description:"<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014; direct output from learned diffusion model.",name:"model_output"},{anchor:"diffusers.DEISMultistepScheduler.deis_first_order_update.timestep",description:"<strong>timestep</strong> (<code>int</code>) &#x2014; current discrete timestep in the diffusion chain.",name:"timestep"},{anchor:"diffusers.DEISMultistepScheduler.deis_first_order_update.prev_timestep",description:"<strong>prev_timestep</strong> (<code>int</code>) &#x2014; previous discrete timestep in the diffusion chain.",name:"prev_timestep"},{anchor:"diffusers.DEISMultistepScheduler.deis_first_order_update.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
current instance of sample being created by diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L333",returnDescription:`
<p>the sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),Z=new z({props:{name:"multistep_deis_second_order_update",anchor:"diffusers.DEISMultistepScheduler.multistep_deis_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"}],parametersDescription:[{anchor:"diffusers.DEISMultistepScheduler.multistep_deis_second_order_update.model_output_list",description:`<strong>model_output_list</strong> (<code>List[torch.FloatTensor]</code>) &#x2014;
direct outputs from learned diffusion model at current and latter timesteps.`,name:"model_output_list"},{anchor:"diffusers.DEISMultistepScheduler.multistep_deis_second_order_update.timestep",description:"<strong>timestep</strong> (<code>int</code>) &#x2014; current and latter discrete timestep in the diffusion chain.",name:"timestep"},{anchor:"diffusers.DEISMultistepScheduler.multistep_deis_second_order_update.prev_timestep",description:"<strong>prev_timestep</strong> (<code>int</code>) &#x2014; previous discrete timestep in the diffusion chain.",name:"prev_timestep"},{anchor:"diffusers.DEISMultistepScheduler.multistep_deis_second_order_update.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
current instance of sample being created by diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L363",returnDescription:`
<p>the sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),ee=new z({props:{name:"multistep_deis_third_order_update",anchor:"diffusers.DEISMultistepScheduler.multistep_deis_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.DEISMultistepScheduler.multistep_deis_third_order_update.model_output_list",description:`<strong>model_output_list</strong> (<code>List[torch.FloatTensor]</code>) &#x2014;
direct outputs from learned diffusion model at current and latter timesteps.`,name:"model_output_list"},{anchor:"diffusers.DEISMultistepScheduler.multistep_deis_third_order_update.timestep",description:"<strong>timestep</strong> (<code>int</code>) &#x2014; current and latter discrete timestep in the diffusion chain.",name:"timestep"},{anchor:"diffusers.DEISMultistepScheduler.multistep_deis_third_order_update.prev_timestep",description:"<strong>prev_timestep</strong> (<code>int</code>) &#x2014; previous discrete timestep in the diffusion chain.",name:"prev_timestep"},{anchor:"diffusers.DEISMultistepScheduler.multistep_deis_third_order_update.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
current instance of sample being created by diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L405",returnDescription:`
<p>the sample tensor at the previous timestep.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),te=new z({props:{name:"scale_model_input",anchor:"diffusers.DEISMultistepScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.DEISMultistepScheduler.scale_model_input.sample",description:"<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014; input sample",name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L530",returnDescription:`
<p>scaled input sample</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),re=new z({props:{name:"set_timesteps",anchor:"diffusers.DEISMultistepScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.DEISMultistepScheduler.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.DEISMultistepScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, optional) &#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/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L202"}}),se=new z({props:{name:"step",anchor:"diffusers.DEISMultistepScheduler.step",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"sample",val:": FloatTensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.DEISMultistepScheduler.step.model_output",description:"<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014; direct output from learned diffusion model.",name:"model_output"},{anchor:"diffusers.DEISMultistepScheduler.step.timestep",description:"<strong>timestep</strong> (<code>int</code>) &#x2014; current discrete timestep in the diffusion chain.",name:"timestep"},{anchor:"diffusers.DEISMultistepScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
current instance of sample being created by diffusion process.`,name:"sample"},{anchor:"diffusers.DEISMultistepScheduler.step.return_dict",description:"<strong>return_dict</strong> (<code>bool</code>) &#x2014; option for returning tuple rather than SchedulerOutput class",name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_deis_multistep.py#L462",returnDescription:`
<p><code>~scheduling_utils.SchedulerOutput</code> if <code>return_dict</code> is
True, otherwise a <code>tuple</code>. When returning a tuple, the first element is the sample tensor.</p>
`,returnType:`
<p><code>~scheduling_utils.SchedulerOutput</code> or <code>tuple</code></p>
`}}),{c(){I=s("meta"),Pe=c(),x=s("h1"),O=s("a"),he=s("span"),g(H.$$.fragment),Je=c(),fe=s("span"),Ye=i("DEIS"),ke=c(),oe=s("p"),Qe=i("Fast Sampling of Diffusion Models with Exponential Integrator."),Ae=c(),$=s("h2"),P=s("a"),me=s("span"),g(j.$$.fragment),Xe=c(),_e=s("span"),Ze=i("Overview"),Ce=c(),y=s("p"),et=i("Original paper can be found "),K=s("a"),tt=i("here"),rt=i(". The original implementation can be found "),R=s("a"),st=i("here"),ot=i("."),Le=c(),w=s("h2"),k=s("a"),ge=s("span"),g(U.$$.fragment),nt=c(),ve=s("span"),it=i("DEISMultistepScheduler"),qe=c(),l=s("div"),g(B.$$.fragment),at=c(),M=s("p"),dt=i("DEIS ("),G=s("a"),lt=i("https://arxiv.org/abs/2204.13902"),ct=i(`) is a fast high order solver for diffusion ODEs. We slightly modify the
polynomial fitting formula in log-rho space instead of the original linear t space in DEIS paper. The modification
enjoys closed-form coefficients for exponential multistep update instead of replying on the numerical solver. More
variants of DEIS can be found in `),J=s("a"),pt=i("https://github.com/qsh-zh/deis"),ut=i("."),ht=c(),T=s("p"),ft=i("Currently, we support the log-rho multistep DEIS. We recommend to use "),Se=s("code"),mt=i("solver_order=2 / 3"),_t=i(" while "),be=s("code"),gt=i("solver_order=1"),vt=i(`
reduces to DDIM.`),St=c(),F=s("p"),bt=i("We also support the \u201Cdynamic thresholding\u201D method in Imagen ("),Y=s("a"),Et=i("https://arxiv.org/abs/2205.11487"),Dt=i(`). For pixel-space
diffusion models, you can set `),Ee=s("code"),yt=i("thresholding=True"),It=i(" to use the dynamic thresholding."),xt=c(),h=s("p"),ne=s("a"),$t=i("~ConfigMixin"),wt=i(" takes care of storing all config attributes that are passed in the scheduler\u2019s "),De=s("code"),Mt=i("__init__"),Tt=i(`
function, such as `),ye=s("code"),Ft=i("num_train_timesteps"),Ot=i(". They can be accessed via "),Ie=s("code"),Pt=i("scheduler.config.num_train_timesteps"),kt=i(`.
`),ie=s("a"),At=i("SchedulerMixin"),Ct=i(" provides general loading and saving functionality via the "),ae=s("a"),Lt=i("SchedulerMixin.save_pretrained()"),qt=i(` and
`),de=s("a"),Nt=i("from_pretrained()"),Vt=i(" functions."),Wt=c(),A=s("div"),g(Q.$$.fragment),zt=c(),xe=s("p"),Ht=i("Convert the model output to the corresponding type that the algorithm DEIS needs."),jt=c(),C=s("div"),g(X.$$.fragment),Kt=c(),$e=s("p"),Rt=i("One step for the first-order DEIS (equivalent to DDIM)."),Ut=c(),L=s("div"),g(Z.$$.fragment),Bt=c(),we=s("p"),Gt=i("One step for the second-order multistep DEIS."),Jt=c(),q=s("div"),g(ee.$$.fragment),Yt=c(),Me=s("p"),Qt=i("One step for the third-order multistep DEIS."),Xt=c(),N=s("div"),g(te.$$.fragment),Zt=c(),Te=s("p"),er=i(`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),tr=c(),V=s("div"),g(re.$$.fragment),rr=c(),Fe=s("p"),sr=i("Sets the timesteps used for the diffusion chain. Supporting function to be run before inference."),or=c(),W=s("div"),g(se.$$.fragment),nr=c(),Oe=s("p"),ir=i("Step function propagating the sample with the multistep DEIS."),this.h()},l(t){const f=Kr('[data-svelte="svelte-1phssyn"]',document.head);I=o(f,"META",{name:!0,content:!0}),f.forEach(r),Pe=p(t),x=o(t,"H1",{class:!0});var Ve=n(x);O=o(Ve,"A",{id:!0,class:!0,href:!0});var lr=n(O);he=o(lr,"SPAN",{});var cr=n(he);v(H.$$.fragment,cr),cr.forEach(r),lr.forEach(r),Je=p(Ve),fe=o(Ve,"SPAN",{});var pr=n(fe);Ye=a(pr,"DEIS"),pr.forEach(r),Ve.forEach(r),ke=p(t),oe=o(t,"P",{});var ur=n(oe);Qe=a(ur,"Fast Sampling of Diffusion Models with Exponential Integrator."),ur.forEach(r),Ae=p(t),$=o(t,"H2",{class:!0});var We=n($);P=o(We,"A",{id:!0,class:!0,href:!0});var hr=n(P);me=o(hr,"SPAN",{});var fr=n(me);v(j.$$.fragment,fr),fr.forEach(r),hr.forEach(r),Xe=p(We),_e=o(We,"SPAN",{});var mr=n(_e);Ze=a(mr,"Overview"),mr.forEach(r),We.forEach(r),Ce=p(t),y=o(t,"P",{});var le=n(y);et=a(le,"Original paper can be found "),K=o(le,"A",{href:!0,rel:!0});var _r=n(K);tt=a(_r,"here"),_r.forEach(r),rt=a(le,". The original implementation can be found "),R=o(le,"A",{href:!0,rel:!0});var gr=n(R);st=a(gr,"here"),gr.forEach(r),ot=a(le,"."),le.forEach(r),Le=p(t),w=o(t,"H2",{class:!0});var ze=n(w);k=o(ze,"A",{id:!0,class:!0,href:!0});var vr=n(k);ge=o(vr,"SPAN",{});var Sr=n(ge);v(U.$$.fragment,Sr),Sr.forEach(r),vr.forEach(r),nt=p(ze),ve=o(ze,"SPAN",{});var br=n(ve);it=a(br,"DEISMultistepScheduler"),br.forEach(r),ze.forEach(r),qe=p(t),l=o(t,"DIV",{class:!0});var u=n(l);v(B.$$.fragment,u),at=p(u),M=o(u,"P",{});var ce=n(M);dt=a(ce,"DEIS ("),G=o(ce,"A",{href:!0,rel:!0});var Er=n(G);lt=a(Er,"https://arxiv.org/abs/2204.13902"),Er.forEach(r),ct=a(ce,`) is a fast high order solver for diffusion ODEs. We slightly modify the
polynomial fitting formula in log-rho space instead of the original linear t space in DEIS paper. The modification
enjoys closed-form coefficients for exponential multistep update instead of replying on the numerical solver. More
variants of DEIS can be found in `),J=o(ce,"A",{href:!0,rel:!0});var Dr=n(J);pt=a(Dr,"https://github.com/qsh-zh/deis"),Dr.forEach(r),ut=a(ce,"."),ce.forEach(r),ht=p(u),T=o(u,"P",{});var pe=n(T);ft=a(pe,"Currently, we support the log-rho multistep DEIS. We recommend to use "),Se=o(pe,"CODE",{});var yr=n(Se);mt=a(yr,"solver_order=2 / 3"),yr.forEach(r),_t=a(pe," while "),be=o(pe,"CODE",{});var Ir=n(be);gt=a(Ir,"solver_order=1"),Ir.forEach(r),vt=a(pe,`
reduces to DDIM.`),pe.forEach(r),St=p(u),F=o(u,"P",{});var ue=n(F);bt=a(ue,"We also support the \u201Cdynamic thresholding\u201D method in Imagen ("),Y=o(ue,"A",{href:!0,rel:!0});var xr=n(Y);Et=a(xr,"https://arxiv.org/abs/2205.11487"),xr.forEach(r),Dt=a(ue,`). For pixel-space
diffusion models, you can set `),Ee=o(ue,"CODE",{});var $r=n(Ee);yt=a($r,"thresholding=True"),$r.forEach(r),It=a(ue," to use the dynamic thresholding."),ue.forEach(r),xt=p(u),h=o(u,"P",{});var m=n(h);ne=o(m,"A",{href:!0});var wr=n(ne);$t=a(wr,"~ConfigMixin"),wr.forEach(r),wt=a(m," takes care of storing all config attributes that are passed in the scheduler\u2019s "),De=o(m,"CODE",{});var Mr=n(De);Mt=a(Mr,"__init__"),Mr.forEach(r),Tt=a(m,`
function, such as `),ye=o(m,"CODE",{});var Tr=n(ye);Ft=a(Tr,"num_train_timesteps"),Tr.forEach(r),Ot=a(m,". They can be accessed via "),Ie=o(m,"CODE",{});var Fr=n(Ie);Pt=a(Fr,"scheduler.config.num_train_timesteps"),Fr.forEach(r),kt=a(m,`.
`),ie=o(m,"A",{href:!0});var Or=n(ie);At=a(Or,"SchedulerMixin"),Or.forEach(r),Ct=a(m," provides general loading and saving functionality via the "),ae=o(m,"A",{href:!0});var Pr=n(ae);Lt=a(Pr,"SchedulerMixin.save_pretrained()"),Pr.forEach(r),qt=a(m,` and
`),de=o(m,"A",{href:!0});var kr=n(de);Nt=a(kr,"from_pretrained()"),kr.forEach(r),Vt=a(m," functions."),m.forEach(r),Wt=p(u),A=o(u,"DIV",{class:!0});var He=n(A);v(Q.$$.fragment,He),zt=p(He),xe=o(He,"P",{});var Ar=n(xe);Ht=a(Ar,"Convert the model output to the corresponding type that the algorithm DEIS needs."),Ar.forEach(r),He.forEach(r),jt=p(u),C=o(u,"DIV",{class:!0});var je=n(C);v(X.$$.fragment,je),Kt=p(je),$e=o(je,"P",{});var Cr=n($e);Rt=a(Cr,"One step for the first-order DEIS (equivalent to DDIM)."),Cr.forEach(r),je.forEach(r),Ut=p(u),L=o(u,"DIV",{class:!0});var Ke=n(L);v(Z.$$.fragment,Ke),Bt=p(Ke),we=o(Ke,"P",{});var Lr=n(we);Gt=a(Lr,"One step for the second-order multistep DEIS."),Lr.forEach(r),Ke.forEach(r),Jt=p(u),q=o(u,"DIV",{class:!0});var Re=n(q);v(ee.$$.fragment,Re),Yt=p(Re),Me=o(Re,"P",{});var qr=n(Me);Qt=a(qr,"One step for the third-order multistep DEIS."),qr.forEach(r),Re.forEach(r),Xt=p(u),N=o(u,"DIV",{class:!0});var Ue=n(N);v(te.$$.fragment,Ue),Zt=p(Ue),Te=o(Ue,"P",{});var Nr=n(Te);er=a(Nr,`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),Nr.forEach(r),Ue.forEach(r),tr=p(u),V=o(u,"DIV",{class:!0});var Be=n(V);v(re.$$.fragment,Be),rr=p(Be),Fe=o(Be,"P",{});var Vr=n(Fe);sr=a(Vr,"Sets the timesteps used for the diffusion chain. Supporting function to be run before inference."),Vr.forEach(r),Be.forEach(r),or=p(u),W=o(u,"DIV",{class:!0});var Ge=n(W);v(se.$$.fragment,Ge),nr=p(Ge),Oe=o(Ge,"P",{});var Wr=n(Oe);ir=a(Wr,"Step function propagating the sample with the multistep DEIS."),Wr.forEach(r),Ge.forEach(r),u.forEach(r),this.h()},h(){d(I,"name","hf:doc:metadata"),d(I,"content",JSON.stringify(Gr)),d(O,"id","deis"),d(O,"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(O,"href","#deis"),d(x,"class","relative group"),d(P,"id","overview"),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","#overview"),d($,"class","relative group"),d(K,"href","https://arxiv.org/abs/2204.13902"),d(K,"rel","nofollow"),d(R,"href","https://github.com/qsh-zh/deis"),d(R,"rel","nofollow"),d(k,"id","diffusers.DEISMultistepScheduler"),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","#diffusers.DEISMultistepScheduler"),d(w,"class","relative group"),d(G,"href","https://arxiv.org/abs/2204.13902"),d(G,"rel","nofollow"),d(J,"href","https://github.com/qsh-zh/deis"),d(J,"rel","nofollow"),d(Y,"href","https://arxiv.org/abs/2205.11487"),d(Y,"rel","nofollow"),d(ne,"href","/docs/diffusers/v0.19.0/en/api/configuration#diffusers.ConfigMixin"),d(ie,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin"),d(ae,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained"),d(de,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),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"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"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(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(l,"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,f){e(document.head,I),_(t,Pe,f),_(t,x,f),e(x,O),e(O,he),S(H,he,null),e(x,Je),e(x,fe),e(fe,Ye),_(t,ke,f),_(t,oe,f),e(oe,Qe),_(t,Ae,f),_(t,$,f),e($,P),e(P,me),S(j,me,null),e($,Xe),e($,_e),e(_e,Ze),_(t,Ce,f),_(t,y,f),e(y,et),e(y,K),e(K,tt),e(y,rt),e(y,R),e(R,st),e(y,ot),_(t,Le,f),_(t,w,f),e(w,k),e(k,ge),S(U,ge,null),e(w,nt),e(w,ve),e(ve,it),_(t,qe,f),_(t,l,f),S(B,l,null),e(l,at),e(l,M),e(M,dt),e(M,G),e(G,lt),e(M,ct),e(M,J),e(J,pt),e(M,ut),e(l,ht),e(l,T),e(T,ft),e(T,Se),e(Se,mt),e(T,_t),e(T,be),e(be,gt),e(T,vt),e(l,St),e(l,F),e(F,bt),e(F,Y),e(Y,Et),e(F,Dt),e(F,Ee),e(Ee,yt),e(F,It),e(l,xt),e(l,h),e(h,ne),e(ne,$t),e(h,wt),e(h,De),e(De,Mt),e(h,Tt),e(h,ye),e(ye,Ft),e(h,Ot),e(h,Ie),e(Ie,Pt),e(h,kt),e(h,ie),e(ie,At),e(h,Ct),e(h,ae),e(ae,Lt),e(h,qt),e(h,de),e(de,Nt),e(h,Vt),e(l,Wt),e(l,A),S(Q,A,null),e(A,zt),e(A,xe),e(xe,Ht),e(l,jt),e(l,C),S(X,C,null),e(C,Kt),e(C,$e),e($e,Rt),e(l,Ut),e(l,L),S(Z,L,null),e(L,Bt),e(L,we),e(we,Gt),e(l,Jt),e(l,q),S(ee,q,null),e(q,Yt),e(q,Me),e(Me,Qt),e(l,Xt),e(l,N),S(te,N,null),e(N,Zt),e(N,Te),e(Te,er),e(l,tr),e(l,V),S(re,V,null),e(V,rr),e(V,Fe),e(Fe,sr),e(l,or),e(l,W),S(se,W,null),e(W,nr),e(W,Oe),e(Oe,ir),Ne=!0},p:Rr,i(t){Ne||(b(H.$$.fragment,t),b(j.$$.fragment,t),b(U.$$.fragment,t),b(B.$$.fragment,t),b(Q.$$.fragment,t),b(X.$$.fragment,t),b(Z.$$.fragment,t),b(ee.$$.fragment,t),b(te.$$.fragment,t),b(re.$$.fragment,t),b(se.$$.fragment,t),Ne=!0)},o(t){E(H.$$.fragment,t),E(j.$$.fragment,t),E(U.$$.fragment,t),E(B.$$.fragment,t),E(Q.$$.fragment,t),E(X.$$.fragment,t),E(Z.$$.fragment,t),E(ee.$$.fragment,t),E(te.$$.fragment,t),E(re.$$.fragment,t),E(se.$$.fragment,t),Ne=!1},d(t){r(I),t&&r(Pe),t&&r(x),D(H),t&&r(ke),t&&r(oe),t&&r(Ae),t&&r($),D(j),t&&r(Ce),t&&r(y),t&&r(Le),t&&r(w),D(U),t&&r(qe),t&&r(l),D(B),D(Q),D(X),D(Z),D(ee),D(te),D(re),D(se)}}}const Gr={local:"deis",sections:[{local:"overview",title:"Overview"},{local:"diffusers.DEISMultistepScheduler",title:"DEISMultistepScheduler"}],title:"DEIS"};function Jr(dr){return Ur(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zr extends zr{constructor(I){super();Hr(this,I,Jr,Br,jr,{})}}export{Zr as default,Gr as metadata};
