import{s as be,n as $e,o as we}from"../chunks/scheduler.8c3d61f6.js";import{S as De,i as Se,g as a,s as o,r as g,A as He,h as c,f as n,c as i,j as P,u as _,x as E,k as L,y as t,a as l,v,d as x,t as b,w as $}from"../chunks/index.da70eac4.js";import{D as U}from"../chunks/Docstring.6b390b9a.js";import{H as xe,E as Me}from"../chunks/EditOnGithub.1e64e623.js";function Fe(ue){let u,j,V,G,w,R,D,he='<code>FlowMatchHeunDiscreteScheduler</code> is based on the flow-matching sampling introduced in <a href="https://arxiv.org/abs/2403.03206" rel="nofollow">EDM</a>.',W,S,B,s,H,te,I,me="Heun scheduler.",ne,O,fe=`This model inherits from <a href="/docs/diffusers/v0.30.3/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/v0.30.3/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,h,M,re,k,pe="Forward process in flow-matching",oe,m,F,ie,q,ge="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",ae,f,T,ce,A,_e="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",de,p,C,le,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).`,J,y,K,z,Q;return w=new xe({props:{title:"FlowMatchHeunDiscreteScheduler",local:"flowmatchheundiscretescheduler",headingTag:"h1"}}),S=new xe({props:{title:"FlowMatchHeunDiscreteScheduler",local:"diffusers.FlowMatchHeunDiscreteScheduler",headingTag:"h2"}}),H=new U({props:{name:"class diffusers.FlowMatchHeunDiscreteScheduler",anchor:"diffusers.FlowMatchHeunDiscreteScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"shift",val:": float = 1.0"}],parametersDescription:[{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.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.FlowMatchHeunDiscreteScheduler.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.FlowMatchHeunDiscreteScheduler.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/v0.30.3/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py#L44"}}),M=new U({props:{name:"scale_noise",anchor:"diffusers.FlowMatchHeunDiscreteScheduler.scale_noise",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": Union"},{name:"noise",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.scale_noise.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The input sample.`,name:"sample"},{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.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/v0.30.3/src/diffusers/schedulers/scheduling_flow_match_heun_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 U({props:{name:"set_begin_index",anchor:"diffusers.FlowMatchHeunDiscreteScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.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.30.3/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py#L100"}}),T=new U({props:{name:"set_timesteps",anchor:"diffusers.FlowMatchHeunDiscreteScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": Union = None"}],parametersDescription:[{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.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.FlowMatchHeunDiscreteScheduler.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.30.3/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py#L140"}}),C=new U({props:{name:"step",anchor:"diffusers.FlowMatchHeunDiscreteScheduler.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.FlowMatchHeunDiscreteScheduler.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.FlowMatchHeunDiscreteScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.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.FlowMatchHeunDiscreteScheduler.step.s_churn",description:"<strong>s_churn</strong> (<code>float</code>) &#x2014;",name:"s_churn"},{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.step.s_tmin",description:"<strong>s_tmin</strong>  (<code>float</code>) &#x2014;",name:"s_tmin"},{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.step.s_tmax",description:"<strong>s_tmax</strong>  (<code>float</code>) &#x2014;",name:"s_tmax"},{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.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.FlowMatchHeunDiscreteScheduler.step.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"},{anchor:"diffusers.FlowMatchHeunDiscreteScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) &#x2014;
Whether or not to return a <code>~schedulers.scheduling_Heun_discrete.HeunDiscreteSchedulerOutput</code> or
tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.30.3/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py#L200",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is <code>True</code>, <code>~schedulers.scheduling_Heun_discrete.HeunDiscreteSchedulerOutput</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_Heun_discrete.HeunDiscreteSchedulerOutput</code> or <code>tuple</code></p>
`}}),y=new Me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/flow_match_heun_discrete.md"}}),{c(){u=a("meta"),j=o(),V=a("p"),G=o(),g(w.$$.fragment),R=o(),D=a("p"),D.innerHTML=he,W=o(),g(S.$$.fragment),B=o(),s=a("div"),g(H.$$.fragment),te=o(),I=a("p"),I.textContent=me,ne=o(),O=a("p"),O.innerHTML=fe,se=o(),h=a("div"),g(M.$$.fragment),re=o(),k=a("p"),k.textContent=pe,oe=o(),m=a("div"),g(F.$$.fragment),ie=o(),q=a("p"),q.textContent=ge,ae=o(),f=a("div"),g(T.$$.fragment),ce=o(),A=a("p"),A.textContent=_e,de=o(),p=a("div"),g(C.$$.fragment),le=o(),N=a("p"),N.textContent=ve,J=o(),g(y.$$.fragment),K=o(),z=a("p"),this.h()},l(e){const r=He("svelte-u9bgzb",document.head);u=c(r,"META",{name:!0,content:!0}),r.forEach(n),j=i(e),V=c(e,"P",{}),P(V).forEach(n),G=i(e),_(w.$$.fragment,e),R=i(e),D=c(e,"P",{"data-svelte-h":!0}),E(D)!=="svelte-jk6z0"&&(D.innerHTML=he),W=i(e),_(S.$$.fragment,e),B=i(e),s=c(e,"DIV",{class:!0});var d=P(s);_(H.$$.fragment,d),te=i(d),I=c(d,"P",{"data-svelte-h":!0}),E(I)!=="svelte-t4z76d"&&(I.textContent=me),ne=i(d),O=c(d,"P",{"data-svelte-h":!0}),E(O)!=="svelte-10fng7d"&&(O.innerHTML=fe),se=i(d),h=c(d,"DIV",{class:!0});var X=P(h);_(M.$$.fragment,X),re=i(X),k=c(X,"P",{"data-svelte-h":!0}),E(k)!=="svelte-1nqwaax"&&(k.textContent=pe),X.forEach(n),oe=i(d),m=c(d,"DIV",{class:!0});var Y=P(m);_(F.$$.fragment,Y),ie=i(Y),q=c(Y,"P",{"data-svelte-h":!0}),E(q)!=="svelte-1k141rk"&&(q.textContent=ge),Y.forEach(n),ae=i(d),f=c(d,"DIV",{class:!0});var Z=P(f);_(T.$$.fragment,Z),ce=i(Z),A=c(Z,"P",{"data-svelte-h":!0}),E(A)!=="svelte-1vzm9q"&&(A.textContent=_e),Z.forEach(n),de=i(d),p=c(d,"DIV",{class:!0});var ee=P(p);_(C.$$.fragment,ee),le=i(ee),N=c(ee,"P",{"data-svelte-h":!0}),E(N)!=="svelte-hi84tp"&&(N.textContent=ve),ee.forEach(n),d.forEach(n),J=i(e),_(y.$$.fragment,e),K=i(e),z=c(e,"P",{}),P(z).forEach(n),this.h()},h(){L(u,"name","hf:doc:metadata"),L(u,"content",Te),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(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(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,r){t(document.head,u),l(e,j,r),l(e,V,r),l(e,G,r),v(w,e,r),l(e,R,r),l(e,D,r),l(e,W,r),v(S,e,r),l(e,B,r),l(e,s,r),v(H,s,null),t(s,te),t(s,I),t(s,ne),t(s,O),t(s,se),t(s,h),v(M,h,null),t(h,re),t(h,k),t(s,oe),t(s,m),v(F,m,null),t(m,ie),t(m,q),t(s,ae),t(s,f),v(T,f,null),t(f,ce),t(f,A),t(s,de),t(s,p),v(C,p,null),t(p,le),t(p,N),l(e,J,r),v(y,e,r),l(e,K,r),l(e,z,r),Q=!0},p:$e,i(e){Q||(x(w.$$.fragment,e),x(S.$$.fragment,e),x(H.$$.fragment,e),x(M.$$.fragment,e),x(F.$$.fragment,e),x(T.$$.fragment,e),x(C.$$.fragment,e),x(y.$$.fragment,e),Q=!0)},o(e){b(w.$$.fragment,e),b(S.$$.fragment,e),b(H.$$.fragment,e),b(M.$$.fragment,e),b(F.$$.fragment,e),b(T.$$.fragment,e),b(C.$$.fragment,e),b(y.$$.fragment,e),Q=!1},d(e){e&&(n(j),n(V),n(G),n(R),n(D),n(W),n(B),n(s),n(J),n(K),n(z)),n(u),$(w,e),$(S,e),$(H),$(M),$(F),$(T),$(C),$(y,e)}}}const Te='{"title":"FlowMatchHeunDiscreteScheduler","local":"flowmatchheundiscretescheduler","sections":[{"title":"FlowMatchHeunDiscreteScheduler","local":"diffusers.FlowMatchHeunDiscreteScheduler","sections":[],"depth":2}],"depth":1}';function Ce(ue){return we(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ie extends De{constructor(u){super(),Se(this,u,Ce,Fe,be,{})}}export{Ie as component};
