import{s as be,n as De,o as Me}from"../chunks/scheduler.53228c21.js";import{S as Se,i as Fe,e as a,s as o,c as m,h as He,a as c,d as t,b as i,f as E,g as h,j as L,k as I,l as n,m as l,n as f,t as p,o as g,p as _}from"../chunks/index.100fac89.js";import{C as Te}from"../chunks/CopyLLMTxtMenu.b0ff86f3.js";import{D as G}from"../chunks/Docstring.db856a1e.js";import{H as we,E as ye}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.136ef3fd.js";function Ce(he){let u,R,A,j,b,W,D,B,M,fe='<code>FlowMatchHeunDiscreteScheduler</code> is based on the flow-matching sampling introduced in <a href="https://huggingface.co/papers/2403.03206" rel="nofollow">EDM</a>.',J,S,K,s,F,se,O,pe="Heun scheduler.",re,q,ge=`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.`,oe,$,H,ie,N,_e="Forward process in flow-matching",ae,x,T,ce,V,$e="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",de,v,y,le,k,xe="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",ue,w,C,me,z,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).`,Q,P,X,U,Y;return b=new Te({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),D=new we({props:{title:"FlowMatchHeunDiscreteScheduler",local:"flowmatchheundiscretescheduler",headingTag:"h1"}}),S=new we({props:{title:"FlowMatchHeunDiscreteScheduler",local:"diffusers.FlowMatchHeunDiscreteScheduler",headingTag:"h2"}}),F=new G({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/main/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py#L44"}}),H=new G({props:{name:"scale_noise",anchor:"diffusers.FlowMatchHeunDiscreteScheduler.scale_noise",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": typing.Union[float, torch.FloatTensor]"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = 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/main/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>
`}}),T=new G({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/main/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py#L100"}}),y=new G({props:{name:"set_timesteps",anchor:"diffusers.FlowMatchHeunDiscreteScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = 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/main/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py#L140"}}),C=new G({props:{name:"step",anchor:"diffusers.FlowMatchHeunDiscreteScheduler.step",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": typing.Union[float, torch.FloatTensor]"},{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:": typing.Optional[torch._C.Generator] = 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>FlowMatchHeunDiscreteSchedulerOutput</code> tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/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>FlowMatchHeunDiscreteSchedulerOutput</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>FlowMatchHeunDiscreteSchedulerOutput</code> or <code>tuple</code></p>
`}}),P=new ye({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/flow_match_heun_discrete.md"}}),{c(){u=a("meta"),R=o(),A=a("p"),j=o(),m(b.$$.fragment),W=o(),m(D.$$.fragment),B=o(),M=a("p"),M.innerHTML=fe,J=o(),m(S.$$.fragment),K=o(),s=a("div"),m(F.$$.fragment),se=o(),O=a("p"),O.textContent=pe,re=o(),q=a("p"),q.innerHTML=ge,oe=o(),$=a("div"),m(H.$$.fragment),ie=o(),N=a("p"),N.textContent=_e,ae=o(),x=a("div"),m(T.$$.fragment),ce=o(),V=a("p"),V.textContent=$e,de=o(),v=a("div"),m(y.$$.fragment),le=o(),k=a("p"),k.textContent=xe,ue=o(),w=a("div"),m(C.$$.fragment),me=o(),z=a("p"),z.textContent=ve,Q=o(),m(P.$$.fragment),X=o(),U=a("p"),this.h()},l(e){const r=He("svelte-u9bgzb",document.head);u=c(r,"META",{name:!0,content:!0}),r.forEach(t),R=i(e),A=c(e,"P",{}),E(A).forEach(t),j=i(e),h(b.$$.fragment,e),W=i(e),h(D.$$.fragment,e),B=i(e),M=c(e,"P",{"data-svelte-h":!0}),L(M)!=="svelte-l2swp"&&(M.innerHTML=fe),J=i(e),h(S.$$.fragment,e),K=i(e),s=c(e,"DIV",{class:!0});var d=E(s);h(F.$$.fragment,d),se=i(d),O=c(d,"P",{"data-svelte-h":!0}),L(O)!=="svelte-t4z76d"&&(O.textContent=pe),re=i(d),q=c(d,"P",{"data-svelte-h":!0}),L(q)!=="svelte-linuuh"&&(q.innerHTML=ge),oe=i(d),$=c(d,"DIV",{class:!0});var Z=E($);h(H.$$.fragment,Z),ie=i(Z),N=c(Z,"P",{"data-svelte-h":!0}),L(N)!=="svelte-1nqwaax"&&(N.textContent=_e),Z.forEach(t),ae=i(d),x=c(d,"DIV",{class:!0});var ee=E(x);h(T.$$.fragment,ee),ce=i(ee),V=c(ee,"P",{"data-svelte-h":!0}),L(V)!=="svelte-1k141rk"&&(V.textContent=$e),ee.forEach(t),de=i(d),v=c(d,"DIV",{class:!0});var te=E(v);h(y.$$.fragment,te),le=i(te),k=c(te,"P",{"data-svelte-h":!0}),L(k)!=="svelte-1vzm9q"&&(k.textContent=xe),te.forEach(t),ue=i(d),w=c(d,"DIV",{class:!0});var ne=E(w);h(C.$$.fragment,ne),me=i(ne),z=c(ne,"P",{"data-svelte-h":!0}),L(z)!=="svelte-hi84tp"&&(z.textContent=ve),ne.forEach(t),d.forEach(t),Q=i(e),h(P.$$.fragment,e),X=i(e),U=c(e,"P",{}),E(U).forEach(t),this.h()},h(){I(u,"name","hf:doc:metadata"),I(u,"content",Pe),I($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(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){n(document.head,u),l(e,R,r),l(e,A,r),l(e,j,r),f(b,e,r),l(e,W,r),f(D,e,r),l(e,B,r),l(e,M,r),l(e,J,r),f(S,e,r),l(e,K,r),l(e,s,r),f(F,s,null),n(s,se),n(s,O),n(s,re),n(s,q),n(s,oe),n(s,$),f(H,$,null),n($,ie),n($,N),n(s,ae),n(s,x),f(T,x,null),n(x,ce),n(x,V),n(s,de),n(s,v),f(y,v,null),n(v,le),n(v,k),n(s,ue),n(s,w),f(C,w,null),n(w,me),n(w,z),l(e,Q,r),f(P,e,r),l(e,X,r),l(e,U,r),Y=!0},p:De,i(e){Y||(p(b.$$.fragment,e),p(D.$$.fragment,e),p(S.$$.fragment,e),p(F.$$.fragment,e),p(H.$$.fragment,e),p(T.$$.fragment,e),p(y.$$.fragment,e),p(C.$$.fragment,e),p(P.$$.fragment,e),Y=!0)},o(e){g(b.$$.fragment,e),g(D.$$.fragment,e),g(S.$$.fragment,e),g(F.$$.fragment,e),g(H.$$.fragment,e),g(T.$$.fragment,e),g(y.$$.fragment,e),g(C.$$.fragment,e),g(P.$$.fragment,e),Y=!1},d(e){e&&(t(R),t(A),t(j),t(W),t(B),t(M),t(J),t(K),t(s),t(Q),t(X),t(U)),t(u),_(b,e),_(D,e),_(S,e),_(F),_(H),_(T),_(y),_(C),_(P,e)}}}const Pe='{"title":"FlowMatchHeunDiscreteScheduler","local":"flowmatchheundiscretescheduler","sections":[{"title":"FlowMatchHeunDiscreteScheduler","local":"diffusers.FlowMatchHeunDiscreteScheduler","sections":[],"depth":2}],"depth":1}';function Ee(he){return Me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ve extends Se{constructor(u){super(),Fe(this,u,Ee,Ce,be,{})}}export{Ve as component};
