Buckets:
| import{s as Le,n as Pe,o as Oe}from"../chunks/scheduler.182ea377.js";import{S as Me,i as ke,g as i,s as n,r as f,A as ze,h as c,f as t,c as o,j as S,u as h,x as m,k as A,y as r,a as d,v as g,d as _,t as b,w as v}from"../chunks/index.abf12888.js";import{D as j}from"../chunks/Docstring.b0ac41bc.js";import{H as Ce,E as He}from"../chunks/EditOnGithub.9b8e78e4.js";function Ie(ve){let u,K,G,B,T,J,w,xe='A scheduler that uses ancestral sampling with Euler method steps. This is a fast scheduler which can often generate good outputs in 20-30 steps. The scheduler is based on the original <a href="https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L72" rel="nofollow">k-diffusion</a> implementation by <a href="https://github.com/crowsonkb/" rel="nofollow">Katherine Crowson</a>.',Q,y,X,a,C,ce,I,$e="Ancestral sampling with Euler method steps.",de,q,De=`This model inherits from <a href="/docs/diffusers/v0.28.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/v0.28.2/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,L,ue,N,Ee=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the | |
| current timestep. Scales the denoising model input by <code>(sigma**2 + 1) ** 0.5</code> to match the Euler algorithm.`,pe,$,P,fe,V,Se="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",he,D,O,me,U,Ae="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",ge,E,M,_e,F,Te=`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).`,Y,k,we="## EulerAncestralDiscreteSchedulerOutput[[diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput]]",Z,p,z,be,R,ye="Output class for the scheduler’s <code>step</code> function output.",ee,H,te,W,re;return T=new Ce({props:{title:"EulerAncestralDiscreteScheduler",local:"eulerancestraldiscretescheduler",headingTag:"h1"}}),y=new Ce({props:{title:"EulerAncestralDiscreteScheduler",local:"diffusers.EulerAncestralDiscreteScheduler",headingTag:"h2"}}),C=new j({props:{name:"class diffusers.EulerAncestralDiscreteScheduler",anchor:"diffusers.EulerAncestralDiscreteScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.0001"},{name:"beta_end",val:": float = 0.02"},{name:"beta_schedule",val:": str = 'linear'"},{name:"trained_betas",val:": Union = None"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"timestep_spacing",val:": str = 'linspace'"},{name:"steps_offset",val:": int = 0"},{name:"rescale_betas_zero_snr",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.EulerAncestralDiscreteScheduler.num_train_timesteps",description:`<strong>num_train_timesteps</strong> (<code>int</code>, defaults to 1000) — | |
| The number of diffusion steps to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.beta_start",description:`<strong>beta_start</strong> (<code>float</code>, defaults to 0.0001) — | |
| The starting <code>beta</code> value of inference.`,name:"beta_start"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.beta_end",description:`<strong>beta_end</strong> (<code>float</code>, defaults to 0.02) — | |
| The final <code>beta</code> value.`,name:"beta_end"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.beta_schedule",description:`<strong>beta_schedule</strong> (<code>str</code>, defaults to <code>"linear"</code>) — | |
| The beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from | |
| <code>linear</code> or <code>scaled_linear</code>.`,name:"beta_schedule"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.trained_betas",description:`<strong>trained_betas</strong> (<code>np.ndarray</code>, <em>optional</em>) — | |
| Pass an array of betas directly to the constructor to bypass <code>beta_start</code> and <code>beta_end</code>.`,name:"trained_betas"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, defaults to <code>epsilon</code>, <em>optional</em>) — | |
| Prediction type of the scheduler function; can be <code>epsilon</code> (predicts the noise of the diffusion process), | |
| <code>sample</code> (directly predicts the noisy sample<code>) or </code>v_prediction\` (see section 2.4 of <a href="https://imagen.research.google/video/paper.pdf" rel="nofollow">Imagen | |
| Video</a> paper).`,name:"prediction_type"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.timestep_spacing",description:`<strong>timestep_spacing</strong> (<code>str</code>, defaults to <code>"linspace"</code>) — | |
| 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.EulerAncestralDiscreteScheduler.steps_offset",description:`<strong>steps_offset</strong> (<code>int</code>, defaults to 0) — | |
| An offset added to the inference steps, as required by some model families.`,name:"steps_offset"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.rescale_betas_zero_snr",description:`<strong>rescale_betas_zero_snr</strong> (<code>bool</code>, defaults to <code>False</code>) — | |
| Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and | |
| dark samples instead of limiting it to samples with medium brightness. Loosely related to | |
| <a href="https://github.com/huggingface/diffusers/blob/74fd735eb073eb1d774b1ab4154a0876eb82f055/examples/dreambooth/train_dreambooth.py#L506" rel="nofollow"><code>--offset_noise</code></a>.`,name:"rescale_betas_zero_snr"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.2/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py#L132"}}),L=new j({props:{name:"scale_model_input",anchor:"diffusers.EulerAncestralDiscreteScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": Union"}],parametersDescription:[{anchor:"diffusers.EulerAncestralDiscreteScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) — | |
| The input sample.`,name:"sample"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.scale_model_input.timestep",description:`<strong>timestep</strong> (<code>int</code>, <em>optional</em>) — | |
| The current timestep in the diffusion chain.`,name:"timestep"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.2/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py#L253",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.Tensor</code></p> | |
| `}}),P=new j({props:{name:"set_begin_index",anchor:"diffusers.EulerAncestralDiscreteScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.EulerAncestralDiscreteScheduler.set_begin_index.begin_index",description:`<strong>begin_index</strong> (<code>int</code>) — | |
| The begin index for the scheduler.`,name:"begin_index"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.2/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py#L243"}}),O=new j({props:{name:"set_timesteps",anchor:"diffusers.EulerAncestralDiscreteScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": Union = None"}],parametersDescription:[{anchor:"diffusers.EulerAncestralDiscreteScheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) — | |
| The number of diffusion steps used when generating samples with a pre-trained model.`,name:"num_inference_steps"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, <em>optional</em>) — | |
| 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.28.2/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py#L277"}}),M=new j({props:{name:"step",anchor:"diffusers.EulerAncestralDiscreteScheduler.step",parameters:[{name:"model_output",val:": Tensor"},{name:"timestep",val:": Union"},{name:"sample",val:": Tensor"},{name:"generator",val:": Optional = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.EulerAncestralDiscreteScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.Tensor</code>) — | |
| The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code>) — | |
| The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) — | |
| A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.step.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A random number generator.`,name:"generator"},{anchor:"diffusers.EulerAncestralDiscreteScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) — | |
| Whether or not to return a | |
| <a href="/docs/diffusers/v0.28.2/en/api/schedulers/euler_ancestral#diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput">EulerAncestralDiscreteSchedulerOutput</a> or tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.2/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py#L345",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If return_dict is <code>True</code>, | |
| <a | |
| href="/docs/diffusers/v0.28.2/en/api/schedulers/euler_ancestral#diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput" | |
| >EulerAncestralDiscreteSchedulerOutput</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/v0.28.2/en/api/schedulers/euler_ancestral#diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput" | |
| >EulerAncestralDiscreteSchedulerOutput</a> or <code>tuple</code></p> | |
| `}}),z=new j({props:{name:"class diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput",anchor:"diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput",parameters:[{name:"prev_sample",val:": Tensor"},{name:"pred_original_sample",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput.prev_sample",description:`<strong>prev_sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) — | |
| Computed sample <code>(x_{t-1})</code> of previous timestep. <code>prev_sample</code> should be used as next model input in the | |
| denoising loop.`,name:"prev_sample"},{anchor:"diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteSchedulerOutput.pred_original_sample",description:`<strong>pred_original_sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) — | |
| The predicted denoised sample <code>(x_{0})</code> based on the model output from the current timestep. | |
| <code>pred_original_sample</code> can be used to preview progress or for guidance.`,name:"pred_original_sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.2/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py#L31"}}),H=new He({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/euler_ancestral.md"}}),{c(){u=i("meta"),K=n(),G=i("p"),B=n(),f(T.$$.fragment),J=n(),w=i("p"),w.innerHTML=xe,Q=n(),f(y.$$.fragment),X=n(),a=i("div"),f(C.$$.fragment),ce=n(),I=i("p"),I.textContent=$e,de=n(),q=i("p"),q.innerHTML=De,le=n(),x=i("div"),f(L.$$.fragment),ue=n(),N=i("p"),N.innerHTML=Ee,pe=n(),$=i("div"),f(P.$$.fragment),fe=n(),V=i("p"),V.textContent=Se,he=n(),D=i("div"),f(O.$$.fragment),me=n(),U=i("p"),U.textContent=Ae,ge=n(),E=i("div"),f(M.$$.fragment),_e=n(),F=i("p"),F.textContent=Te,Y=n(),k=i("p"),k.textContent=we,Z=n(),p=i("div"),f(z.$$.fragment),be=n(),R=i("p"),R.innerHTML=ye,ee=n(),f(H.$$.fragment),te=n(),W=i("p"),this.h()},l(e){const s=ze("svelte-u9bgzb",document.head);u=c(s,"META",{name:!0,content:!0}),s.forEach(t),K=o(e),G=c(e,"P",{}),S(G).forEach(t),B=o(e),h(T.$$.fragment,e),J=o(e),w=c(e,"P",{"data-svelte-h":!0}),m(w)!=="svelte-mxywa3"&&(w.innerHTML=xe),Q=o(e),h(y.$$.fragment,e),X=o(e),a=c(e,"DIV",{class:!0});var l=S(a);h(C.$$.fragment,l),ce=o(l),I=c(l,"P",{"data-svelte-h":!0}),m(I)!=="svelte-15vtfhh"&&(I.textContent=$e),de=o(l),q=c(l,"P",{"data-svelte-h":!0}),m(q)!=="svelte-5jztmt"&&(q.innerHTML=De),le=o(l),x=c(l,"DIV",{class:!0});var se=S(x);h(L.$$.fragment,se),ue=o(se),N=c(se,"P",{"data-svelte-h":!0}),m(N)!=="svelte-1hew89w"&&(N.innerHTML=Ee),se.forEach(t),pe=o(l),$=c(l,"DIV",{class:!0});var ne=S($);h(P.$$.fragment,ne),fe=o(ne),V=c(ne,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1k141rk"&&(V.textContent=Se),ne.forEach(t),he=o(l),D=c(l,"DIV",{class:!0});var oe=S(D);h(O.$$.fragment,oe),me=o(oe),U=c(oe,"P",{"data-svelte-h":!0}),m(U)!=="svelte-1vzm9q"&&(U.textContent=Ae),oe.forEach(t),ge=o(l),E=c(l,"DIV",{class:!0});var ae=S(E);h(M.$$.fragment,ae),_e=o(ae),F=c(ae,"P",{"data-svelte-h":!0}),m(F)!=="svelte-hi84tp"&&(F.textContent=Te),ae.forEach(t),l.forEach(t),Y=o(e),k=c(e,"P",{"data-svelte-h":!0}),m(k)!=="svelte-wd1bu5"&&(k.textContent=we),Z=o(e),p=c(e,"DIV",{class:!0});var ie=S(p);h(z.$$.fragment,ie),be=o(ie),R=c(ie,"P",{"data-svelte-h":!0}),m(R)!=="svelte-id9kic"&&(R.innerHTML=ye),ie.forEach(t),ee=o(e),h(H.$$.fragment,e),te=o(e),W=c(e,"P",{}),S(W).forEach(t),this.h()},h(){A(u,"name","hf:doc:metadata"),A(u,"content",qe),A(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(p,"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,s){r(document.head,u),d(e,K,s),d(e,G,s),d(e,B,s),g(T,e,s),d(e,J,s),d(e,w,s),d(e,Q,s),g(y,e,s),d(e,X,s),d(e,a,s),g(C,a,null),r(a,ce),r(a,I),r(a,de),r(a,q),r(a,le),r(a,x),g(L,x,null),r(x,ue),r(x,N),r(a,pe),r(a,$),g(P,$,null),r($,fe),r($,V),r(a,he),r(a,D),g(O,D,null),r(D,me),r(D,U),r(a,ge),r(a,E),g(M,E,null),r(E,_e),r(E,F),d(e,Y,s),d(e,k,s),d(e,Z,s),d(e,p,s),g(z,p,null),r(p,be),r(p,R),d(e,ee,s),g(H,e,s),d(e,te,s),d(e,W,s),re=!0},p:Pe,i(e){re||(_(T.$$.fragment,e),_(y.$$.fragment,e),_(C.$$.fragment,e),_(L.$$.fragment,e),_(P.$$.fragment,e),_(O.$$.fragment,e),_(M.$$.fragment,e),_(z.$$.fragment,e),_(H.$$.fragment,e),re=!0)},o(e){b(T.$$.fragment,e),b(y.$$.fragment,e),b(C.$$.fragment,e),b(L.$$.fragment,e),b(P.$$.fragment,e),b(O.$$.fragment,e),b(M.$$.fragment,e),b(z.$$.fragment,e),b(H.$$.fragment,e),re=!1},d(e){e&&(t(K),t(G),t(B),t(J),t(w),t(Q),t(X),t(a),t(Y),t(k),t(Z),t(p),t(ee),t(te),t(W)),t(u),v(T,e),v(y,e),v(C),v(L),v(P),v(O),v(M),v(z),v(H,e)}}}const qe='{"title":"EulerAncestralDiscreteScheduler","local":"eulerancestraldiscretescheduler","sections":[{"title":"EulerAncestralDiscreteScheduler","local":"diffusers.EulerAncestralDiscreteScheduler","sections":[],"depth":2}],"depth":1}';function Ne(ve){return Oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class je extends Me{constructor(u){super(),ke(this,u,Ne,Ie,Le,{})}}export{je as component}; | |
Xet Storage Details
- Size:
- 16.9 kB
- Xet hash:
- aef805a0f20206aac549b91626bf3ac289d8a6e8b683463fa7907fc785decbbc
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.