Buckets:
| import{s as we,n as Ce,o as ke}from"../chunks/scheduler.182ea377.js";import{S as Pe,i as Oe,g as a,s as o,r as f,A as Ee,h as d,f as t,c as i,j as D,u as m,x as T,k as H,y as s,a as l,v as h,d as g,t as _,w as b}from"../chunks/index.abf12888.js";import{D as j}from"../chunks/Docstring.93f6f462.js";import{H as _e}from"../chunks/Heading.16916d63.js";function Le(be){let u,R,K,W,y,G,w,ve='The Heun scheduler (Algorithm 1) is from the <a href="https://huggingface.co/papers/2206.00364" rel="nofollow">Elucidating the Design Space of Diffusion-Based Generative Models</a> paper by Karras et al. The scheduler is ported from the <a href="https://github.com/crowsonkb/k-diffusion" rel="nofollow">k-diffusion</a> library and created by <a href="https://github.com/crowsonkb/" rel="nofollow">Katherine Crowson</a>.',Y,C,J,n,k,ie,I,xe="Scheduler with Heun steps for discrete beta schedules.",ae,q,$e=`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.`,de,v,P,ce,V,Se=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the | |
| current timestep.`,le,x,O,ue,U,De="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",pe,$,E,fe,A,Te="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",me,S,L,he,N,He=`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,M,X,p,F,ge,z,ye="Base class for the output of a scheduler’s <code>step</code> function.",Z,B,ee;return y=new _e({props:{title:"HeunDiscreteScheduler",local:"heundiscretescheduler",headingTag:"h1"}}),C=new _e({props:{title:"HeunDiscreteScheduler",local:"diffusers.HeunDiscreteScheduler",headingTag:"h2"}}),k=new j({props:{name:"class diffusers.HeunDiscreteScheduler",anchor:"diffusers.HeunDiscreteScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.00085"},{name:"beta_end",val:": float = 0.012"},{name:"beta_schedule",val:": str = 'linear'"},{name:"trained_betas",val:": Union = None"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"use_karras_sigmas",val:": Optional = False"},{name:"clip_sample",val:": Optional = False"},{name:"clip_sample_range",val:": float = 1.0"},{name:"timestep_spacing",val:": str = 'linspace'"},{name:"steps_offset",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.HeunDiscreteScheduler.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.HeunDiscreteScheduler.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.HeunDiscreteScheduler.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.HeunDiscreteScheduler.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.HeunDiscreteScheduler.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.HeunDiscreteScheduler.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.HeunDiscreteScheduler.clip_sample",description:`<strong>clip_sample</strong> (<code>bool</code>, defaults to <code>True</code>) — | |
| Clip the predicted sample for numerical stability.`,name:"clip_sample"},{anchor:"diffusers.HeunDiscreteScheduler.clip_sample_range",description:`<strong>clip_sample_range</strong> (<code>float</code>, defaults to 1.0) — | |
| The maximum magnitude for sample clipping. Valid only when <code>clip_sample=True</code>.`,name:"clip_sample_range"},{anchor:"diffusers.HeunDiscreteScheduler.use_karras_sigmas",description:`<strong>use_karras_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to use Karras sigmas for step sizes in the noise schedule during the sampling process. If <code>True</code>, | |
| the sigmas are determined according to a sequence of noise levels {σi}.`,name:"use_karras_sigmas"},{anchor:"diffusers.HeunDiscreteScheduler.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.HeunDiscreteScheduler.steps_offset",description:`<strong>steps_offset</strong> (<code>int</code>, defaults to 0) — | |
| An offset added to the inference steps. You can use a combination of <code>offset=1</code> and | |
| <code>set_alpha_to_one=False</code> to make the last step use step 0 for the previous alpha product like in Stable | |
| Diffusion.`,name:"steps_offset"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_heun_discrete.py#L70"}}),P=new j({props:{name:"scale_model_input",anchor:"diffusers.HeunDiscreteScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": Union"}],parametersDescription:[{anchor:"diffusers.HeunDiscreteScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) — | |
| The input sample.`,name:"sample"},{anchor:"diffusers.HeunDiscreteScheduler.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/main/src/diffusers/schedulers/scheduling_heun_discrete.py#L201",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> | |
| `}}),O=new j({props:{name:"set_begin_index",anchor:"diffusers.HeunDiscreteScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.HeunDiscreteScheduler.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/main/src/diffusers/schedulers/scheduling_heun_discrete.py#L191"}}),E=new j({props:{name:"set_timesteps",anchor:"diffusers.HeunDiscreteScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": Union = None"},{name:"num_train_timesteps",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.HeunDiscreteScheduler.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.HeunDiscreteScheduler.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/main/src/diffusers/schedulers/scheduling_heun_discrete.py#L227"}}),L=new j({props:{name:"step",anchor:"diffusers.HeunDiscreteScheduler.step",parameters:[{name:"model_output",val:": Union"},{name:"timestep",val:": Union"},{name:"sample",val:": Union"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.HeunDiscreteScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code>) — | |
| The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.HeunDiscreteScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code>) — | |
| The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.HeunDiscreteScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) — | |
| A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.HeunDiscreteScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.schedulers.scheduling_utils.SchedulerOutput">SchedulerOutput</a> or tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_heun_discrete.py#L354",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/multistep_dpm_solver#diffusers.schedulers.scheduling_utils.SchedulerOutput" | |
| >SchedulerOutput</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/multistep_dpm_solver#diffusers.schedulers.scheduling_utils.SchedulerOutput" | |
| >SchedulerOutput</a> or <code>tuple</code></p> | |
| `}}),M=new _e({props:{title:"SchedulerOutput",local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",headingTag:"h2"}}),F=new j({props:{name:"class diffusers.schedulers.scheduling_utils.SchedulerOutput",anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput",parameters:[{name:"prev_sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput.prev_sample",description:`<strong>prev_sample</strong> (<code>torch.FloatTensor</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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L50"}}),{c(){u=a("meta"),R=o(),K=a("p"),W=o(),f(y.$$.fragment),G=o(),w=a("p"),w.innerHTML=ve,Y=o(),f(C.$$.fragment),J=o(),n=a("div"),f(k.$$.fragment),ie=o(),I=a("p"),I.textContent=xe,ae=o(),q=a("p"),q.innerHTML=$e,de=o(),v=a("div"),f(P.$$.fragment),ce=o(),V=a("p"),V.textContent=Se,le=o(),x=a("div"),f(O.$$.fragment),ue=o(),U=a("p"),U.textContent=De,pe=o(),$=a("div"),f(E.$$.fragment),fe=o(),A=a("p"),A.textContent=Te,me=o(),S=a("div"),f(L.$$.fragment),he=o(),N=a("p"),N.textContent=He,Q=o(),f(M.$$.fragment),X=o(),p=a("div"),f(F.$$.fragment),ge=o(),z=a("p"),z.innerHTML=ye,Z=o(),B=a("p"),this.h()},l(e){const r=Ee("svelte-u9bgzb",document.head);u=d(r,"META",{name:!0,content:!0}),r.forEach(t),R=i(e),K=d(e,"P",{}),D(K).forEach(t),W=i(e),m(y.$$.fragment,e),G=i(e),w=d(e,"P",{"data-svelte-h":!0}),T(w)!=="svelte-1r9m54f"&&(w.innerHTML=ve),Y=i(e),m(C.$$.fragment,e),J=i(e),n=d(e,"DIV",{class:!0});var c=D(n);m(k.$$.fragment,c),ie=i(c),I=d(c,"P",{"data-svelte-h":!0}),T(I)!=="svelte-1k165jq"&&(I.textContent=xe),ae=i(c),q=d(c,"P",{"data-svelte-h":!0}),T(q)!=="svelte-linuuh"&&(q.innerHTML=$e),de=i(c),v=d(c,"DIV",{class:!0});var te=D(v);m(P.$$.fragment,te),ce=i(te),V=d(te,"P",{"data-svelte-h":!0}),T(V)!=="svelte-1rkfgpx"&&(V.textContent=Se),te.forEach(t),le=i(c),x=d(c,"DIV",{class:!0});var se=D(x);m(O.$$.fragment,se),ue=i(se),U=d(se,"P",{"data-svelte-h":!0}),T(U)!=="svelte-1k141rk"&&(U.textContent=De),se.forEach(t),pe=i(c),$=d(c,"DIV",{class:!0});var ne=D($);m(E.$$.fragment,ne),fe=i(ne),A=d(ne,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1vzm9q"&&(A.textContent=Te),ne.forEach(t),me=i(c),S=d(c,"DIV",{class:!0});var re=D(S);m(L.$$.fragment,re),he=i(re),N=d(re,"P",{"data-svelte-h":!0}),T(N)!=="svelte-hi84tp"&&(N.textContent=He),re.forEach(t),c.forEach(t),Q=i(e),m(M.$$.fragment,e),X=i(e),p=d(e,"DIV",{class:!0});var oe=D(p);m(F.$$.fragment,oe),ge=i(oe),z=d(oe,"P",{"data-svelte-h":!0}),T(z)!=="svelte-6ojmkw"&&(z.innerHTML=ye),oe.forEach(t),Z=i(e),B=d(e,"P",{}),D(B).forEach(t),this.h()},h(){H(u,"name","hf:doc:metadata"),H(u,"content",Me),H(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(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,r){s(document.head,u),l(e,R,r),l(e,K,r),l(e,W,r),h(y,e,r),l(e,G,r),l(e,w,r),l(e,Y,r),h(C,e,r),l(e,J,r),l(e,n,r),h(k,n,null),s(n,ie),s(n,I),s(n,ae),s(n,q),s(n,de),s(n,v),h(P,v,null),s(v,ce),s(v,V),s(n,le),s(n,x),h(O,x,null),s(x,ue),s(x,U),s(n,pe),s(n,$),h(E,$,null),s($,fe),s($,A),s(n,me),s(n,S),h(L,S,null),s(S,he),s(S,N),l(e,Q,r),h(M,e,r),l(e,X,r),l(e,p,r),h(F,p,null),s(p,ge),s(p,z),l(e,Z,r),l(e,B,r),ee=!0},p:Ce,i(e){ee||(g(y.$$.fragment,e),g(C.$$.fragment,e),g(k.$$.fragment,e),g(P.$$.fragment,e),g(O.$$.fragment,e),g(E.$$.fragment,e),g(L.$$.fragment,e),g(M.$$.fragment,e),g(F.$$.fragment,e),ee=!0)},o(e){_(y.$$.fragment,e),_(C.$$.fragment,e),_(k.$$.fragment,e),_(P.$$.fragment,e),_(O.$$.fragment,e),_(E.$$.fragment,e),_(L.$$.fragment,e),_(M.$$.fragment,e),_(F.$$.fragment,e),ee=!1},d(e){e&&(t(R),t(K),t(W),t(G),t(w),t(Y),t(J),t(n),t(Q),t(X),t(p),t(Z),t(B)),t(u),b(y,e),b(C,e),b(k),b(P),b(O),b(E),b(L),b(M,e),b(F)}}}const Me='{"title":"HeunDiscreteScheduler","local":"heundiscretescheduler","sections":[{"title":"HeunDiscreteScheduler","local":"diffusers.HeunDiscreteScheduler","sections":[],"depth":2},{"title":"SchedulerOutput","local":"diffusers.schedulers.scheduling_utils.SchedulerOutput","sections":[],"depth":2}],"depth":1}';function Fe(be){return ke(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ae extends Pe{constructor(u){super(),Oe(this,u,Fe,Le,we,{})}}export{Ae as component}; | |
Xet Storage Details
- Size:
- 15.7 kB
- Xet hash:
- ab1c51bc47fd1f735208f6195af4233f163d9c62649333e8ce6c0feab4e27ca4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.