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 O,u as _,x as P,k as L,y as t,a as d,v,d as b,t as x,w as $}from"../chunks/index.da70eac4.js";import{D as j}from"../chunks/Docstring.ee4b6913.js";import{H as be,E as Fe}from"../chunks/EditOnGithub.1e64e623.js";function Me(ue){let u,z,k,G,w,R,D,me='<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,q,fe="Euler scheduler.",re,N,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.`,se,m,F,ne,I,pe="Forward process in flow-matching",oe,f,M,ie,H,ge="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",ae,h,T,ce,A,_e="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",le,p,y,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,C,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"},{name:"use_dynamic_shifting",val:" = False"},{name:"base_shift",val:": Optional = 0.5"},{name:"max_shift",val:": Optional = 1.15"},{name:"base_image_seq_len",val:": Optional = 256"},{name:"max_image_seq_len",val:": Optional = 4096"}],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"}}),F=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#L117",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>
`}}),M=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#L107"}}),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"},{name:"mu",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#L171"}}),y=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#L235",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>
`}}),C=new Fe({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=me,W=o(),g(E.$$.fragment),B=o(),s=a("div"),g(S.$$.fragment),te=o(),q=a("p"),q.textContent=fe,re=o(),N=a("p"),N.innerHTML=he,se=o(),m=a("div"),g(F.$$.fragment),ne=o(),I=a("p"),I.textContent=pe,oe=o(),f=a("div"),g(M.$$.fragment),ie=o(),H=a("p"),H.textContent=ge,ae=o(),h=a("div"),g(T.$$.fragment),ce=o(),A=a("p"),A.textContent=_e,le=o(),p=a("div"),g(y.$$.fragment),de=o(),V=a("p"),V.textContent=ve,J=o(),g(C.$$.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",{}),O(k).forEach(r),G=i(e),_(w.$$.fragment,e),R=i(e),D=c(e,"P",{"data-svelte-h":!0}),P(D)!=="svelte-j7byiu"&&(D.innerHTML=me),W=i(e),_(E.$$.fragment,e),B=i(e),s=c(e,"DIV",{class:!0});var l=O(s);_(S.$$.fragment,l),te=i(l),q=c(l,"P",{"data-svelte-h":!0}),P(q)!=="svelte-rqsn3u"&&(q.textContent=fe),re=i(l),N=c(l,"P",{"data-svelte-h":!0}),P(N)!=="svelte-linuuh"&&(N.innerHTML=he),se=i(l),m=c(l,"DIV",{class:!0});var X=O(m);_(F.$$.fragment,X),ne=i(X),I=c(X,"P",{"data-svelte-h":!0}),P(I)!=="svelte-1nqwaax"&&(I.textContent=pe),X.forEach(r),oe=i(l),f=c(l,"DIV",{class:!0});var Y=O(f);_(M.$$.fragment,Y),ie=i(Y),H=c(Y,"P",{"data-svelte-h":!0}),P(H)!=="svelte-1k141rk"&&(H.textContent=ge),Y.forEach(r),ae=i(l),h=c(l,"DIV",{class:!0});var Z=O(h);_(T.$$.fragment,Z),ce=i(Z),A=c(Z,"P",{"data-svelte-h":!0}),P(A)!=="svelte-1vzm9q"&&(A.textContent=_e),Z.forEach(r),le=i(l),p=c(l,"DIV",{class:!0});var ee=O(p);_(y.$$.fragment,ee),de=i(ee),V=c(ee,"P",{"data-svelte-h":!0}),P(V)!=="svelte-hi84tp"&&(V.textContent=ve),ee.forEach(r),l.forEach(r),J=i(e),_(C.$$.fragment,e),K=i(e),U=c(e,"P",{}),O(U).forEach(r),this.h()},h(){L(u,"name","hf:doc:metadata"),L(u,"content",Te),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(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(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(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(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,q),t(s,re),t(s,N),t(s,se),t(s,m),v(F,m,null),t(m,ne),t(m,I),t(s,oe),t(s,f),v(M,f,null),t(f,ie),t(f,H),t(s,ae),t(s,h),v(T,h,null),t(h,ce),t(h,A),t(s,le),t(s,p),v(y,p,null),t(p,de),t(p,V),d(e,J,n),v(C,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(F.$$.fragment,e),b(M.$$.fragment,e),b(T.$$.fragment,e),b(y.$$.fragment,e),b(C.$$.fragment,e),Q=!0)},o(e){x(w.$$.fragment,e),x(E.$$.fragment,e),x(S.$$.fragment,e),x(F.$$.fragment,e),x(M.$$.fragment,e),x(T.$$.fragment,e),x(y.$$.fragment,e),x(C.$$.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),$(F),$(M),$(T),$(y),$(C,e)}}}const Te='{"title":"FlowMatchEulerDiscreteScheduler","local":"flowmatcheulerdiscretescheduler","sections":[{"title":"FlowMatchEulerDiscreteScheduler","local":"diffusers.FlowMatchEulerDiscreteScheduler","sections":[],"depth":2}],"depth":1}';function ye(ue){return we(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qe extends De{constructor(u){super(),Ee(this,u,ye,Me,xe,{})}}export{qe as component};
