import{s as Ce,n as Le,o as Oe}from"../chunks/scheduler.8c3d61f6.js";import{S as ke,i as qe,g as d,s as n,r as m,A as Ie,h as a,f as t,c as o,j as P,u as f,x as h,k as E,y as s,a as l,v as g,d as _,t as v,w as S}from"../chunks/index.589a98e8.js";import{D as F}from"../chunks/Docstring.27406313.js";import{H as we,E as He}from"../chunks/EditOnGithub.e5a8d9cb.js";function Ne(Se){let u,R,G,W,M,J,T,be='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>.',Q,y,X,i,w,ae,N,De=`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.`,le,U,xe=`This model inherits from <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/main/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.`,ce,b,C,ue,V,$e=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,pe,D,L,me,z,Pe="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",fe,x,O,he,A,Ee="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",ge,$,k,_e,j,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).`,Y,q,Te="## SchedulerOutput[[diffusers.schedulers.scheduling_utils.SchedulerOutput]]",Z,p,I,ve,B,ye="Base class for the output of a scheduler’s <code>step</code> function.",ee,H,te,K,se;return M=new we({props:{title:"DPMSolverSDEScheduler",local:"dpmsolversdescheduler",headingTag:"h1"}}),y=new we({props:{title:"DPMSolverSDEScheduler",local:"diffusers.DPMSolverSDEScheduler",headingTag:"h2"}}),w=new F({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/main/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L123"}}),C=new F({props:{name:"scale_model_input",anchor:"diffusers.DPMSolverSDEScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": Union"}],parametersDescription:[{anchor:"diffusers.DPMSolverSDEScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</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#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.Tensor</code></p>
`}}),L=new F({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/main/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L248"}}),O=new F({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/main/src/diffusers/schedulers/scheduling_dpmsolver_sde.py#L285"}}),k=new F({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.Tensor</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.Tensor</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.DPMSolverSDEScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.Tensor</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/multistep_dpm_solver#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#L415",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/schedulers/multistep_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:`<script context="module">export const metadata = 'undefined';<\/script>


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