import{s as be,n as De,o as $e}from"../chunks/scheduler.182ea377.js";import{S as xe,i as ye,g as i,s as o,r as g,A as Me,h as d,f as t,c as a,j as F,u as _,x as O,k as L,y as r,a as c,v,d as S,t as b,w as D}from"../chunks/index.abf12888.js";import{D as z}from"../chunks/Docstring.93f6f462.js";import{H as ue}from"../chunks/Heading.16916d63.js";function Pe(pe){let u,B,V,j,$,G,x,fe='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>.',K,y,R,n,M,se,k,me=`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.`,re,H,he=`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.`,ne,f,P,oe,I,ge=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,ae,m,T,ie,q,_e="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",de,h,E,ce,N,ve=`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).`,W,w,Y,p,C,le,U,Se="Base class for the output of a scheduler’s <code>step</code> function.",J,A,Q;return $=new ue({props:{title:"DPMSolverSDEScheduler",local:"dpmsolversdescheduler",headingTag:"h1"}}),y=new ue({props:{title:"DPMSolverSDEScheduler",local:"diffusers.DPMSolverSDEScheduler",headingTag:"h2"}}),M=new z({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"}}),P=new z({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#L255",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>
`}}),T=new z({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#L282"}}),E=new z({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_ancestral#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/dpm_discrete_ancestral#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/dpm_discrete_ancestral#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> or <code>tuple</code></p>
`}}),w=new ue({props:{title:"SchedulerOutput",local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",headingTag:"h2"}}),C=new z({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#L51"}}),{c(){u=i("meta"),B=o(),V=i("p"),j=o(),g($.$$.fragment),G=o(),x=i("p"),x.innerHTML=fe,K=o(),g(y.$$.fragment),R=o(),n=i("div"),g(M.$$.fragment),se=o(),k=i("p"),k.innerHTML=me,re=o(),H=i("p"),H.innerHTML=he,ne=o(),f=i("div"),g(P.$$.fragment),oe=o(),I=i("p"),I.textContent=ge,ae=o(),m=i("div"),g(T.$$.fragment),ie=o(),q=i("p"),q.textContent=_e,de=o(),h=i("div"),g(E.$$.fragment),ce=o(),N=i("p"),N.textContent=ve,W=o(),g(w.$$.fragment),Y=o(),p=i("div"),g(C.$$.fragment),le=o(),U=i("p"),U.innerHTML=Se,J=o(),A=i("p"),this.h()},l(e){const s=Me("svelte-u9bgzb",document.head);u=d(s,"META",{name:!0,content:!0}),s.forEach(t),B=a(e),V=d(e,"P",{}),F(V).forEach(t),j=a(e),_($.$$.fragment,e),G=a(e),x=d(e,"P",{"data-svelte-h":!0}),O(x)!=="svelte-f261ri"&&(x.innerHTML=fe),K=a(e),_(y.$$.fragment,e),R=a(e),n=d(e,"DIV",{class:!0});var l=F(n);_(M.$$.fragment,l),se=a(l),k=d(l,"P",{"data-svelte-h":!0}),O(k)!=="svelte-2gqyak"&&(k.innerHTML=me),re=a(l),H=d(l,"P",{"data-svelte-h":!0}),O(H)!=="svelte-linuuh"&&(H.innerHTML=he),ne=a(l),f=d(l,"DIV",{class:!0});var X=F(f);_(P.$$.fragment,X),oe=a(X),I=d(X,"P",{"data-svelte-h":!0}),O(I)!=="svelte-1rkfgpx"&&(I.textContent=ge),X.forEach(t),ae=a(l),m=d(l,"DIV",{class:!0});var Z=F(m);_(T.$$.fragment,Z),ie=a(Z),q=d(Z,"P",{"data-svelte-h":!0}),O(q)!=="svelte-1vzm9q"&&(q.textContent=_e),Z.forEach(t),de=a(l),h=d(l,"DIV",{class:!0});var ee=F(h);_(E.$$.fragment,ee),ce=a(ee),N=d(ee,"P",{"data-svelte-h":!0}),O(N)!=="svelte-hi84tp"&&(N.textContent=ve),ee.forEach(t),l.forEach(t),W=a(e),_(w.$$.fragment,e),Y=a(e),p=d(e,"DIV",{class:!0});var te=F(p);_(C.$$.fragment,te),le=a(te),U=d(te,"P",{"data-svelte-h":!0}),O(U)!=="svelte-6ojmkw"&&(U.innerHTML=Se),te.forEach(t),J=a(e),A=d(e,"P",{}),F(A).forEach(t),this.h()},h(){L(u,"name","hf:doc:metadata"),L(u,"content",Te),L(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(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,s){r(document.head,u),c(e,B,s),c(e,V,s),c(e,j,s),v($,e,s),c(e,G,s),c(e,x,s),c(e,K,s),v(y,e,s),c(e,R,s),c(e,n,s),v(M,n,null),r(n,se),r(n,k),r(n,re),r(n,H),r(n,ne),r(n,f),v(P,f,null),r(f,oe),r(f,I),r(n,ae),r(n,m),v(T,m,null),r(m,ie),r(m,q),r(n,de),r(n,h),v(E,h,null),r(h,ce),r(h,N),c(e,W,s),v(w,e,s),c(e,Y,s),c(e,p,s),v(C,p,null),r(p,le),r(p,U),c(e,J,s),c(e,A,s),Q=!0},p:De,i(e){Q||(S($.$$.fragment,e),S(y.$$.fragment,e),S(M.$$.fragment,e),S(P.$$.fragment,e),S(T.$$.fragment,e),S(E.$$.fragment,e),S(w.$$.fragment,e),S(C.$$.fragment,e),Q=!0)},o(e){b($.$$.fragment,e),b(y.$$.fragment,e),b(M.$$.fragment,e),b(P.$$.fragment,e),b(T.$$.fragment,e),b(E.$$.fragment,e),b(w.$$.fragment,e),b(C.$$.fragment,e),Q=!1},d(e){e&&(t(B),t(V),t(j),t(G),t(x),t(K),t(R),t(n),t(W),t(Y),t(p),t(J),t(A)),t(u),D($,e),D(y,e),D(M),D(P),D(T),D(E),D(w,e),D(C)}}}const Te='{"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 Ee(pe){return $e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Le extends xe{constructor(u){super(),ye(this,u,Ee,Pe,be,{})}}export{Le as component};
