import{S as Kh,i as Hh,s as Ch,e as r,k as d,w,t as l,M as Fh,c as s,d as t,m as h,a as o,x as S,h as n,b as i,G as e,g as f,y,q as $,o as D,B as T,v as Wh}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Gh}from"../../../chunks/Tip-hf-doc-builder.js";import{D as Gs}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as ee}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Uh(vt){let m,M,v,b,P,_,x,N;return{c(){m=r("p"),M=l("It is required to be logged in ("),v=r("code"),b=l("huggingface-cli login"),P=l(") when you want to use private or "),_=r("a"),x=l(`gated
models`),N=l("."),this.h()},l(K){m=s(K,"P",{});var k=o(m);M=n(k,"It is required to be logged in ("),v=s(k,"CODE",{});var H=o(v);b=n(H,"huggingface-cli login"),H.forEach(t),P=n(k,") when you want to use private or "),_=s(k,"A",{href:!0,rel:!0});var _t=o(_);x=n(_t,`gated
models`),_t.forEach(t),N=n(k,"."),k.forEach(t),this.h()},h(){i(_,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),i(_,"rel","nofollow")},m(K,k){f(K,m,k),e(m,M),e(m,v),e(v,b),e(m,P),e(m,_),e(_,x),e(m,N)},d(K){K&&t(m)}}}function Jh(vt){let m,M,v,b,P;return{c(){m=r("p"),M=l("Activate the special "),v=r("a"),b=l("\u201Coffline-mode\u201D"),P=l(` to
use this method in a firewalled environment.`),this.h()},l(_){m=s(_,"P",{});var x=o(m);M=n(x,"Activate the special "),v=s(x,"A",{href:!0,rel:!0});var N=o(v);b=n(N,"\u201Coffline-mode\u201D"),N.forEach(t),P=n(x,` to
use this method in a firewalled environment.`),x.forEach(t),this.h()},h(){i(v,"href","https://huggingface.co/transformers/installation.html#offline-mode"),i(v,"rel","nofollow")},m(_,x){f(_,m,x),e(m,M),e(m,v),e(v,b),e(m,P)},d(_){_&&t(m)}}}function zh(vt){let m,M,v,b,P,_,x,N,K,k,H,_t,Ks,C,te,Yt,ve,Wo,Xt,Uo,Hs,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s,bn,wn,Ds,Sn,yn,Ts,G,xs,$n,Dn,As,Tn,xn,Ps,An,Pn,kn,O,nt,Mn,ks,Nn,On,he,Rn,ce,Ln,fe,it,In,j,qn,Ms,Vn,Gn,Ut,Kn,Hn,so,Q,ue,Ns,dt,Cn,Os,Fn,oo,Y,ht,Wn,Rs,Un,ao,X,pe,Ls,ct,Jn,Is,zn,lo,Z,ft,Bn,qs,jn,no;return _=new ee({}),ve=new ee({}),ge=new ee({}),Ee=new ee({}),be=new ee({}),rt=new ee({}),at=new ee({}),lt=new Gs({props:{name:"class diffusers.SchedulerMixin",anchor:"diffusers.SchedulerMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L57"}}),nt=new Gs({props:{name:"from_pretrained",anchor:"diffusers.SchedulerMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Dict[str, typing.Any] = None"},{name:"subfolder",val:": typing.Optional[str] = None"},{name:"return_unused_kwargs",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.SchedulerMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a model repo on huggingface.co. Valid model ids should have an
organization name, like <code>google/ddpm-celebahq-256</code>.</li>
<li>A path to a <em>directory</em> containing the schedluer configurations saved using
<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained">save_pretrained()</a>, e.g., <code>./my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.SchedulerMixin.from_pretrained.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.SchedulerMixin.from_pretrained.return_unused_kwargs",description:`<strong>return_unused_kwargs</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether kwargs that are not consumed by the Python class should be returned or not.`,name:"return_unused_kwargs"},{anchor:"diffusers.SchedulerMixin.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.SchedulerMixin.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.SchedulerMixin.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.SchedulerMixin.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.SchedulerMixin.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.SchedulerMixin.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.SchedulerMixin.from_pretrained.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>transformers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.SchedulerMixin.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L71"}}),he=new Gh({props:{$$slots:{default:[Uh]},$$scope:{ctx:vt}}}),ce=new Gh({props:{$$slots:{default:[Jh]},$$scope:{ctx:vt}}}),it=new Gs({props:{name:"save_pretrained",anchor:"diffusers.SchedulerMixin.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.SchedulerMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the configuration JSON file will be saved (will be created if it does not exist).`,name:"save_directory"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L142"}}),dt=new ee({}),ht=new Gs({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) &#x2014;
Computed sample (x_{t-1}) 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#L44"}}),ct=new ee({}),ft=new Gs({props:{name:"class diffusers.schedulers.KarrasDiffusionSchedulers",anchor:"diffusers.schedulers.KarrasDiffusionSchedulers",parameters:[{name:"value",val:""},{name:"names",val:" = None"},{name:"module",val:" = None"},{name:"qualname",val:" = None"},{name:"type",val:" = None"},{name:"start",val:" = 1"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L28"}}),{c(){m=r("meta"),M=d(),v=r("h1"),b=r("a"),P=r("span"),w(_.$$.fragment),x=d(),N=r("span"),K=l("Schedulers"),k=d(),H=r("p"),_t=l("Diffusers contains multiple pre-built schedule functions for the diffusion process."),Ks=d(),C=r("h2"),te=r("a"),Yt=r("span"),w(ve.$$.fragment),Wo=d(),Xt=r("span"),Uo=l("What is a scheduler?"),Hs=d(),L=r("p"),Jo=l("The schedule functions, denoted "),Zt=r("em"),zo=l("Schedulers"),Bo=l(" in the library take in the output of a trained model, a sample which the diffusion process is iterating on, and a timestep to return a denoised sample. That\u2019s why schedulers may also be called "),er=r("em"),jo=l("Samplers"),Qo=l(" in other diffusion models implementations."),Cs=d(),re=r("ul"),gt=r("li"),Yo=l("Schedulers define the methodology for iteratively adding noise to an image or for updating a sample based on model outputs."),_e=r("ul"),tr=r("li"),Xo=l("adding noise in different manners represent the algorithmic processes to train a diffusion model by adding noise to images."),Zo=d(),rr=r("li"),ea=l("for inference, the scheduler defines how to update a sample based on an output from a pretrained model."),ta=d(),F=r("li"),ra=l("Schedulers are often defined by a "),sr=r("em"),sa=l("noise schedule"),oa=l(" and an "),or=r("em"),aa=l("update rule"),la=l(" to solve the differential equation solution."),Fs=d(),W=r("h3"),se=r("a"),ar=r("span"),w(ge.$$.fragment),na=d(),lr=r("span"),ia=l("Discrete versus continuous schedulers"),Ws=d(),g=r("p"),da=l(`All schedulers take in a timestep to predict the updated version of the sample being diffused.
The timesteps dictate where in the diffusion process the step is, where data is generated by iterating forward in time and inference is executed by propagating backwards through timesteps.
Different algorithms use timesteps that can be discrete (accepting `),nr=r("code"),ha=l("int"),ca=l(" inputs), such as the "),Et=r("a"),fa=l("DDPMScheduler"),ua=l(" or "),bt=r("a"),pa=l("PNDMScheduler"),ma=l(", or continuous (accepting "),ir=r("code"),va=l("float"),_a=l(" inputs), such as the score-based schedulers "),wt=r("a"),ga=l("ScoreSdeVeScheduler"),Ea=l(" or "),dr=r("code"),ba=l("ScoreSdeVpScheduler"),wa=l("."),Us=d(),U=r("h2"),oe=r("a"),hr=r("span"),w(Ee.$$.fragment),Sa=d(),cr=r("span"),ya=l("Designing Re-usable schedulers"),Js=d(),St=r("p"),$a=l(`The core design principle between the schedule functions is to be model, system, and framework independent.
This allows for rapid experimentation and cleaner abstractions in the code, where the model prediction is separated from the sample update.
To this end, the design of schedulers is such that:`),zs=d(),I=r("ul"),fr=r("li"),Da=l("Schedulers can be used interchangeably between diffusion models in inference to find the preferred trade-off between speed and generation quality."),Ta=d(),ur=r("li"),xa=l("Schedulers are currently by default in PyTorch, but are designed to be framework independent (partial Jax support currently exists)."),Aa=d(),q=r("li"),Pa=l("Many diffusion pipelines, such as "),yt=r("a"),ka=l("StableDiffusionPipeline"),Ma=l(" and "),$t=r("a"),Na=l("DiTPipeline"),Oa=l(" can use any of "),pr=r("code"),Ra=l("KarrasDiffusionSchedulers"),Bs=d(),J=r("h2"),ae=r("a"),mr=r("span"),w(be.$$.fragment),La=d(),vr=r("span"),Ia=l("Schedulers Summary"),js=d(),Dt=r("p"),qa=l("The following table summarizes all officially supported schedulers, their corresponding paper"),Qs=d(),le=r("table"),_r=r("thead"),we=r("tr"),gr=r("th"),Va=l("Scheduler"),Ga=d(),Er=r("th"),Ka=l("Paper"),Ha=d(),u=r("tbody"),Se=r("tr"),br=r("td"),Tt=r("a"),Ca=l("ddim"),Fa=d(),wr=r("td"),ye=r("a"),Sr=r("strong"),Wa=l("Denoising Diffusion Implicit Models"),Ua=d(),$e=r("tr"),yr=r("td"),xt=r("a"),Ja=l("ddpm"),za=d(),$r=r("td"),De=r("a"),Dr=r("strong"),Ba=l("Denoising Diffusion Probabilistic Models"),ja=d(),Te=r("tr"),Tr=r("td"),At=r("a"),Qa=l("singlestep_dpm_solver"),Ya=d(),xr=r("td"),xe=r("a"),Ar=r("strong"),Xa=l("Singlestep DPM-Solver"),Za=d(),Ae=r("tr"),Pr=r("td"),Pt=r("a"),el=l("multistep_dpm_solver"),tl=d(),kr=r("td"),Pe=r("a"),Mr=r("strong"),rl=l("Multistep DPM-Solver"),sl=d(),ke=r("tr"),Nr=r("td"),kt=r("a"),ol=l("heun"),al=d(),Or=r("td"),Me=r("a"),Rr=r("strong"),ll=l("Heun scheduler inspired by Karras et. al paper"),nl=d(),Ne=r("tr"),Lr=r("td"),Mt=r("a"),il=l("dpm_discrete"),dl=d(),Ir=r("td"),Oe=r("a"),qr=r("strong"),hl=l("DPM Discrete Scheduler inspired by Karras et. al paper"),cl=d(),Re=r("tr"),Vr=r("td"),Nt=r("a"),fl=l("dpm_discrete_ancestral"),ul=d(),Gr=r("td"),Le=r("a"),Kr=r("strong"),pl=l("DPM Discrete Scheduler with ancestral sampling inspired by Karras et. al paper"),ml=d(),Ie=r("tr"),Hr=r("td"),Ot=r("a"),vl=l("stochastic_karras_ve"),_l=d(),Cr=r("td"),qe=r("a"),Fr=r("strong"),gl=l("Variance exploding, stochastic sampling from Karras et. al"),El=d(),Ve=r("tr"),Wr=r("td"),Rt=r("a"),bl=l("lms_discrete"),wl=d(),Ur=r("td"),Ge=r("a"),Jr=r("strong"),Sl=l("Linear multistep scheduler for discrete beta schedules"),yl=d(),Ke=r("tr"),zr=r("td"),Lt=r("a"),$l=l("pndm"),Dl=d(),Br=r("td"),He=r("a"),jr=r("strong"),Tl=l("Pseudo numerical methods for diffusion models (PNDM)"),xl=d(),Ce=r("tr"),Qr=r("td"),It=r("a"),Al=l("score_sde_ve"),Pl=d(),Yr=r("td"),Fe=r("a"),Xr=r("strong"),kl=l("variance exploding stochastic differential equation (VE-SDE) scheduler"),Ml=d(),We=r("tr"),Zr=r("td"),qt=r("a"),Nl=l("ipndm"),Ol=d(),es=r("td"),Ue=r("a"),ts=r("strong"),Rl=l("improved pseudo numerical methods for diffusion models (iPNDM)"),Ll=d(),Je=r("tr"),rs=r("td"),Vt=r("a"),Il=l("score_sde_vp"),ql=d(),ss=r("td"),ze=r("a"),os=r("strong"),Vl=l("Variance preserving stochastic differential equation (VP-SDE) scheduler"),Gl=d(),Be=r("tr"),as=r("td"),Gt=r("a"),Kl=l("euler"),Hl=d(),ls=r("td"),je=r("a"),ns=r("strong"),Cl=l("Euler scheduler"),Fl=d(),Qe=r("tr"),is=r("td"),Kt=r("a"),Wl=l("euler_ancestral"),Ul=d(),ds=r("td"),Ye=r("a"),hs=r("strong"),Jl=l("Euler Ancestral scheduler"),zl=d(),Xe=r("tr"),cs=r("td"),Ht=r("a"),Bl=l("vq_diffusion"),jl=d(),fs=r("td"),Ze=r("a"),us=r("strong"),Ql=l("VQDiffusionScheduler"),Yl=d(),et=r("tr"),ps=r("td"),Ct=r("a"),Xl=l("repaint"),Zl=d(),ms=r("td"),tt=r("a"),vs=r("strong"),en=l("RePaint scheduler"),Ys=d(),z=r("h2"),ne=r("a"),_s=r("span"),w(rt.$$.fragment),tn=d(),gs=r("span"),rn=l("API"),Xs=d(),Ft=r("p"),sn=l("The core API for any new scheduler must follow a limited structure."),Zs=d(),V=r("ul"),st=r("li"),on=l("Schedulers should provide one or more "),Es=r("code"),an=l("def step(...)"),ln=l(" functions that should be called to update the generated sample iteratively."),nn=d(),ot=r("li"),dn=l("Schedulers should provide a "),bs=r("code"),hn=l("set_timesteps(...)"),cn=l(" method that configures the parameters of a schedule function for a specific inference task."),fn=d(),ws=r("li"),un=l("Schedulers should be framework-specific."),eo=d(),ie=r("p"),pn=l("The base class "),Wt=r("a"),mn=l("SchedulerMixin"),vn=l(" implements low level utilities used by multiple schedulers."),to=d(),B=r("h3"),de=r("a"),Ss=r("span"),w(at.$$.fragment),_n=d(),ys=r("span"),gn=l("SchedulerMixin"),ro=d(),E=r("div"),w(lt.$$.fragment),En=d(),$s=r("p"),bn=l("Mixin containing common functions for the schedulers."),wn=d(),Ds=r("p"),Sn=l("Class attributes:"),yn=d(),Ts=r("ul"),G=r("li"),xs=r("strong"),$n=l("_compatibles"),Dn=l(" ("),As=r("code"),Tn=l("List[str]"),xn=l(`) \u2014 A list of classes that are compatible with the parent class, so that
`),Ps=r("code"),An=l("from_config"),Pn=l(` can be used from a class different than the one used to save the config (should be overridden
by parent class).`),kn=d(),O=r("div"),w(nt.$$.fragment),Mn=d(),ks=r("p"),Nn=l("Instantiate a Scheduler class from a pre-defined JSON configuration file inside a directory or Hub repo."),On=d(),w(he.$$.fragment),Rn=d(),w(ce.$$.fragment),Ln=d(),fe=r("div"),w(it.$$.fragment),In=d(),j=r("p"),qn=l("Save a scheduler configuration object to the directory "),Ms=r("code"),Vn=l("save_directory"),Gn=l(`, so that it can be re-loaded using the
`),Ut=r("a"),Kn=l("from_pretrained()"),Hn=l(" class method."),so=d(),Q=r("h3"),ue=r("a"),Ns=r("span"),w(dt.$$.fragment),Cn=d(),Os=r("span"),Fn=l("SchedulerOutput"),oo=l("\n\nThe class `SchedulerOutput` contains the outputs from any schedulers `step(...)` call.\n"),Y=r("div"),w(ht.$$.fragment),Wn=d(),Rs=r("p"),Un=l("Base class for the scheduler\u2019s step function output."),ao=d(),X=r("h3"),pe=r("a"),Ls=r("span"),w(ct.$$.fragment),Jn=d(),Is=r("span"),zn=l("KarrasDiffusionSchedulers"),lo=d(),Z=r("div"),w(ft.$$.fragment),Bn=d(),qs=r("p"),jn=l("An enumeration."),this.h()},l(a){const c=Fh('[data-svelte="svelte-1phssyn"]',document.head);m=s(c,"META",{name:!0,content:!0}),c.forEach(t),M=h(a),v=s(a,"H1",{class:!0});var ut=o(v);b=s(ut,"A",{id:!0,class:!0,href:!0});var Vs=o(b);P=s(Vs,"SPAN",{});var Yn=o(P);S(_.$$.fragment,Yn),Yn.forEach(t),Vs.forEach(t),x=h(ut),N=s(ut,"SPAN",{});var Xn=o(N);K=n(Xn,"Schedulers"),Xn.forEach(t),ut.forEach(t),k=h(a),H=s(a,"P",{});var Zn=o(H);_t=n(Zn,"Diffusers contains multiple pre-built schedule functions for the diffusion process."),Zn.forEach(t),Ks=h(a),C=s(a,"H2",{class:!0});var io=o(C);te=s(io,"A",{id:!0,class:!0,href:!0});var ei=o(te);Yt=s(ei,"SPAN",{});var ti=o(Yt);S(ve.$$.fragment,ti),ti.forEach(t),ei.forEach(t),Wo=h(io),Xt=s(io,"SPAN",{});var ri=o(Xt);Uo=n(ri,"What is a scheduler?"),ri.forEach(t),io.forEach(t),Hs=h(a),L=s(a,"P",{});var Jt=o(L);Jo=n(Jt,"The schedule functions, denoted "),Zt=s(Jt,"EM",{});var si=o(Zt);zo=n(si,"Schedulers"),si.forEach(t),Bo=n(Jt," in the library take in the output of a trained model, a sample which the diffusion process is iterating on, and a timestep to return a denoised sample. That\u2019s why schedulers may also be called "),er=s(Jt,"EM",{});var oi=o(er);jo=n(oi,"Samplers"),oi.forEach(t),Qo=n(Jt," in other diffusion models implementations."),Jt.forEach(t),Cs=h(a),re=s(a,"UL",{});var ho=o(re);gt=s(ho,"LI",{});var Qn=o(gt);Yo=n(Qn,"Schedulers define the methodology for iteratively adding noise to an image or for updating a sample based on model outputs."),_e=s(Qn,"UL",{});var co=o(_e);tr=s(co,"LI",{});var ai=o(tr);Xo=n(ai,"adding noise in different manners represent the algorithmic processes to train a diffusion model by adding noise to images."),ai.forEach(t),Zo=h(co),rr=s(co,"LI",{});var li=o(rr);ea=n(li,"for inference, the scheduler defines how to update a sample based on an output from a pretrained model."),li.forEach(t),co.forEach(t),Qn.forEach(t),ta=h(ho),F=s(ho,"LI",{});var zt=o(F);ra=n(zt,"Schedulers are often defined by a "),sr=s(zt,"EM",{});var ni=o(sr);sa=n(ni,"noise schedule"),ni.forEach(t),oa=n(zt," and an "),or=s(zt,"EM",{});var ii=o(or);aa=n(ii,"update rule"),ii.forEach(t),la=n(zt," to solve the differential equation solution."),zt.forEach(t),ho.forEach(t),Fs=h(a),W=s(a,"H3",{class:!0});var fo=o(W);se=s(fo,"A",{id:!0,class:!0,href:!0});var di=o(se);ar=s(di,"SPAN",{});var hi=o(ar);S(ge.$$.fragment,hi),hi.forEach(t),di.forEach(t),na=h(fo),lr=s(fo,"SPAN",{});var ci=o(lr);ia=n(ci,"Discrete versus continuous schedulers"),ci.forEach(t),fo.forEach(t),Ws=h(a),g=s(a,"P",{});var A=o(g);da=n(A,`All schedulers take in a timestep to predict the updated version of the sample being diffused.
The timesteps dictate where in the diffusion process the step is, where data is generated by iterating forward in time and inference is executed by propagating backwards through timesteps.
Different algorithms use timesteps that can be discrete (accepting `),nr=s(A,"CODE",{});var fi=o(nr);ha=n(fi,"int"),fi.forEach(t),ca=n(A," inputs), such as the "),Et=s(A,"A",{href:!0});var ui=o(Et);fa=n(ui,"DDPMScheduler"),ui.forEach(t),ua=n(A," or "),bt=s(A,"A",{href:!0});var pi=o(bt);pa=n(pi,"PNDMScheduler"),pi.forEach(t),ma=n(A,", or continuous (accepting "),ir=s(A,"CODE",{});var mi=o(ir);va=n(mi,"float"),mi.forEach(t),_a=n(A," inputs), such as the score-based schedulers "),wt=s(A,"A",{href:!0});var vi=o(wt);ga=n(vi,"ScoreSdeVeScheduler"),vi.forEach(t),Ea=n(A," or "),dr=s(A,"CODE",{});var _i=o(dr);ba=n(_i,"ScoreSdeVpScheduler"),_i.forEach(t),wa=n(A,"."),A.forEach(t),Us=h(a),U=s(a,"H2",{class:!0});var uo=o(U);oe=s(uo,"A",{id:!0,class:!0,href:!0});var gi=o(oe);hr=s(gi,"SPAN",{});var Ei=o(hr);S(Ee.$$.fragment,Ei),Ei.forEach(t),gi.forEach(t),Sa=h(uo),cr=s(uo,"SPAN",{});var bi=o(cr);ya=n(bi,"Designing Re-usable schedulers"),bi.forEach(t),uo.forEach(t),Js=h(a),St=s(a,"P",{});var wi=o(St);$a=n(wi,`The core design principle between the schedule functions is to be model, system, and framework independent.
This allows for rapid experimentation and cleaner abstractions in the code, where the model prediction is separated from the sample update.
To this end, the design of schedulers is such that:`),wi.forEach(t),zs=h(a),I=s(a,"UL",{});var Bt=o(I);fr=s(Bt,"LI",{});var Si=o(fr);Da=n(Si,"Schedulers can be used interchangeably between diffusion models in inference to find the preferred trade-off between speed and generation quality."),Si.forEach(t),Ta=h(Bt),ur=s(Bt,"LI",{});var yi=o(ur);xa=n(yi,"Schedulers are currently by default in PyTorch, but are designed to be framework independent (partial Jax support currently exists)."),yi.forEach(t),Aa=h(Bt),q=s(Bt,"LI",{});var pt=o(q);Pa=n(pt,"Many diffusion pipelines, such as "),yt=s(pt,"A",{href:!0});var $i=o(yt);ka=n($i,"StableDiffusionPipeline"),$i.forEach(t),Ma=n(pt," and "),$t=s(pt,"A",{href:!0});var Di=o($t);Na=n(Di,"DiTPipeline"),Di.forEach(t),Oa=n(pt," can use any of "),pr=s(pt,"CODE",{});var Ti=o(pr);Ra=n(Ti,"KarrasDiffusionSchedulers"),Ti.forEach(t),pt.forEach(t),Bt.forEach(t),Bs=h(a),J=s(a,"H2",{class:!0});var po=o(J);ae=s(po,"A",{id:!0,class:!0,href:!0});var xi=o(ae);mr=s(xi,"SPAN",{});var Ai=o(mr);S(be.$$.fragment,Ai),Ai.forEach(t),xi.forEach(t),La=h(po),vr=s(po,"SPAN",{});var Pi=o(vr);Ia=n(Pi,"Schedulers Summary"),Pi.forEach(t),po.forEach(t),js=h(a),Dt=s(a,"P",{});var ki=o(Dt);qa=n(ki,"The following table summarizes all officially supported schedulers, their corresponding paper"),ki.forEach(t),Qs=h(a),le=s(a,"TABLE",{});var mo=o(le);_r=s(mo,"THEAD",{});var Mi=o(_r);we=s(Mi,"TR",{});var vo=o(we);gr=s(vo,"TH",{});var Ni=o(gr);Va=n(Ni,"Scheduler"),Ni.forEach(t),Ga=h(vo),Er=s(vo,"TH",{});var Oi=o(Er);Ka=n(Oi,"Paper"),Oi.forEach(t),vo.forEach(t),Mi.forEach(t),Ha=h(mo),u=s(mo,"TBODY",{});var p=o(u);Se=s(p,"TR",{});var _o=o(Se);br=s(_o,"TD",{});var Ri=o(br);Tt=s(Ri,"A",{href:!0});var Li=o(Tt);Ca=n(Li,"ddim"),Li.forEach(t),Ri.forEach(t),Fa=h(_o),wr=s(_o,"TD",{});var Ii=o(wr);ye=s(Ii,"A",{href:!0,rel:!0});var qi=o(ye);Sr=s(qi,"STRONG",{});var Vi=o(Sr);Wa=n(Vi,"Denoising Diffusion Implicit Models"),Vi.forEach(t),qi.forEach(t),Ii.forEach(t),_o.forEach(t),Ua=h(p),$e=s(p,"TR",{});var go=o($e);yr=s(go,"TD",{});var Gi=o(yr);xt=s(Gi,"A",{href:!0});var Ki=o(xt);Ja=n(Ki,"ddpm"),Ki.forEach(t),Gi.forEach(t),za=h(go),$r=s(go,"TD",{});var Hi=o($r);De=s(Hi,"A",{href:!0,rel:!0});var Ci=o(De);Dr=s(Ci,"STRONG",{});var Fi=o(Dr);Ba=n(Fi,"Denoising Diffusion Probabilistic Models"),Fi.forEach(t),Ci.forEach(t),Hi.forEach(t),go.forEach(t),ja=h(p),Te=s(p,"TR",{});var Eo=o(Te);Tr=s(Eo,"TD",{});var Wi=o(Tr);At=s(Wi,"A",{href:!0});var Ui=o(At);Qa=n(Ui,"singlestep_dpm_solver"),Ui.forEach(t),Wi.forEach(t),Ya=h(Eo),xr=s(Eo,"TD",{});var Ji=o(xr);xe=s(Ji,"A",{href:!0,rel:!0});var zi=o(xe);Ar=s(zi,"STRONG",{});var Bi=o(Ar);Xa=n(Bi,"Singlestep DPM-Solver"),Bi.forEach(t),zi.forEach(t),Ji.forEach(t),Eo.forEach(t),Za=h(p),Ae=s(p,"TR",{});var bo=o(Ae);Pr=s(bo,"TD",{});var ji=o(Pr);Pt=s(ji,"A",{href:!0});var Qi=o(Pt);el=n(Qi,"multistep_dpm_solver"),Qi.forEach(t),ji.forEach(t),tl=h(bo),kr=s(bo,"TD",{});var Yi=o(kr);Pe=s(Yi,"A",{href:!0,rel:!0});var Xi=o(Pe);Mr=s(Xi,"STRONG",{});var Zi=o(Mr);rl=n(Zi,"Multistep DPM-Solver"),Zi.forEach(t),Xi.forEach(t),Yi.forEach(t),bo.forEach(t),sl=h(p),ke=s(p,"TR",{});var wo=o(ke);Nr=s(wo,"TD",{});var ed=o(Nr);kt=s(ed,"A",{href:!0});var td=o(kt);ol=n(td,"heun"),td.forEach(t),ed.forEach(t),al=h(wo),Or=s(wo,"TD",{});var rd=o(Or);Me=s(rd,"A",{href:!0,rel:!0});var sd=o(Me);Rr=s(sd,"STRONG",{});var od=o(Rr);ll=n(od,"Heun scheduler inspired by Karras et. al paper"),od.forEach(t),sd.forEach(t),rd.forEach(t),wo.forEach(t),nl=h(p),Ne=s(p,"TR",{});var So=o(Ne);Lr=s(So,"TD",{});var ad=o(Lr);Mt=s(ad,"A",{href:!0});var ld=o(Mt);il=n(ld,"dpm_discrete"),ld.forEach(t),ad.forEach(t),dl=h(So),Ir=s(So,"TD",{});var nd=o(Ir);Oe=s(nd,"A",{href:!0,rel:!0});var id=o(Oe);qr=s(id,"STRONG",{});var dd=o(qr);hl=n(dd,"DPM Discrete Scheduler inspired by Karras et. al paper"),dd.forEach(t),id.forEach(t),nd.forEach(t),So.forEach(t),cl=h(p),Re=s(p,"TR",{});var yo=o(Re);Vr=s(yo,"TD",{});var hd=o(Vr);Nt=s(hd,"A",{href:!0});var cd=o(Nt);fl=n(cd,"dpm_discrete_ancestral"),cd.forEach(t),hd.forEach(t),ul=h(yo),Gr=s(yo,"TD",{});var fd=o(Gr);Le=s(fd,"A",{href:!0,rel:!0});var ud=o(Le);Kr=s(ud,"STRONG",{});var pd=o(Kr);pl=n(pd,"DPM Discrete Scheduler with ancestral sampling inspired by Karras et. al paper"),pd.forEach(t),ud.forEach(t),fd.forEach(t),yo.forEach(t),ml=h(p),Ie=s(p,"TR",{});var $o=o(Ie);Hr=s($o,"TD",{});var md=o(Hr);Ot=s(md,"A",{href:!0});var vd=o(Ot);vl=n(vd,"stochastic_karras_ve"),vd.forEach(t),md.forEach(t),_l=h($o),Cr=s($o,"TD",{});var _d=o(Cr);qe=s(_d,"A",{href:!0,rel:!0});var gd=o(qe);Fr=s(gd,"STRONG",{});var Ed=o(Fr);gl=n(Ed,"Variance exploding, stochastic sampling from Karras et. al"),Ed.forEach(t),gd.forEach(t),_d.forEach(t),$o.forEach(t),El=h(p),Ve=s(p,"TR",{});var Do=o(Ve);Wr=s(Do,"TD",{});var bd=o(Wr);Rt=s(bd,"A",{href:!0});var wd=o(Rt);bl=n(wd,"lms_discrete"),wd.forEach(t),bd.forEach(t),wl=h(Do),Ur=s(Do,"TD",{});var Sd=o(Ur);Ge=s(Sd,"A",{href:!0,rel:!0});var yd=o(Ge);Jr=s(yd,"STRONG",{});var $d=o(Jr);Sl=n($d,"Linear multistep scheduler for discrete beta schedules"),$d.forEach(t),yd.forEach(t),Sd.forEach(t),Do.forEach(t),yl=h(p),Ke=s(p,"TR",{});var To=o(Ke);zr=s(To,"TD",{});var Dd=o(zr);Lt=s(Dd,"A",{href:!0});var Td=o(Lt);$l=n(Td,"pndm"),Td.forEach(t),Dd.forEach(t),Dl=h(To),Br=s(To,"TD",{});var xd=o(Br);He=s(xd,"A",{href:!0,rel:!0});var Ad=o(He);jr=s(Ad,"STRONG",{});var Pd=o(jr);Tl=n(Pd,"Pseudo numerical methods for diffusion models (PNDM)"),Pd.forEach(t),Ad.forEach(t),xd.forEach(t),To.forEach(t),xl=h(p),Ce=s(p,"TR",{});var xo=o(Ce);Qr=s(xo,"TD",{});var kd=o(Qr);It=s(kd,"A",{href:!0});var Md=o(It);Al=n(Md,"score_sde_ve"),Md.forEach(t),kd.forEach(t),Pl=h(xo),Yr=s(xo,"TD",{});var Nd=o(Yr);Fe=s(Nd,"A",{href:!0,rel:!0});var Od=o(Fe);Xr=s(Od,"STRONG",{});var Rd=o(Xr);kl=n(Rd,"variance exploding stochastic differential equation (VE-SDE) scheduler"),Rd.forEach(t),Od.forEach(t),Nd.forEach(t),xo.forEach(t),Ml=h(p),We=s(p,"TR",{});var Ao=o(We);Zr=s(Ao,"TD",{});var Ld=o(Zr);qt=s(Ld,"A",{href:!0});var Id=o(qt);Nl=n(Id,"ipndm"),Id.forEach(t),Ld.forEach(t),Ol=h(Ao),es=s(Ao,"TD",{});var qd=o(es);Ue=s(qd,"A",{href:!0,rel:!0});var Vd=o(Ue);ts=s(Vd,"STRONG",{});var Gd=o(ts);Rl=n(Gd,"improved pseudo numerical methods for diffusion models (iPNDM)"),Gd.forEach(t),Vd.forEach(t),qd.forEach(t),Ao.forEach(t),Ll=h(p),Je=s(p,"TR",{});var Po=o(Je);rs=s(Po,"TD",{});var Kd=o(rs);Vt=s(Kd,"A",{href:!0});var Hd=o(Vt);Il=n(Hd,"score_sde_vp"),Hd.forEach(t),Kd.forEach(t),ql=h(Po),ss=s(Po,"TD",{});var Cd=o(ss);ze=s(Cd,"A",{href:!0,rel:!0});var Fd=o(ze);os=s(Fd,"STRONG",{});var Wd=o(os);Vl=n(Wd,"Variance preserving stochastic differential equation (VP-SDE) scheduler"),Wd.forEach(t),Fd.forEach(t),Cd.forEach(t),Po.forEach(t),Gl=h(p),Be=s(p,"TR",{});var ko=o(Be);as=s(ko,"TD",{});var Ud=o(as);Gt=s(Ud,"A",{href:!0});var Jd=o(Gt);Kl=n(Jd,"euler"),Jd.forEach(t),Ud.forEach(t),Hl=h(ko),ls=s(ko,"TD",{});var zd=o(ls);je=s(zd,"A",{href:!0,rel:!0});var Bd=o(je);ns=s(Bd,"STRONG",{});var jd=o(ns);Cl=n(jd,"Euler scheduler"),jd.forEach(t),Bd.forEach(t),zd.forEach(t),ko.forEach(t),Fl=h(p),Qe=s(p,"TR",{});var Mo=o(Qe);is=s(Mo,"TD",{});var Qd=o(is);Kt=s(Qd,"A",{href:!0});var Yd=o(Kt);Wl=n(Yd,"euler_ancestral"),Yd.forEach(t),Qd.forEach(t),Ul=h(Mo),ds=s(Mo,"TD",{});var Xd=o(ds);Ye=s(Xd,"A",{href:!0,rel:!0});var Zd=o(Ye);hs=s(Zd,"STRONG",{});var eh=o(hs);Jl=n(eh,"Euler Ancestral scheduler"),eh.forEach(t),Zd.forEach(t),Xd.forEach(t),Mo.forEach(t),zl=h(p),Xe=s(p,"TR",{});var No=o(Xe);cs=s(No,"TD",{});var th=o(cs);Ht=s(th,"A",{href:!0});var rh=o(Ht);Bl=n(rh,"vq_diffusion"),rh.forEach(t),th.forEach(t),jl=h(No),fs=s(No,"TD",{});var sh=o(fs);Ze=s(sh,"A",{href:!0,rel:!0});var oh=o(Ze);us=s(oh,"STRONG",{});var ah=o(us);Ql=n(ah,"VQDiffusionScheduler"),ah.forEach(t),oh.forEach(t),sh.forEach(t),No.forEach(t),Yl=h(p),et=s(p,"TR",{});var Oo=o(et);ps=s(Oo,"TD",{});var lh=o(ps);Ct=s(lh,"A",{href:!0});var nh=o(Ct);Xl=n(nh,"repaint"),nh.forEach(t),lh.forEach(t),Zl=h(Oo),ms=s(Oo,"TD",{});var ih=o(ms);tt=s(ih,"A",{href:!0,rel:!0});var dh=o(tt);vs=s(dh,"STRONG",{});var hh=o(vs);en=n(hh,"RePaint scheduler"),hh.forEach(t),dh.forEach(t),ih.forEach(t),Oo.forEach(t),p.forEach(t),mo.forEach(t),Ys=h(a),z=s(a,"H2",{class:!0});var Ro=o(z);ne=s(Ro,"A",{id:!0,class:!0,href:!0});var ch=o(ne);_s=s(ch,"SPAN",{});var fh=o(_s);S(rt.$$.fragment,fh),fh.forEach(t),ch.forEach(t),tn=h(Ro),gs=s(Ro,"SPAN",{});var uh=o(gs);rn=n(uh,"API"),uh.forEach(t),Ro.forEach(t),Xs=h(a),Ft=s(a,"P",{});var ph=o(Ft);sn=n(ph,"The core API for any new scheduler must follow a limited structure."),ph.forEach(t),Zs=h(a),V=s(a,"UL",{});var jt=o(V);st=s(jt,"LI",{});var Lo=o(st);on=n(Lo,"Schedulers should provide one or more "),Es=s(Lo,"CODE",{});var mh=o(Es);an=n(mh,"def step(...)"),mh.forEach(t),ln=n(Lo," functions that should be called to update the generated sample iteratively."),Lo.forEach(t),nn=h(jt),ot=s(jt,"LI",{});var Io=o(ot);dn=n(Io,"Schedulers should provide a "),bs=s(Io,"CODE",{});var vh=o(bs);hn=n(vh,"set_timesteps(...)"),vh.forEach(t),cn=n(Io," method that configures the parameters of a schedule function for a specific inference task."),Io.forEach(t),fn=h(jt),ws=s(jt,"LI",{});var _h=o(ws);un=n(_h,"Schedulers should be framework-specific."),_h.forEach(t),jt.forEach(t),eo=h(a),ie=s(a,"P",{});var qo=o(ie);pn=n(qo,"The base class "),Wt=s(qo,"A",{href:!0});var gh=o(Wt);mn=n(gh,"SchedulerMixin"),gh.forEach(t),vn=n(qo," implements low level utilities used by multiple schedulers."),qo.forEach(t),to=h(a),B=s(a,"H3",{class:!0});var Vo=o(B);de=s(Vo,"A",{id:!0,class:!0,href:!0});var Eh=o(de);Ss=s(Eh,"SPAN",{});var bh=o(Ss);S(at.$$.fragment,bh),bh.forEach(t),Eh.forEach(t),_n=h(Vo),ys=s(Vo,"SPAN",{});var wh=o(ys);gn=n(wh,"SchedulerMixin"),wh.forEach(t),Vo.forEach(t),ro=h(a),E=s(a,"DIV",{class:!0});var R=o(E);S(lt.$$.fragment,R),En=h(R),$s=s(R,"P",{});var Sh=o($s);bn=n(Sh,"Mixin containing common functions for the schedulers."),Sh.forEach(t),wn=h(R),Ds=s(R,"P",{});var yh=o(Ds);Sn=n(yh,"Class attributes:"),yh.forEach(t),yn=h(R),Ts=s(R,"UL",{});var $h=o(Ts);G=s($h,"LI",{});var mt=o(G);xs=s(mt,"STRONG",{});var Dh=o(xs);$n=n(Dh,"_compatibles"),Dh.forEach(t),Dn=n(mt," ("),As=s(mt,"CODE",{});var Th=o(As);Tn=n(Th,"List[str]"),Th.forEach(t),xn=n(mt,`) \u2014 A list of classes that are compatible with the parent class, so that
`),Ps=s(mt,"CODE",{});var xh=o(Ps);An=n(xh,"from_config"),xh.forEach(t),Pn=n(mt,` can be used from a class different than the one used to save the config (should be overridden
by parent class).`),mt.forEach(t),$h.forEach(t),kn=h(R),O=s(R,"DIV",{class:!0});var me=o(O);S(nt.$$.fragment,me),Mn=h(me),ks=s(me,"P",{});var Ah=o(ks);Nn=n(Ah,"Instantiate a Scheduler class from a pre-defined JSON configuration file inside a directory or Hub repo."),Ah.forEach(t),On=h(me),S(he.$$.fragment,me),Rn=h(me),S(ce.$$.fragment,me),me.forEach(t),Ln=h(R),fe=s(R,"DIV",{class:!0});var Go=o(fe);S(it.$$.fragment,Go),In=h(Go),j=s(Go,"P",{});var Qt=o(j);qn=n(Qt,"Save a scheduler configuration object to the directory "),Ms=s(Qt,"CODE",{});var Ph=o(Ms);Vn=n(Ph,"save_directory"),Ph.forEach(t),Gn=n(Qt,`, so that it can be re-loaded using the
`),Ut=s(Qt,"A",{href:!0});var kh=o(Ut);Kn=n(kh,"from_pretrained()"),kh.forEach(t),Hn=n(Qt," class method."),Qt.forEach(t),Go.forEach(t),R.forEach(t),so=h(a),Q=s(a,"H3",{class:!0});var Ko=o(Q);ue=s(Ko,"A",{id:!0,class:!0,href:!0});var Mh=o(ue);Ns=s(Mh,"SPAN",{});var Nh=o(Ns);S(dt.$$.fragment,Nh),Nh.forEach(t),Mh.forEach(t),Cn=h(Ko),Os=s(Ko,"SPAN",{});var Oh=o(Os);Fn=n(Oh,"SchedulerOutput"),Oh.forEach(t),Ko.forEach(t),oo=n(a,"\n\nThe class `SchedulerOutput` contains the outputs from any schedulers `step(...)` call.\n"),Y=s(a,"DIV",{class:!0});var Ho=o(Y);S(ht.$$.fragment,Ho),Wn=h(Ho),Rs=s(Ho,"P",{});var Rh=o(Rs);Un=n(Rh,"Base class for the scheduler\u2019s step function output."),Rh.forEach(t),Ho.forEach(t),ao=h(a),X=s(a,"H3",{class:!0});var Co=o(X);pe=s(Co,"A",{id:!0,class:!0,href:!0});var Lh=o(pe);Ls=s(Lh,"SPAN",{});var Ih=o(Ls);S(ct.$$.fragment,Ih),Ih.forEach(t),Lh.forEach(t),Jn=h(Co),Is=s(Co,"SPAN",{});var qh=o(Is);zn=n(qh,"KarrasDiffusionSchedulers"),qh.forEach(t),Co.forEach(t),lo=h(a),Z=s(a,"DIV",{class:!0});var Fo=o(Z);S(ft.$$.fragment,Fo),Bn=h(Fo),qs=s(Fo,"P",{});var Vh=o(qs);jn=n(Vh,"An enumeration."),Vh.forEach(t),Fo.forEach(t),this.h()},h(){i(m,"name","hf:doc:metadata"),i(m,"content",JSON.stringify(Bh)),i(b,"id","schedulers"),i(b,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(b,"href","#schedulers"),i(v,"class","relative group"),i(te,"id","what-is-a-scheduler"),i(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(te,"href","#what-is-a-scheduler"),i(C,"class","relative group"),i(se,"id","discrete-versus-continuous-schedulers"),i(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(se,"href","#discrete-versus-continuous-schedulers"),i(W,"class","relative group"),i(Et,"href","/docs/diffusers/main/en/api/schedulers/ddpm#diffusers.DDPMScheduler"),i(bt,"href","/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler"),i(wt,"href","/docs/diffusers/main/en/api/schedulers/score_sde_ve#diffusers.ScoreSdeVeScheduler"),i(oe,"id","designing-reusable-schedulers"),i(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(oe,"href","#designing-reusable-schedulers"),i(U,"class","relative group"),i(yt,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),i($t,"href","/docs/diffusers/main/en/api/pipelines/dit#diffusers.DiTPipeline"),i(ae,"id","schedulers-summary"),i(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ae,"href","#schedulers-summary"),i(J,"class","relative group"),i(Tt,"href","./ddim"),i(ye,"href","https://arxiv.org/abs/2010.02502"),i(ye,"rel","nofollow"),i(xt,"href","./ddpm"),i(De,"href","https://arxiv.org/abs/2006.11239"),i(De,"rel","nofollow"),i(At,"href","./singlestep_dpm_solver"),i(xe,"href","https://arxiv.org/abs/2206.00927"),i(xe,"rel","nofollow"),i(Pt,"href","./multistep_dpm_solver"),i(Pe,"href","https://arxiv.org/abs/2206.00927"),i(Pe,"rel","nofollow"),i(kt,"href","./heun"),i(Me,"href","https://arxiv.org/abs/2206.00364"),i(Me,"rel","nofollow"),i(Mt,"href","./dpm_discrete"),i(Oe,"href","https://arxiv.org/abs/2206.00364"),i(Oe,"rel","nofollow"),i(Nt,"href","./dpm_discrete_ancestral"),i(Le,"href","https://arxiv.org/abs/2206.00364"),i(Le,"rel","nofollow"),i(Ot,"href","./stochastic_karras_ve"),i(qe,"href","https://arxiv.org/abs/2206.00364"),i(qe,"rel","nofollow"),i(Rt,"href","./lms_discrete"),i(Ge,"href","https://arxiv.org/abs/2206.00364"),i(Ge,"rel","nofollow"),i(Lt,"href","./pndm"),i(He,"href","https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L181"),i(He,"rel","nofollow"),i(It,"href","./score_sde_ve"),i(Fe,"href","https://arxiv.org/abs/2011.13456"),i(Fe,"rel","nofollow"),i(qt,"href","./ipndm"),i(Ue,"href","https://github.com/crowsonkb/v-diffusion-pytorch/blob/987f8985e38208345c1959b0ea767a625831cc9b/diffusion/sampling.py#L296"),i(Ue,"rel","nofollow"),i(Vt,"href","./score_sde_vp"),i(ze,"href","https://arxiv.org/abs/2011.13456"),i(ze,"rel","nofollow"),i(Gt,"href","./euler"),i(je,"href","https://arxiv.org/abs/2206.00364"),i(je,"rel","nofollow"),i(Kt,"href","./euler_ancestral"),i(Ye,"href","https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L72"),i(Ye,"rel","nofollow"),i(Ht,"href","./vq_diffusion"),i(Ze,"href","https://arxiv.org/abs/2111.14822"),i(Ze,"rel","nofollow"),i(Ct,"href","./repaint"),i(tt,"href","https://arxiv.org/abs/2201.09865"),i(tt,"rel","nofollow"),i(ne,"id","api"),i(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ne,"href","#api"),i(z,"class","relative group"),i(Wt,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),i(de,"id","diffusers.SchedulerMixin"),i(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(de,"href","#diffusers.SchedulerMixin"),i(B,"class","relative group"),i(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ut,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),i(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ue,"id","diffusers.schedulers.scheduling_utils.SchedulerOutput"),i(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ue,"href","#diffusers.schedulers.scheduling_utils.SchedulerOutput"),i(Q,"class","relative group"),i(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(pe,"id","diffusers.schedulers.KarrasDiffusionSchedulers"),i(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(pe,"href","#diffusers.schedulers.KarrasDiffusionSchedulers"),i(X,"class","relative group"),i(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(a,c){e(document.head,m),f(a,M,c),f(a,v,c),e(v,b),e(b,P),y(_,P,null),e(v,x),e(v,N),e(N,K),f(a,k,c),f(a,H,c),e(H,_t),f(a,Ks,c),f(a,C,c),e(C,te),e(te,Yt),y(ve,Yt,null),e(C,Wo),e(C,Xt),e(Xt,Uo),f(a,Hs,c),f(a,L,c),e(L,Jo),e(L,Zt),e(Zt,zo),e(L,Bo),e(L,er),e(er,jo),e(L,Qo),f(a,Cs,c),f(a,re,c),e(re,gt),e(gt,Yo),e(gt,_e),e(_e,tr),e(tr,Xo),e(_e,Zo),e(_e,rr),e(rr,ea),e(re,ta),e(re,F),e(F,ra),e(F,sr),e(sr,sa),e(F,oa),e(F,or),e(or,aa),e(F,la),f(a,Fs,c),f(a,W,c),e(W,se),e(se,ar),y(ge,ar,null),e(W,na),e(W,lr),e(lr,ia),f(a,Ws,c),f(a,g,c),e(g,da),e(g,nr),e(nr,ha),e(g,ca),e(g,Et),e(Et,fa),e(g,ua),e(g,bt),e(bt,pa),e(g,ma),e(g,ir),e(ir,va),e(g,_a),e(g,wt),e(wt,ga),e(g,Ea),e(g,dr),e(dr,ba),e(g,wa),f(a,Us,c),f(a,U,c),e(U,oe),e(oe,hr),y(Ee,hr,null),e(U,Sa),e(U,cr),e(cr,ya),f(a,Js,c),f(a,St,c),e(St,$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(B,_n),e(B,ys),e(ys,gn),f(a,ro,c),f(a,E,c),y(lt,E,null),e(E,En),e(E,$s),e($s,bn),e(E,wn),e(E,Ds),e(Ds,Sn),e(E,yn),e(E,Ts),e(Ts,G),e(G,xs),e(xs,$n),e(G,Dn),e(G,As),e(As,Tn),e(G,xn),e(G,Ps),e(Ps,An),e(G,Pn),e(E,kn),e(E,O),y(nt,O,null),e(O,Mn),e(O,ks),e(ks,Nn),e(O,On),y(he,O,null),e(O,Rn),y(ce,O,null),e(E,Ln),e(E,fe),y(it,fe,null),e(fe,In),e(fe,j),e(j,qn),e(j,Ms),e(Ms,Vn),e(j,Gn),e(j,Ut),e(Ut,Kn),e(j,Hn),f(a,so,c),f(a,Q,c),e(Q,ue),e(ue,Ns),y(dt,Ns,null),e(Q,Cn),e(Q,Os),e(Os,Fn),f(a,oo,c),f(a,Y,c),y(ht,Y,null),e(Y,Wn),e(Y,Rs),e(Rs,Un),f(a,ao,c),f(a,X,c),e(X,pe),e(pe,Ls),y(ct,Ls,null),e(X,Jn),e(X,Is),e(Is,zn),f(a,lo,c),f(a,Z,c),y(ft,Z,null),e(Z,Bn),e(Z,qs),e(qs,jn),no=!0},p(a,[c]){const ut={};c&2&&(ut.$$scope={dirty:c,ctx:a}),he.$set(ut);const Vs={};c&2&&(Vs.$$scope={dirty:c,ctx:a}),ce.$set(Vs)},i(a){no||($(_.$$.fragment,a),$(ve.$$.fragment,a),$(ge.$$.fragment,a),$(Ee.$$.fragment,a),$(be.$$.fragment,a),$(rt.$$.fragment,a),$(at.$$.fragment,a),$(lt.$$.fragment,a),$(nt.$$.fragment,a),$(he.$$.fragment,a),$(ce.$$.fragment,a),$(it.$$.fragment,a),$(dt.$$.fragment,a),$(ht.$$.fragment,a),$(ct.$$.fragment,a),$(ft.$$.fragment,a),no=!0)},o(a){D(_.$$.fragment,a),D(ve.$$.fragment,a),D(ge.$$.fragment,a),D(Ee.$$.fragment,a),D(be.$$.fragment,a),D(rt.$$.fragment,a),D(at.$$.fragment,a),D(lt.$$.fragment,a),D(nt.$$.fragment,a),D(he.$$.fragment,a),D(ce.$$.fragment,a),D(it.$$.fragment,a),D(dt.$$.fragment,a),D(ht.$$.fragment,a),D(ct.$$.fragment,a),D(ft.$$.fragment,a),no=!1},d(a){t(m),a&&t(M),a&&t(v),T(_),a&&t(k),a&&t(H),a&&t(Ks),a&&t(C),T(ve),a&&t(Hs),a&&t(L),a&&t(Cs),a&&t(re),a&&t(Fs),a&&t(W),T(ge),a&&t(Ws),a&&t(g),a&&t(Us),a&&t(U),T(Ee),a&&t(Js),a&&t(St),a&&t(zs),a&&t(I),a&&t(Bs),a&&t(J),T(be),a&&t(js),a&&t(Dt),a&&t(Qs),a&&t(le),a&&t(Ys),a&&t(z),T(rt),a&&t(Xs),a&&t(Ft),a&&t(Zs),a&&t(V),a&&t(eo),a&&t(ie),a&&t(to),a&&t(B),T(at),a&&t(ro),a&&t(E),T(lt),T(nt),T(he),T(ce),T(it),a&&t(so),a&&t(Q),T(dt),a&&t(oo),a&&t(Y),T(ht),a&&t(ao),a&&t(X),T(ct),a&&t(lo),a&&t(Z),T(ft)}}}const Bh={local:"schedulers",sections:[{local:"what-is-a-scheduler",sections:[{local:"discrete-versus-continuous-schedulers",title:"Discrete versus continuous schedulers"}],title:"What is a scheduler?"},{local:"designing-reusable-schedulers",title:"Designing Re-usable schedulers"},{local:"schedulers-summary",title:"Schedulers Summary"},{local:"api",sections:[{local:"diffusers.SchedulerMixin",title:"SchedulerMixin"},{local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",title:"SchedulerOutput"},{local:"diffusers.schedulers.KarrasDiffusionSchedulers",title:"KarrasDiffusionSchedulers"}],title:"API"}],title:"Schedulers"};function jh(vt){return Wh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ec extends Kh{constructor(m){super();Hh(this,m,jh,zh,Ch,{})}}export{ec as default,Bh as metadata};
