import{s as Le,n as Oe,o as ke}from"../chunks/scheduler.53228c21.js";import{S as Ie,i as qe,e as a,s as r,c as p,h as He,a as d,d as t,b as o,f as x,g as u,j as y,k as M,l as n,m as l,n as m,t as f,o as h,p as g}from"../chunks/index.100fac89.js";import{C as Ne}from"../chunks/CopyLLMTxtMenu.0ee1b69b.js";import{D as G}from"../chunks/Docstring.db856a1e.js";import{H as De,E as ze}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.136ef3fd.js";function Fe($e){let _,K,R,Y,P,J,E,Q,T,xe='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>.',X,w,Z,i,C,ce,z,ye=`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.`,pe,F,Me=`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.`,ue,S,L,me,U,Pe=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,fe,b,O,he,V,Ee="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",ge,D,k,_e,A,Te="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",ve,$,I,Se,B,we=`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).`,ee,q,te,v,H,be,W,Ce="Base class for the output of a scheduler’s <code>step</code> function.",se,N,ne,j,re;return P=new Ne({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),E=new De({props:{title:"DPMSolverSDEScheduler",local:"dpmsolversdescheduler",headingTag:"h1"}}),w=new De({props:{title:"DPMSolverSDEScheduler",local:"diffusers.DPMSolverSDEScheduler",headingTag:"h2"}}),C=new G({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:"use_exponential_sigmas",val:": typing.Optional[bool] = False"},{name:"use_beta_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.use_exponential_sigmas",description:`<strong>use_exponential_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use exponential sigmas for step sizes in the noise schedule during the sampling process.`,name:"use_exponential_sigmas"},{anchor:"diffusers.DPMSolverSDEScheduler.use_beta_sigmas",description:`<strong>use_beta_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use beta sigmas for step sizes in the noise schedule during the sampling process. Refer to <a href="https://huggingface.co/papers/2407.12173" rel="nofollow">Beta
Sampling is All You Need</a> for more information.`,name:"use_beta_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#L161"}}),L=new G({props:{name:"scale_model_input",anchor:"diffusers.DPMSolverSDEScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": typing.Union[float, torch.Tensor]"}],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#L309",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>
`}}),O=new G({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#L299"}}),k=new G({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#L336"}}),I=new G({props:{name:"step",anchor:"diffusers.DPMSolverSDEScheduler.step",parameters:[{name:"model_output",val:": typing.Union[torch.Tensor, numpy.ndarray]"},{name:"timestep",val:": typing.Union[float, torch.Tensor]"},{name:"sample",val:": typing.Union[torch.Tensor, 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.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>) &#x2014;
Whether or not to return a <code>DPMSolverSDESchedulerOutput</code> 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#L526",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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