import{s as Te,n as ye,o as we}from"../chunks/scheduler.182ea377.js";import{S as Ce,i as Oe,g as d,s as o,r as f,A as Le,h as a,f as t,c as i,j as x,u as m,x as P,k as M,y as s,a as c,v as h,d as g,t as _,w as v}from"../chunks/index.abf12888.js";import{D as B}from"../chunks/Docstring.93f6f462.js";import{H as _e}from"../chunks/Heading.16916d63.js";function ke(ve){let u,K,j,R,E,W,T,Se='The <code>DPMSolverSDEScheduler</code> is inspired by the stochastic sampler from the <a href="https://huggingface.co/papers/2206.00364" rel="nofollow">Elucidating the Design Space of Diffusion-Based Generative Models</a> paper, and the scheduler is ported from and created by <a href="https://github.com/crowsonkb/" rel="nofollow">Katherine Crowson</a>.',J,y,Q,r,w,ie,q,be=`DPMSolverSDEScheduler implements the stochastic sampler from the <a href="https://huggingface.co/papers/2206.00364" rel="nofollow">Elucidating the Design Space of Diffusion-Based
Generative Models</a> paper.`,de,H,De=`This model inherits from <a href="/docs/diffusers/v0.27.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/v0.27.2/en/api/configuration#diffusers.ConfigMixin">ConfigMixin</a>. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`,ae,S,C,le,N,$e=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,ce,b,O,ue,U,xe="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",pe,D,L,fe,V,Pe="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",me,$,k,he,A,Me=`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).`,X,F,Y,p,I,ge,z,Ee="Base class for the output of a scheduler’s <code>step</code> function.",Z,G,ee;return E=new _e({props:{title:"DPMSolverSDEScheduler",local:"dpmsolversdescheduler",headingTag:"h1"}}),y=new _e({props:{title:"DPMSolverSDEScheduler",local:"diffusers.DPMSolverSDEScheduler",headingTag:"h2"}}),w=new B({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:": Union = None"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"use_karras_sigmas",val:": Optional = False"},{name:"noise_sampler_seed",val:": Optional = 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, as required by some model families.`,name:"steps_offset"}],source:"https://github.com/huggingface/diffusers/blob/v0.27.2/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L123"}}),C=new B({props:{name:"scale_model_input",anchor:"diffusers.DPMSolverSDEScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": Union"}],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/v0.27.2/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L258",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A scaled input sample.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.FloatTensor</code></p>
`}}),O=new B({props:{name:"set_begin_index",anchor:"diffusers.DPMSolverSDEScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.DPMSolverSDEScheduler.set_begin_index.begin_index",description:`<strong>begin_index</strong> (<code>int</code>) &#x2014;
The begin index for the scheduler.`,name:"begin_index"}],source:"https://github.com/huggingface/diffusers/blob/v0.27.2/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L248"}}),L=new B({props:{name:"set_timesteps",anchor:"diffusers.DPMSolverSDEScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": Union = None"},{name:"num_train_timesteps",val:": Optional = 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/v0.27.2/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L285"}}),k=new B({props:{name:"step",anchor:"diffusers.DPMSolverSDEScheduler.step",parameters:[{name:"model_output",val:": Union"},{name:"timestep",val:": Union"},{name:"sample",val:": Union"},{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/v0.27.2/en/api/schedulers/overview#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/v0.27.2/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L415",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is <code>True</code>, <a
  href="/docs/diffusers/v0.27.2/en/api/schedulers/overview#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> is returned, otherwise a
tuple is returned where the first element is the sample tensor.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/v0.27.2/en/api/schedulers/overview#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> or <code>tuple</code></p>
`}}),F=new _e({props:{title:"SchedulerOutput",local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",headingTag:"h2"}}),I=new B({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/v0.27.2/src/diffusers/schedulers/scheduling_utils.py#L51"}}),{c(){u=d("meta"),K=o(),j=d("p"),R=o(),f(E.$$.fragment),W=o(),T=d("p"),T.innerHTML=Se,J=o(),f(y.$$.fragment),Q=o(),r=d("div"),f(w.$$.fragment),ie=o(),q=d("p"),q.innerHTML=be,de=o(),H=d("p"),H.innerHTML=De,ae=o(),S=d("div"),f(C.$$.fragment),le=o(),N=d("p"),N.textContent=$e,ce=o(),b=d("div"),f(O.$$.fragment),ue=o(),U=d("p"),U.textContent=xe,pe=o(),D=d("div"),f(L.$$.fragment),fe=o(),V=d("p"),V.textContent=Pe,me=o(),$=d("div"),f(k.$$.fragment),he=o(),A=d("p"),A.textContent=Me,X=o(),f(F.$$.fragment),Y=o(),p=d("div"),f(I.$$.fragment),ge=o(),z=d("p"),z.innerHTML=Ee,Z=o(),G=d("p"),this.h()},l(e){const n=Le("svelte-u9bgzb",document.head);u=a(n,"META",{name:!0,content:!0}),n.forEach(t),K=i(e),j=a(e,"P",{}),x(j).forEach(t),R=i(e),m(E.$$.fragment,e),W=i(e),T=a(e,"P",{"data-svelte-h":!0}),P(T)!=="svelte-f261ri"&&(T.innerHTML=Se),J=i(e),m(y.$$.fragment,e),Q=i(e),r=a(e,"DIV",{class:!0});var l=x(r);m(w.$$.fragment,l),ie=i(l),q=a(l,"P",{"data-svelte-h":!0}),P(q)!=="svelte-2gqyak"&&(q.innerHTML=be),de=i(l),H=a(l,"P",{"data-svelte-h":!0}),P(H)!=="svelte-50bukd"&&(H.innerHTML=De),ae=i(l),S=a(l,"DIV",{class:!0});var te=x(S);m(C.$$.fragment,te),le=i(te),N=a(te,"P",{"data-svelte-h":!0}),P(N)!=="svelte-1rkfgpx"&&(N.textContent=$e),te.forEach(t),ce=i(l),b=a(l,"DIV",{class:!0});var se=x(b);m(O.$$.fragment,se),ue=i(se),U=a(se,"P",{"data-svelte-h":!0}),P(U)!=="svelte-1k141rk"&&(U.textContent=xe),se.forEach(t),pe=i(l),D=a(l,"DIV",{class:!0});var re=x(D);m(L.$$.fragment,re),fe=i(re),V=a(re,"P",{"data-svelte-h":!0}),P(V)!=="svelte-1vzm9q"&&(V.textContent=Pe),re.forEach(t),me=i(l),$=a(l,"DIV",{class:!0});var ne=x($);m(k.$$.fragment,ne),he=i(ne),A=a(ne,"P",{"data-svelte-h":!0}),P(A)!=="svelte-hi84tp"&&(A.textContent=Me),ne.forEach(t),l.forEach(t),X=i(e),m(F.$$.fragment,e),Y=i(e),p=a(e,"DIV",{class:!0});var oe=x(p);m(I.$$.fragment,oe),ge=i(oe),z=a(oe,"P",{"data-svelte-h":!0}),P(z)!=="svelte-6ojmkw"&&(z.innerHTML=Ee),oe.forEach(t),Z=i(e),G=a(e,"P",{}),x(G).forEach(t),this.h()},h(){M(u,"name","hf:doc:metadata"),M(u,"content",Fe),M(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(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(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){s(document.head,u),c(e,K,n),c(e,j,n),c(e,R,n),h(E,e,n),c(e,W,n),c(e,T,n),c(e,J,n),h(y,e,n),c(e,Q,n),c(e,r,n),h(w,r,null),s(r,ie),s(r,q),s(r,de),s(r,H),s(r,ae),s(r,S),h(C,S,null),s(S,le),s(S,N),s(r,ce),s(r,b),h(O,b,null),s(b,ue),s(b,U),s(r,pe),s(r,D),h(L,D,null),s(D,fe),s(D,V),s(r,me),s(r,$),h(k,$,null),s($,he),s($,A),c(e,X,n),h(F,e,n),c(e,Y,n),c(e,p,n),h(I,p,null),s(p,ge),s(p,z),c(e,Z,n),c(e,G,n),ee=!0},p:ye,i(e){ee||(g(E.$$.fragment,e),g(y.$$.fragment,e),g(w.$$.fragment,e),g(C.$$.fragment,e),g(O.$$.fragment,e),g(L.$$.fragment,e),g(k.$$.fragment,e),g(F.$$.fragment,e),g(I.$$.fragment,e),ee=!0)},o(e){_(E.$$.fragment,e),_(y.$$.fragment,e),_(w.$$.fragment,e),_(C.$$.fragment,e),_(O.$$.fragment,e),_(L.$$.fragment,e),_(k.$$.fragment,e),_(F.$$.fragment,e),_(I.$$.fragment,e),ee=!1},d(e){e&&(t(K),t(j),t(R),t(W),t(T),t(J),t(Q),t(r),t(X),t(Y),t(p),t(Z),t(G)),t(u),v(E,e),v(y,e),v(w),v(C),v(O),v(L),v(k),v(F,e),v(I)}}}const Fe='{"title":"DPMSolverSDEScheduler","local":"dpmsolversdescheduler","sections":[{"title":"DPMSolverSDEScheduler","local":"diffusers.DPMSolverSDEScheduler","sections":[],"depth":2},{"title":"SchedulerOutput","local":"diffusers.schedulers.scheduling_utils.SchedulerOutput","sections":[],"depth":2}],"depth":1}';function Ie(ve){return we(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ve extends Ce{constructor(u){super(),Oe(this,u,Ie,ke,Te,{})}}export{Ve as component};
