import{s as xe,n as $e,o as we}from"../chunks/scheduler.8c3d61f6.js";import{S as De,i as Ee,g as a,s as o,r as g,A as Se,h as c,f as r,c as i,j as P,u as _,x as L,k as O,y as t,a as d,v,d as b,t as x,w as $}from"../chunks/index.589a98e8.js";import{D as j}from"../chunks/Docstring.27406313.js";import{H as be,E as Me}from"../chunks/EditOnGithub.e5a8d9cb.js";function Fe(ue){let u,z,k,G,w,R,D,fe='<code>FlowMatchEulerDiscreteScheduler</code> is based on the flow-matching sampling introduced in <a href="https://arxiv.org/abs/2403.03206" rel="nofollow">Stable Diffusion 3</a>.',W,E,B,s,S,te,I,he="Euler scheduler.",re,N,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.`,se,f,M,ne,q,pe="Forward process in flow-matching",oe,h,F,ie,H,ge="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",ae,m,T,ce,A,_e="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",le,p,C,de,V,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).`,J,y,K,U,Q;return w=new be({props:{title:"FlowMatchEulerDiscreteScheduler",local:"flowmatcheulerdiscretescheduler",headingTag:"h1"}}),E=new be({props:{title:"FlowMatchEulerDiscreteScheduler",local:"diffusers.FlowMatchEulerDiscreteScheduler",headingTag:"h2"}}),S=new j({props:{name:"class diffusers.FlowMatchEulerDiscreteScheduler",anchor:"diffusers.FlowMatchEulerDiscreteScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"shift",val:": float = 1.0"}],parametersDescription:[{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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.FlowMatchEulerDiscreteScheduler.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.FlowMatchEulerDiscreteScheduler.shift",description:`<strong>shift</strong> (<code>float</code>, defaults to 1.0) &#x2014;
The shift value for the timestep schedule.`,name:"shift"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L44"}}),M=new j({props:{name:"scale_noise",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.scale_noise",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": Union"},{name:"noise",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.scale_noise.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The input sample.`,name:"sample"},{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.scale_noise.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_flow_match_euler_discrete.py#L110",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>
`}}),F=new j({props:{name:"set_begin_index",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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_flow_match_euler_discrete.py#L100"}}),T=new j({props:{name:"set_timesteps",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int = None"},{name:"device",val:": Union = None"},{name:"sigmas",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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.FlowMatchEulerDiscreteScheduler.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_flow_match_euler_discrete.py#L161"}}),C=new j({props:{name:"step",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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.FlowMatchEulerDiscreteScheduler.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.FlowMatchEulerDiscreteScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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.FlowMatchEulerDiscreteScheduler.step.s_churn",description:"<strong>s_churn</strong> (<code>float</code>) &#x2014;",name:"s_churn"},{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.step.s_tmin",description:"<strong>s_tmin</strong>  (<code>float</code>) &#x2014;",name:"s_tmin"},{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.step.s_tmax",description:"<strong>s_tmax</strong>  (<code>float</code>) &#x2014;",name:"s_tmax"},{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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.FlowMatchEulerDiscreteScheduler.step.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"},{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/schedulers/euler#diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteSchedulerOutput">EulerDiscreteSchedulerOutput</a> or
tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L217",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/euler#diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteSchedulerOutput"
>EulerDiscreteSchedulerOutput</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/euler#diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteSchedulerOutput"
>EulerDiscreteSchedulerOutput</a> or <code>tuple</code></p>
`}}),y=new Me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/flow_match_euler_discrete.md"}}),{c(){u=a("meta"),z=o(),k=a("p"),G=o(),g(w.$$.fragment),R=o(),D=a("p"),D.innerHTML=fe,W=o(),g(E.$$.fragment),B=o(),s=a("div"),g(S.$$.fragment),te=o(),I=a("p"),I.textContent=he,re=o(),N=a("p"),N.innerHTML=me,se=o(),f=a("div"),g(M.$$.fragment),ne=o(),q=a("p"),q.textContent=pe,oe=o(),h=a("div"),g(F.$$.fragment),ie=o(),H=a("p"),H.textContent=ge,ae=o(),m=a("div"),g(T.$$.fragment),ce=o(),A=a("p"),A.textContent=_e,le=o(),p=a("div"),g(C.$$.fragment),de=o(),V=a("p"),V.textContent=ve,J=o(),g(y.$$.fragment),K=o(),U=a("p"),this.h()},l(e){const n=Se("svelte-u9bgzb",document.head);u=c(n,"META",{name:!0,content:!0}),n.forEach(r),z=i(e),k=c(e,"P",{}),P(k).forEach(r),G=i(e),_(w.$$.fragment,e),R=i(e),D=c(e,"P",{"data-svelte-h":!0}),L(D)!=="svelte-j7byiu"&&(D.innerHTML=fe),W=i(e),_(E.$$.fragment,e),B=i(e),s=c(e,"DIV",{class:!0});var l=P(s);_(S.$$.fragment,l),te=i(l),I=c(l,"P",{"data-svelte-h":!0}),L(I)!=="svelte-rqsn3u"&&(I.textContent=he),re=i(l),N=c(l,"P",{"data-svelte-h":!0}),L(N)!=="svelte-linuuh"&&(N.innerHTML=me),se=i(l),f=c(l,"DIV",{class:!0});var X=P(f);_(M.$$.fragment,X),ne=i(X),q=c(X,"P",{"data-svelte-h":!0}),L(q)!=="svelte-1nqwaax"&&(q.textContent=pe),X.forEach(r),oe=i(l),h=c(l,"DIV",{class:!0});var Y=P(h);_(F.$$.fragment,Y),ie=i(Y),H=c(Y,"P",{"data-svelte-h":!0}),L(H)!=="svelte-1k141rk"&&(H.textContent=ge),Y.forEach(r),ae=i(l),m=c(l,"DIV",{class:!0});var Z=P(m);_(T.$$.fragment,Z),ce=i(Z),A=c(Z,"P",{"data-svelte-h":!0}),L(A)!=="svelte-1vzm9q"&&(A.textContent=_e),Z.forEach(r),le=i(l),p=c(l,"DIV",{class:!0});var ee=P(p);_(C.$$.fragment,ee),de=i(ee),V=c(ee,"P",{"data-svelte-h":!0}),L(V)!=="svelte-hi84tp"&&(V.textContent=ve),ee.forEach(r),l.forEach(r),J=i(e),_(y.$$.fragment,e),K=i(e),U=c(e,"P",{}),P(U).forEach(r),this.h()},h(){O(u,"name","hf:doc:metadata"),O(u,"content",Te),O(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(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(e,n){t(document.head,u),d(e,z,n),d(e,k,n),d(e,G,n),v(w,e,n),d(e,R,n),d(e,D,n),d(e,W,n),v(E,e,n),d(e,B,n),d(e,s,n),v(S,s,null),t(s,te),t(s,I),t(s,re),t(s,N),t(s,se),t(s,f),v(M,f,null),t(f,ne),t(f,q),t(s,oe),t(s,h),v(F,h,null),t(h,ie),t(h,H),t(s,ae),t(s,m),v(T,m,null),t(m,ce),t(m,A),t(s,le),t(s,p),v(C,p,null),t(p,de),t(p,V),d(e,J,n),v(y,e,n),d(e,K,n),d(e,U,n),Q=!0},p:$e,i(e){Q||(b(w.$$.fragment,e),b(E.$$.fragment,e),b(S.$$.fragment,e),b(M.$$.fragment,e),b(F.$$.fragment,e),b(T.$$.fragment,e),b(C.$$.fragment,e),b(y.$$.fragment,e),Q=!0)},o(e){x(w.$$.fragment,e),x(E.$$.fragment,e),x(S.$$.fragment,e),x(M.$$.fragment,e),x(F.$$.fragment,e),x(T.$$.fragment,e),x(C.$$.fragment,e),x(y.$$.fragment,e),Q=!1},d(e){e&&(r(z),r(k),r(G),r(R),r(D),r(W),r(B),r(s),r(J),r(K),r(U)),r(u),$(w,e),$(E,e),$(S),$(M),$(F),$(T),$(C),$(y,e)}}}const Te='{"title":"FlowMatchEulerDiscreteScheduler","local":"flowmatcheulerdiscretescheduler","sections":[{"title":"FlowMatchEulerDiscreteScheduler","local":"diffusers.FlowMatchEulerDiscreteScheduler","sections":[],"depth":2}],"depth":1}';function Ce(ue){return we(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ie extends De{constructor(u){super(),Ee(this,u,Ce,Fe,xe,{})}}export{Ie as component};
