import{s as Le,n as Pe,o as Oe}from"../chunks/scheduler.182ea377.js";import{S as ke,i as He,g as a,s as n,r as m,A as Fe,h as d,f as r,c as o,j as M,u as h,x as f,k as S,y as t,a as c,v as g,d as _,t as E,w as v}from"../chunks/index.abf12888.js";import{D as G}from"../chunks/Docstring.93f6f462.js";import{H as ve}from"../chunks/Heading.16916d63.js";function Ie(be){let u,R,j,W,T,J,w,xe='The Karras formulation of the Euler scheduler (Algorithm 2) from the <a href="https://huggingface.co/papers/2206.00364" rel="nofollow">Elucidating the Design Space of Diffusion-Based Generative Models</a> paper by Karras et al. This is a fast scheduler which can often generate good outputs in 20-30 steps. The scheduler is based on the original <a href="https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L51" rel="nofollow">k-diffusion</a> implementation by <a href="https://github.com/crowsonkb/" rel="nofollow">Katherine Crowson</a>.',Q,y,X,s,C,ae,I,$e="Implements the Euler scheduler in EDM formulation as presented in Karras et al. 2022 [1].",de,V,De=`[1] Karras, Tero, et al. “Elucidating the Design Space of Diffusion-Based Generative Models.”
<a href="https://arxiv.org/abs/2206.00364" rel="nofollow">https://arxiv.org/abs/2206.00364</a>`,le,A,Me=`This model inherits from <a href="/docs/diffusers/v0.27.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/v0.27.0/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,L,ue,K,Se=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep. Scales the denoising model input by <code>(sigma**2 + 1) ** 0.5</code> to match the Euler algorithm.`,pe,x,P,me,z,Te="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",he,$,O,fe,N,we="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",ge,D,k,_e,U,ye=`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,H,Z,p,F,Ee,q,Ce="Output class for the scheduler’s <code>step</code> function output.",ee,B,te;return T=new ve({props:{title:"EDMEulerScheduler",local:"edmeulerscheduler",headingTag:"h1"}}),y=new ve({props:{title:"EDMEulerScheduler",local:"diffusers.EDMEulerScheduler",headingTag:"h2"}}),C=new G({props:{name:"class diffusers.EDMEulerScheduler",anchor:"diffusers.EDMEulerScheduler",parameters:[{name:"sigma_min",val:": float = 0.002"},{name:"sigma_max",val:": float = 80.0"},{name:"sigma_data",val:": float = 0.5"},{name:"num_train_timesteps",val:": int = 1000"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"rho",val:": float = 7.0"}],parametersDescription:[{anchor:"diffusers.EDMEulerScheduler.sigma_min",description:`<strong>sigma_min</strong> (<code>float</code>, <em>optional</em>, defaults to 0.002) &#x2014;
Minimum noise magnitude in the sigma schedule. This was set to 0.002 in the EDM paper [1]; a reasonable
range is [0, 10].`,name:"sigma_min"},{anchor:"diffusers.EDMEulerScheduler.sigma_max",description:`<strong>sigma_max</strong> (<code>float</code>, <em>optional</em>, defaults to 80.0) &#x2014;
Maximum noise magnitude in the sigma schedule. This was set to 80.0 in the EDM paper [1]; a reasonable
range is [0.2, 80.0].`,name:"sigma_max"},{anchor:"diffusers.EDMEulerScheduler.sigma_data",description:`<strong>sigma_data</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The standard deviation of the data distribution. This is set to 0.5 in the EDM paper [1].`,name:"sigma_data"},{anchor:"diffusers.EDMEulerScheduler.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.EDMEulerScheduler.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.EDMEulerScheduler.rho",description:`<strong>rho</strong> (<code>float</code>, <em>optional</em>, defaults to 7.0) &#x2014;
The rho parameter used for calculating the Karras sigma schedule, which is set to 7.0 in the EDM paper [1].`,name:"rho"}],source:"https://github.com/huggingface/diffusers/blob/v0.27.0/src/diffusers/schedulers/scheduling_edm_euler.py#L49"}}),L=new G({props:{name:"scale_model_input",anchor:"diffusers.EDMEulerScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": Union"}],parametersDescription:[{anchor:"diffusers.EDMEulerScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The input sample.`,name:"sample"},{anchor:"diffusers.EDMEulerScheduler.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.0/src/diffusers/schedulers/scheduling_edm_euler.py#L164",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>
`}}),P=new G({props:{name:"set_begin_index",anchor:"diffusers.EDMEulerScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.EDMEulerScheduler.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.0/src/diffusers/schedulers/scheduling_edm_euler.py#L126"}}),O=new G({props:{name:"set_timesteps",anchor:"diffusers.EDMEulerScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": Union = None"}],parametersDescription:[{anchor:"diffusers.EDMEulerScheduler.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.EDMEulerScheduler.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.0/src/diffusers/schedulers/scheduling_edm_euler.py#L190"}}),k=new G({props:{name:"step",anchor:"diffusers.EDMEulerScheduler.step",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": Union"},{name:"sample",val:": FloatTensor"},{name:"s_churn",val:": float = 0.0"},{name:"s_tmin",val:": float = 0.0"},{name:"s_tmax",val:": float = inf"},{name:"s_noise",val:": float = 1.0"},{name:"generator",val:": Optional = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.EDMEulerScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014;
The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.EDMEulerScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.EDMEulerScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.EDMEulerScheduler.step.s_churn",description:"<strong>s_churn</strong> (<code>float</code>) &#x2014;",name:"s_churn"},{anchor:"diffusers.EDMEulerScheduler.step.s_tmin",description:"<strong>s_tmin</strong>  (<code>float</code>) &#x2014;",name:"s_tmin"},{anchor:"diffusers.EDMEulerScheduler.step.s_tmax",description:"<strong>s_tmax</strong>  (<code>float</code>) &#x2014;",name:"s_tmax"},{anchor:"diffusers.EDMEulerScheduler.step.s_noise",description:`<strong>s_noise</strong> (<code>float</code>, defaults to 1.0) &#x2014;
Scaling factor for noise added to the sample.`,name:"s_noise"},{anchor:"diffusers.EDMEulerScheduler.step.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"},{anchor:"diffusers.EDMEulerScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) &#x2014;
Whether or not to return a <code>~schedulers.scheduling_euler_discrete.EDMEulerSchedulerOutput</code> or
tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.27.0/src/diffusers/schedulers/scheduling_edm_euler.py#L250",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is <code>True</code>, <code>~schedulers.scheduling_euler_discrete.EDMEulerSchedulerOutput</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>~schedulers.scheduling_euler_discrete.EDMEulerSchedulerOutput</code> or <code>tuple</code></p>
`}}),H=new ve({props:{title:"EDMEulerSchedulerOutput",local:"diffusers.schedulers.scheduling_edm_euler.EDMEulerSchedulerOutput",headingTag:"h2"}}),F=new G({props:{name:"class diffusers.schedulers.scheduling_edm_euler.EDMEulerSchedulerOutput",anchor:"diffusers.schedulers.scheduling_edm_euler.EDMEulerSchedulerOutput",parameters:[{name:"prev_sample",val:": FloatTensor"},{name:"pred_original_sample",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.schedulers.scheduling_edm_euler.EDMEulerSchedulerOutput.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"},{anchor:"diffusers.schedulers.scheduling_edm_euler.EDMEulerSchedulerOutput.pred_original_sample",description:`<strong>pred_original_sample</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) &#x2014;
The predicted denoised sample <code>(x_{0})</code> based on the model output from the current timestep.
<code>pred_original_sample</code> can be used to preview progress or for guidance.`,name:"pred_original_sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.27.0/src/diffusers/schedulers/scheduling_edm_euler.py#L30"}}),{c(){u=a("meta"),R=n(),j=a("p"),W=n(),m(T.$$.fragment),J=n(),w=a("p"),w.innerHTML=xe,Q=n(),m(y.$$.fragment),X=n(),s=a("div"),m(C.$$.fragment),ae=n(),I=a("p"),I.textContent=$e,de=n(),V=a("p"),V.innerHTML=De,le=n(),A=a("p"),A.innerHTML=Me,ce=n(),b=a("div"),m(L.$$.fragment),ue=n(),K=a("p"),K.innerHTML=Se,pe=n(),x=a("div"),m(P.$$.fragment),me=n(),z=a("p"),z.textContent=Te,he=n(),$=a("div"),m(O.$$.fragment),fe=n(),N=a("p"),N.textContent=we,ge=n(),D=a("div"),m(k.$$.fragment),_e=n(),U=a("p"),U.textContent=ye,Y=n(),m(H.$$.fragment),Z=n(),p=a("div"),m(F.$$.fragment),Ee=n(),q=a("p"),q.innerHTML=Ce,ee=n(),B=a("p"),this.h()},l(e){const i=Fe("svelte-u9bgzb",document.head);u=d(i,"META",{name:!0,content:!0}),i.forEach(r),R=o(e),j=d(e,"P",{}),M(j).forEach(r),W=o(e),h(T.$$.fragment,e),J=o(e),w=d(e,"P",{"data-svelte-h":!0}),f(w)!=="svelte-1lpsdat"&&(w.innerHTML=xe),Q=o(e),h(y.$$.fragment,e),X=o(e),s=d(e,"DIV",{class:!0});var l=M(s);h(C.$$.fragment,l),ae=o(l),I=d(l,"P",{"data-svelte-h":!0}),f(I)!=="svelte-1jyik6k"&&(I.textContent=$e),de=o(l),V=d(l,"P",{"data-svelte-h":!0}),f(V)!=="svelte-72xw7v"&&(V.innerHTML=De),le=o(l),A=d(l,"P",{"data-svelte-h":!0}),f(A)!=="svelte-15wg2qx"&&(A.innerHTML=Me),ce=o(l),b=d(l,"DIV",{class:!0});var re=M(b);h(L.$$.fragment,re),ue=o(re),K=d(re,"P",{"data-svelte-h":!0}),f(K)!=="svelte-1hew89w"&&(K.innerHTML=Se),re.forEach(r),pe=o(l),x=d(l,"DIV",{class:!0});var se=M(x);h(P.$$.fragment,se),me=o(se),z=d(se,"P",{"data-svelte-h":!0}),f(z)!=="svelte-1k141rk"&&(z.textContent=Te),se.forEach(r),he=o(l),$=d(l,"DIV",{class:!0});var ne=M($);h(O.$$.fragment,ne),fe=o(ne),N=d(ne,"P",{"data-svelte-h":!0}),f(N)!=="svelte-1vzm9q"&&(N.textContent=we),ne.forEach(r),ge=o(l),D=d(l,"DIV",{class:!0});var oe=M(D);h(k.$$.fragment,oe),_e=o(oe),U=d(oe,"P",{"data-svelte-h":!0}),f(U)!=="svelte-hi84tp"&&(U.textContent=ye),oe.forEach(r),l.forEach(r),Y=o(e),h(H.$$.fragment,e),Z=o(e),p=d(e,"DIV",{class:!0});var ie=M(p);h(F.$$.fragment,ie),Ee=o(ie),q=d(ie,"P",{"data-svelte-h":!0}),f(q)!=="svelte-id9kic"&&(q.innerHTML=Ce),ie.forEach(r),ee=o(e),B=d(e,"P",{}),M(B).forEach(r),this.h()},h(){S(u,"name","hf:doc:metadata"),S(u,"content",Ve),S(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S(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,i){t(document.head,u),c(e,R,i),c(e,j,i),c(e,W,i),g(T,e,i),c(e,J,i),c(e,w,i),c(e,Q,i),g(y,e,i),c(e,X,i),c(e,s,i),g(C,s,null),t(s,ae),t(s,I),t(s,de),t(s,V),t(s,le),t(s,A),t(s,ce),t(s,b),g(L,b,null),t(b,ue),t(b,K),t(s,pe),t(s,x),g(P,x,null),t(x,me),t(x,z),t(s,he),t(s,$),g(O,$,null),t($,fe),t($,N),t(s,ge),t(s,D),g(k,D,null),t(D,_e),t(D,U),c(e,Y,i),g(H,e,i),c(e,Z,i),c(e,p,i),g(F,p,null),t(p,Ee),t(p,q),c(e,ee,i),c(e,B,i),te=!0},p:Pe,i(e){te||(_(T.$$.fragment,e),_(y.$$.fragment,e),_(C.$$.fragment,e),_(L.$$.fragment,e),_(P.$$.fragment,e),_(O.$$.fragment,e),_(k.$$.fragment,e),_(H.$$.fragment,e),_(F.$$.fragment,e),te=!0)},o(e){E(T.$$.fragment,e),E(y.$$.fragment,e),E(C.$$.fragment,e),E(L.$$.fragment,e),E(P.$$.fragment,e),E(O.$$.fragment,e),E(k.$$.fragment,e),E(H.$$.fragment,e),E(F.$$.fragment,e),te=!1},d(e){e&&(r(R),r(j),r(W),r(J),r(w),r(Q),r(X),r(s),r(Y),r(Z),r(p),r(ee),r(B)),r(u),v(T,e),v(y,e),v(C),v(L),v(P),v(O),v(k),v(H,e),v(F)}}}const Ve='{"title":"EDMEulerScheduler","local":"edmeulerscheduler","sections":[{"title":"EDMEulerScheduler","local":"diffusers.EDMEulerScheduler","sections":[],"depth":2},{"title":"EDMEulerSchedulerOutput","local":"diffusers.schedulers.scheduling_edm_euler.EDMEulerSchedulerOutput","sections":[],"depth":2}],"depth":1}';function Ae(be){return Oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qe extends ke{constructor(u){super(),He(this,u,Ae,Ie,Le,{})}}export{qe as component};
