import{S as xt,i as Tt,s as Ot,e as r,k as l,w as T,t as i,M as kt,c as o,d as s,m as c,a as n,x as O,h as d,b as a,G as e,g as m,y as k,L as At,q as A,o as F,B as N,v as Ft}from"../../../chunks/vendor-hf-doc-builder.js";import{D as de}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as it}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Nt(dt){let g,le,v,E,Q,C,Pe,X,Me,ce,h,we,Z,xe,Te,I,Oe,ke,q,Ae,Fe,ue,_,y,ee,L,Ne,te,Ce,pe,u,B,Ie,U,qe,V,Le,Be,Ue,S,Ve,J,Ge,He,Y,Ke,ze,Re,$,G,We,se,Je,Ye,P,H,je,re,Qe,Xe,M,K,Ze,oe,et,he,D,w,ne,z,tt,ae,st,fe,b,R,rt,W,ot,ie,nt,at,me;return C=new it({}),L=new it({}),B=new de({props:{name:"class diffusers.DPMSolverSDEScheduler",anchor:"diffusers.DPMSolverSDEScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.00085"},{name:"beta_end",val:": float = 0.012"},{name:"beta_schedule",val:": str = 'linear'"},{name:"trained_betas",val:": typing.Union[numpy.ndarray, typing.List[float], NoneType] = None"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"use_karras_sigmas",val:": typing.Optional[bool] = False"},{name:"noise_sampler_seed",val:": typing.Optional[int] = None"},{name:"timestep_spacing",val:": str = 'linspace'"},{name:"steps_offset",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.DPMSolverSDEScheduler.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.DPMSolverSDEScheduler.beta_start",description:`<strong>beta_start</strong> (<code>float</code>, defaults to 0.00085) &#x2014;
The starting <code>beta</code> value of inference.`,name:"beta_start"},{anchor:"diffusers.DPMSolverSDEScheduler.beta_end",description:`<strong>beta_end</strong> (<code>float</code>, defaults to 0.012) &#x2014;
The final <code>beta</code> value.`,name:"beta_end"},{anchor:"diffusers.DPMSolverSDEScheduler.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> or <code>scaled_linear</code>.`,name:"beta_schedule"},{anchor:"diffusers.DPMSolverSDEScheduler.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.DPMSolverSDEScheduler.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.DPMSolverSDEScheduler.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.DPMSolverSDEScheduler.noise_sampler_seed",description:`<strong>noise_sampler_seed</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The random seed to use for the noise sampler. If <code>None</code>, a random seed is generated.`,name:"noise_sampler_seed"},{anchor:"diffusers.DPMSolverSDEScheduler.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.DPMSolverSDEScheduler.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_sde.py#L124"}}),G=new de({props:{name:"scale_model_input",anchor:"diffusers.DPMSolverSDEScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": typing.Union[float, torch.FloatTensor]"}],parametersDescription:[{anchor:"diffusers.DPMSolverSDEScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The input sample.`,name:"sample"},{anchor:"diffusers.DPMSolverSDEScheduler.scale_model_input.timestep",description:`<strong>timestep</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The current timestep in the diffusion chain.`,name:"timestep"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L230",returnDescription:`
<p>A scaled input sample.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),H=new de({props:{name:"set_timesteps",anchor:"diffusers.DPMSolverSDEScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"},{name:"num_train_timesteps",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.DPMSolverSDEScheduler.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.DPMSolverSDEScheduler.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_sde.py#L256"}}),K=new de({props:{name:"step",anchor:"diffusers.DPMSolverSDEScheduler.step",parameters:[{name:"model_output",val:": typing.Union[torch.FloatTensor, numpy.ndarray]"},{name:"timestep",val:": typing.Union[float, torch.FloatTensor]"},{name:"sample",val:": typing.Union[torch.FloatTensor, numpy.ndarray]"},{name:"return_dict",val:": bool = True"},{name:"s_noise",val:": float = 1.0"}],parametersDescription:[{anchor:"diffusers.DPMSolverSDEScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code> or <code>np.ndarray</code>) &#x2014;
The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.DPMSolverSDEScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code> or <code>torch.FloatTensor</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverSDEScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code> or <code>np.ndarray</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.DPMSolverSDEScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</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 tuple.`,name:"return_dict"},{anchor:"diffusers.DPMSolverSDEScheduler.step.s_noise",description:`<strong>s_noise</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Scaling factor for noise added to the sample.`,name:"s_noise"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L385",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>
`}}),z=new it({}),R=new de({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(){g=r("meta"),le=l(),v=r("h1"),E=r("a"),Q=r("span"),T(C.$$.fragment),Pe=l(),X=r("span"),Me=i("DPMSolverSDEScheduler"),ce=l(),h=r("p"),we=i("The "),Z=r("code"),xe=i("DPMSolverSDEScheduler"),Te=i(" is inspired by the stochastic sampler from the "),I=r("a"),Oe=i("Elucidating the Design Space of Diffusion-Based Generative Models"),ke=i(" paper, and the scheduler is ported from and created by "),q=r("a"),Ae=i("Katherine Crowson"),Fe=i("."),ue=l(),_=r("h2"),y=r("a"),ee=r("span"),T(L.$$.fragment),Ne=l(),te=r("span"),Ce=i("DPMSolverSDEScheduler"),pe=l(),u=r("div"),T(B.$$.fragment),Ie=l(),U=r("p"),qe=i("DPMSolverSDEScheduler implements the stochastic sampler from the "),V=r("a"),Le=i(`Elucidating the Design Space of Diffusion-Based
Generative Models`),Be=i(" paper."),Ue=l(),S=r("p"),Ve=i("This model inherits from "),J=r("a"),Ge=i("SchedulerMixin"),He=i(" and "),Y=r("a"),Ke=i("ConfigMixin"),ze=i(`. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`),Re=l(),$=r("div"),T(G.$$.fragment),We=l(),se=r("p"),Je=i(`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),Ye=l(),P=r("div"),T(H.$$.fragment),je=l(),re=r("p"),Qe=i("Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),Xe=l(),M=r("div"),T(K.$$.fragment),Ze=l(),oe=r("p"),et=i(`Predict the sample from the previous timestep by reversing the SDE. This function propagates the diffusion
process from the learned model outputs (most often the predicted noise).`),he=l(),D=r("h2"),w=r("a"),ne=r("span"),T(z.$$.fragment),tt=l(),ae=r("span"),st=i("SchedulerOutput"),fe=l(),b=r("div"),T(R.$$.fragment),rt=l(),W=r("p"),ot=i("Base class for the output of a scheduler\u2019s "),ie=r("code"),nt=i("step"),at=i(" function."),this.h()},l(t){const p=kt('[data-svelte="svelte-1phssyn"]',document.head);g=o(p,"META",{name:!0,content:!0}),p.forEach(s),le=c(t),v=o(t,"H1",{class:!0});var ge=n(v);E=o(ge,"A",{id:!0,class:!0,href:!0});var lt=n(E);Q=o(lt,"SPAN",{});var ct=n(Q);O(C.$$.fragment,ct),ct.forEach(s),lt.forEach(s),Pe=c(ge),X=o(ge,"SPAN",{});var ut=n(X);Me=d(ut,"DPMSolverSDEScheduler"),ut.forEach(s),ge.forEach(s),ce=c(t),h=o(t,"P",{});var x=n(h);we=d(x,"The "),Z=o(x,"CODE",{});var pt=n(Z);xe=d(pt,"DPMSolverSDEScheduler"),pt.forEach(s),Te=d(x," is inspired by the stochastic sampler from the "),I=o(x,"A",{href:!0,rel:!0});var ht=n(I);Oe=d(ht,"Elucidating the Design Space of Diffusion-Based Generative Models"),ht.forEach(s),ke=d(x," paper, and the scheduler is ported from and created by "),q=o(x,"A",{href:!0,rel:!0});var ft=n(q);Ae=d(ft,"Katherine Crowson"),ft.forEach(s),Fe=d(x,"."),x.forEach(s),ue=c(t),_=o(t,"H2",{class:!0});var ve=n(_);y=o(ve,"A",{id:!0,class:!0,href:!0});var mt=n(y);ee=o(mt,"SPAN",{});var gt=n(ee);O(L.$$.fragment,gt),gt.forEach(s),mt.forEach(s),Ne=c(ve),te=o(ve,"SPAN",{});var vt=n(te);Ce=d(vt,"DPMSolverSDEScheduler"),vt.forEach(s),ve.forEach(s),pe=c(t),u=o(t,"DIV",{class:!0});var f=n(u);O(B.$$.fragment,f),Ie=c(f),U=o(f,"P",{});var _e=n(U);qe=d(_e,"DPMSolverSDEScheduler implements the stochastic sampler from the "),V=o(_e,"A",{href:!0,rel:!0});var _t=n(V);Le=d(_t,`Elucidating the Design Space of Diffusion-Based
Generative Models`),_t.forEach(s),Be=d(_e," paper."),_e.forEach(s),Ue=c(f),S=o(f,"P",{});var j=n(S);Ve=d(j,"This model inherits from "),J=o(j,"A",{href:!0});var St=n(J);Ge=d(St,"SchedulerMixin"),St.forEach(s),He=d(j," and "),Y=o(j,"A",{href:!0});var Dt=n(Y);Ke=d(Dt,"ConfigMixin"),Dt.forEach(s),ze=d(j,`. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`),j.forEach(s),Re=c(f),$=o(f,"DIV",{class:!0});var Se=n($);O(G.$$.fragment,Se),We=c(Se),se=o(Se,"P",{});var bt=n(se);Je=d(bt,`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),bt.forEach(s),Se.forEach(s),Ye=c(f),P=o(f,"DIV",{class:!0});var De=n(P);O(H.$$.fragment,De),je=c(De),re=o(De,"P",{});var Et=n(re);Qe=d(Et,"Sets the discrete timesteps used for the diffusion chain (to be run before inference)."),Et.forEach(s),De.forEach(s),Xe=c(f),M=o(f,"DIV",{class:!0});var be=n(M);O(K.$$.fragment,be),Ze=c(be),oe=o(be,"P",{});var yt=n(oe);et=d(yt,`Predict the sample from the previous timestep by reversing the SDE. This function propagates the diffusion
process from the learned model outputs (most often the predicted noise).`),yt.forEach(s),be.forEach(s),f.forEach(s),he=c(t),D=o(t,"H2",{class:!0});var Ee=n(D);w=o(Ee,"A",{id:!0,class:!0,href:!0});var $t=n(w);ne=o($t,"SPAN",{});var Pt=n(ne);O(z.$$.fragment,Pt),Pt.forEach(s),$t.forEach(s),tt=c(Ee),ae=o(Ee,"SPAN",{});var Mt=n(ae);st=d(Mt,"SchedulerOutput"),Mt.forEach(s),Ee.forEach(s),fe=c(t),b=o(t,"DIV",{class:!0});var ye=n(b);O(R.$$.fragment,ye),rt=c(ye),W=o(ye,"P",{});var $e=n(W);ot=d($e,"Base class for the output of a scheduler\u2019s "),ie=o($e,"CODE",{});var wt=n(ie);nt=d(wt,"step"),wt.forEach(s),at=d($e," function."),$e.forEach(s),ye.forEach(s),this.h()},h(){a(g,"name","hf:doc:metadata"),a(g,"content",JSON.stringify(Ct)),a(E,"id","dpmsolversdescheduler"),a(E,"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(E,"href","#dpmsolversdescheduler"),a(v,"class","relative group"),a(I,"href","https://huggingface.co/papers/2206.00364"),a(I,"rel","nofollow"),a(q,"href","https://github.com/crowsonkb/"),a(q,"rel","nofollow"),a(y,"id","diffusers.DPMSolverSDEScheduler"),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","#diffusers.DPMSolverSDEScheduler"),a(_,"class","relative group"),a(V,"href","https://huggingface.co/papers/2206.00364"),a(V,"rel","nofollow"),a(J,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),a(Y,"href","/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin"),a($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(w,"id","diffusers.schedulers.scheduling_utils.SchedulerOutput"),a(w,"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(w,"href","#diffusers.schedulers.scheduling_utils.SchedulerOutput"),a(D,"class","relative group"),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")},m(t,p){e(document.head,g),m(t,le,p),m(t,v,p),e(v,E),e(E,Q),k(C,Q,null),e(v,Pe),e(v,X),e(X,Me),m(t,ce,p),m(t,h,p),e(h,we),e(h,Z),e(Z,xe),e(h,Te),e(h,I),e(I,Oe),e(h,ke),e(h,q),e(q,Ae),e(h,Fe),m(t,ue,p),m(t,_,p),e(_,y),e(y,ee),k(L,ee,null),e(_,Ne),e(_,te),e(te,Ce),m(t,pe,p),m(t,u,p),k(B,u,null),e(u,Ie),e(u,U),e(U,qe),e(U,V),e(V,Le),e(U,Be),e(u,Ue),e(u,S),e(S,Ve),e(S,J),e(J,Ge),e(S,He),e(S,Y),e(Y,Ke),e(S,ze),e(u,Re),e(u,$),k(G,$,null),e($,We),e($,se),e(se,Je),e(u,Ye),e(u,P),k(H,P,null),e(P,je),e(P,re),e(re,Qe),e(u,Xe),e(u,M),k(K,M,null),e(M,Ze),e(M,oe),e(oe,et),m(t,he,p),m(t,D,p),e(D,w),e(w,ne),k(z,ne,null),e(D,tt),e(D,ae),e(ae,st),m(t,fe,p),m(t,b,p),k(R,b,null),e(b,rt),e(b,W),e(W,ot),e(W,ie),e(ie,nt),e(W,at),me=!0},p:At,i(t){me||(A(C.$$.fragment,t),A(L.$$.fragment,t),A(B.$$.fragment,t),A(G.$$.fragment,t),A(H.$$.fragment,t),A(K.$$.fragment,t),A(z.$$.fragment,t),A(R.$$.fragment,t),me=!0)},o(t){F(C.$$.fragment,t),F(L.$$.fragment,t),F(B.$$.fragment,t),F(G.$$.fragment,t),F(H.$$.fragment,t),F(K.$$.fragment,t),F(z.$$.fragment,t),F(R.$$.fragment,t),me=!1},d(t){s(g),t&&s(le),t&&s(v),N(C),t&&s(ce),t&&s(h),t&&s(ue),t&&s(_),N(L),t&&s(pe),t&&s(u),N(B),N(G),N(H),N(K),t&&s(he),t&&s(D),N(z),t&&s(fe),t&&s(b),N(R)}}}const Ct={local:"dpmsolversdescheduler",sections:[{local:"diffusers.DPMSolverSDEScheduler",title:"DPMSolverSDEScheduler"},{local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",title:"SchedulerOutput"}],title:"DPMSolverSDEScheduler"};function It(dt){return Ft(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ut extends xt{constructor(g){super();Tt(this,g,It,Nt,Ot,{})}}export{Ut as default,Ct as metadata};
