Buckets:

rtrm's picture
download
raw
15 kB
import{s as Ce,n as Le,o as Oe}from"../chunks/scheduler.8c3d61f6.js";import{S as Pe,i as He,g as i,s as n,r as h,A as qe,h as a,f as s,c as o,j as E,u as p,x as m,k as S,y as t,a as d,v as g,d as _,t as v,w as b}from"../chunks/index.da70eac4.js";import{D as R}from"../chunks/Docstring.6b390b9a.js";import{H as ye,E as Ne}from"../chunks/EditOnGithub.1e64e623.js";function Ie(be){let f,B,X,J,F,K,M,xe='<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>.',Q,T,Y,r,y,ie,N,$e="Euler scheduler.",ae,I,we=`This model inherits from <a href="/docs/diffusers/pr_10312/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/pr_10312/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.`,le,x,C,ce,V,De="Forward process in flow-matching",de,$,L,ue,k,Ee="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",fe,w,O,he,A,Se="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",pe,D,P,me,j,Fe=`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).`,ge,u,H,_e,U,Me=`Stretches and shifts the timestep schedule to ensure it terminates at the configured <code>shift_terminal</code> config
value.`,ve,z,Te=`Reference:
<a href="https://github.com/Lightricks/LTX-Video/blob/a01a171f8fe3d99dce2728d60a73fecf4d4238ae/ltx_video/schedulers/rf.py#L51" rel="nofollow">https://github.com/Lightricks/LTX-Video/blob/a01a171f8fe3d99dce2728d60a73fecf4d4238ae/ltx_video/schedulers/rf.py#L51</a>`,Z,q,ee,W,te;return F=new ye({props:{title:"FlowMatchEulerDiscreteScheduler",local:"flowmatcheulerdiscretescheduler",headingTag:"h1"}}),T=new ye({props:{title:"FlowMatchEulerDiscreteScheduler",local:"diffusers.FlowMatchEulerDiscreteScheduler",headingTag:"h2"}}),y=new R({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:": typing.Optional[float] = 0.5"},{name:"max_shift",val:": typing.Optional[float] = 1.15"},{name:"base_image_seq_len",val:": typing.Optional[int] = 256"},{name:"max_image_seq_len",val:": typing.Optional[int] = 4096"},{name:"invert_sigmas",val:": bool = False"},{name:"shift_terminal",val:": typing.Optional[float] = None"},{name:"use_karras_sigmas",val:": typing.Optional[bool] = False"},{name:"use_exponential_sigmas",val:": typing.Optional[bool] = False"},{name:"use_beta_sigmas",val:": typing.Optional[bool] = False"}],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/vr_10312/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L47"}}),C=new R({props:{name:"scale_noise",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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.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/vr_10312/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L143",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>
`}}),L=new R({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/vr_10312/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L130"}}),O=new R({props:{name:"set_timesteps",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int = None"},{name:"device",val:": typing.Union[str, torch.device] = None"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"mu",val:": typing.Optional[float] = 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/vr_10312/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L218"}}),P=new R({props:{name:"step",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.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.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/pr_10312/en/api/schedulers/euler#diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteSchedulerOutput">EulerDiscreteSchedulerOutput</a> or
tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L302",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If return_dict is <code>True</code>, <a
href="/docs/diffusers/pr_10312/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/pr_10312/en/api/schedulers/euler#diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteSchedulerOutput"
>EulerDiscreteSchedulerOutput</a> or <code>tuple</code></p>
`}}),H=new R({props:{name:"stretch_shift_to_terminal",anchor:"diffusers.FlowMatchEulerDiscreteScheduler.stretch_shift_to_terminal",parameters:[{name:"t",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.FlowMatchEulerDiscreteScheduler.stretch_shift_to_terminal.t",description:`<strong>t</strong> (<code>torch.Tensor</code>) &#x2014;
A tensor of timesteps to be stretched and shifted.`,name:"t"}],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L197",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A tensor of adjusted timesteps such that the final value equals <code>self.config.shift_terminal</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>torch.Tensor</code></p>
`}}),q=new Ne({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/flow_match_euler_discrete.md"}}),{c(){f=i("meta"),B=n(),X=i("p"),J=n(),h(F.$$.fragment),K=n(),M=i("p"),M.innerHTML=xe,Q=n(),h(T.$$.fragment),Y=n(),r=i("div"),h(y.$$.fragment),ie=n(),N=i("p"),N.textContent=$e,ae=n(),I=i("p"),I.innerHTML=we,le=n(),x=i("div"),h(C.$$.fragment),ce=n(),V=i("p"),V.textContent=De,de=n(),$=i("div"),h(L.$$.fragment),ue=n(),k=i("p"),k.textContent=Ee,fe=n(),w=i("div"),h(O.$$.fragment),he=n(),A=i("p"),A.textContent=Se,pe=n(),D=i("div"),h(P.$$.fragment),me=n(),j=i("p"),j.textContent=Fe,ge=n(),u=i("div"),h(H.$$.fragment),_e=n(),U=i("p"),U.innerHTML=Me,ve=n(),z=i("p"),z.innerHTML=Te,Z=n(),h(q.$$.fragment),ee=n(),W=i("p"),this.h()},l(e){const l=qe("svelte-u9bgzb",document.head);f=a(l,"META",{name:!0,content:!0}),l.forEach(s),B=o(e),X=a(e,"P",{}),E(X).forEach(s),J=o(e),p(F.$$.fragment,e),K=o(e),M=a(e,"P",{"data-svelte-h":!0}),m(M)!=="svelte-j7byiu"&&(M.innerHTML=xe),Q=o(e),p(T.$$.fragment,e),Y=o(e),r=a(e,"DIV",{class:!0});var c=E(r);p(y.$$.fragment,c),ie=o(c),N=a(c,"P",{"data-svelte-h":!0}),m(N)!=="svelte-rqsn3u"&&(N.textContent=$e),ae=o(c),I=a(c,"P",{"data-svelte-h":!0}),m(I)!=="svelte-1oywc2v"&&(I.innerHTML=we),le=o(c),x=a(c,"DIV",{class:!0});var re=E(x);p(C.$$.fragment,re),ce=o(re),V=a(re,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1nqwaax"&&(V.textContent=De),re.forEach(s),de=o(c),$=a(c,"DIV",{class:!0});var se=E($);p(L.$$.fragment,se),ue=o(se),k=a(se,"P",{"data-svelte-h":!0}),m(k)!=="svelte-1k141rk"&&(k.textContent=Ee),se.forEach(s),fe=o(c),w=a(c,"DIV",{class:!0});var ne=E(w);p(O.$$.fragment,ne),he=o(ne),A=a(ne,"P",{"data-svelte-h":!0}),m(A)!=="svelte-1vzm9q"&&(A.textContent=Se),ne.forEach(s),pe=o(c),D=a(c,"DIV",{class:!0});var oe=E(D);p(P.$$.fragment,oe),me=o(oe),j=a(oe,"P",{"data-svelte-h":!0}),m(j)!=="svelte-hi84tp"&&(j.textContent=Fe),oe.forEach(s),ge=o(c),u=a(c,"DIV",{class:!0});var G=E(u);p(H.$$.fragment,G),_e=o(G),U=a(G,"P",{"data-svelte-h":!0}),m(U)!=="svelte-1mirmbz"&&(U.innerHTML=Me),ve=o(G),z=a(G,"P",{"data-svelte-h":!0}),m(z)!=="svelte-1sj7udg"&&(z.innerHTML=Te),G.forEach(s),c.forEach(s),Z=o(e),p(q.$$.fragment,e),ee=o(e),W=a(e,"P",{}),E(W).forEach(s),this.h()},h(){S(f,"name","hf:doc:metadata"),S(f,"content",Ve),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(w,"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(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S(r,"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,l){t(document.head,f),d(e,B,l),d(e,X,l),d(e,J,l),g(F,e,l),d(e,K,l),d(e,M,l),d(e,Q,l),g(T,e,l),d(e,Y,l),d(e,r,l),g(y,r,null),t(r,ie),t(r,N),t(r,ae),t(r,I),t(r,le),t(r,x),g(C,x,null),t(x,ce),t(x,V),t(r,de),t(r,$),g(L,$,null),t($,ue),t($,k),t(r,fe),t(r,w),g(O,w,null),t(w,he),t(w,A),t(r,pe),t(r,D),g(P,D,null),t(D,me),t(D,j),t(r,ge),t(r,u),g(H,u,null),t(u,_e),t(u,U),t(u,ve),t(u,z),d(e,Z,l),g(q,e,l),d(e,ee,l),d(e,W,l),te=!0},p:Le,i(e){te||(_(F.$$.fragment,e),_(T.$$.fragment,e),_(y.$$.fragment,e),_(C.$$.fragment,e),_(L.$$.fragment,e),_(O.$$.fragment,e),_(P.$$.fragment,e),_(H.$$.fragment,e),_(q.$$.fragment,e),te=!0)},o(e){v(F.$$.fragment,e),v(T.$$.fragment,e),v(y.$$.fragment,e),v(C.$$.fragment,e),v(L.$$.fragment,e),v(O.$$.fragment,e),v(P.$$.fragment,e),v(H.$$.fragment,e),v(q.$$.fragment,e),te=!1},d(e){e&&(s(B),s(X),s(J),s(K),s(M),s(Q),s(Y),s(r),s(Z),s(ee),s(W)),s(f),b(F,e),b(T,e),b(y),b(C),b(L),b(O),b(P),b(H),b(q,e)}}}const Ve='{"title":"FlowMatchEulerDiscreteScheduler","local":"flowmatcheulerdiscretescheduler","sections":[{"title":"FlowMatchEulerDiscreteScheduler","local":"diffusers.FlowMatchEulerDiscreteScheduler","sections":[],"depth":2}],"depth":1}';function ke(be){return Oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ge extends Pe{constructor(f){super(),He(this,f,ke,Ie,Ce,{})}}export{Ge as component};

Xet Storage Details

Size:
15 kB
·
Xet hash:
6d0b6959ce853110ca00781fa008a6be9b5dda89fcd197c93b181a2b41c84ceb

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.