import{S as Oc,i as Nc,s as Rc,e as r,k as d,w as T,t as a,M as Ic,c as s,d as t,m as n,a as o,x as w,h as l,b as c,G as e,g as p,y as $,q as P,o as x,B as k,v as Lc,L as Kc}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Jc}from"../../../chunks/Tip-hf-doc-builder.js";import{D as sr}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Bc}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Us}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Zc}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Vc(Xe){let m,A,v,b,y,_,S,K,U,_e,E;return{c(){m=r("p"),A=a("To use private or "),v=r("a"),b=a("gated models"),y=a(`, log-in with
`),_=r("code"),S=a("huggingface-cli login"),K=a(`. You can also activate the special
`),U=r("a"),_e=a("\u201Coffline-mode\u201D"),E=a(` to use this method in a
firewalled environment.`),this.h()},l(J){m=s(J,"P",{});var D=o(m);A=l(D,"To use private or "),v=s(D,"A",{href:!0,rel:!0});var Ge=o(v);b=l(Ge,"gated models"),Ge.forEach(t),y=l(D,`, log-in with
`),_=s(D,"CODE",{});var Qe=o(_);S=l(Qe,"huggingface-cli login"),Qe.forEach(t),K=l(D,`. You can also activate the special
`),U=s(D,"A",{href:!0,rel:!0});var ve=o(U);_e=l(ve,"\u201Coffline-mode\u201D"),ve.forEach(t),E=l(D,` to use this method in a
firewalled environment.`),D.forEach(t),this.h()},h(){c(v,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),c(v,"rel","nofollow"),c(U,"href","https://huggingface.co/diffusers/installation.html#offline-mode"),c(U,"rel","nofollow")},m(J,D){p(J,m,D),e(m,A),e(m,v),e(v,b),e(m,y),e(m,_),e(_,S),e(m,K),e(m,U),e(U,_e),e(m,E)},d(J){J&&t(m)}}}function Fc(Xe){let m,A,v,b,y;return b=new Bc({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMiUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC11bmV0JTIyLiUwQXVuZXQucHVzaF90b19odWIoJTIybXktZmluZXR1bmVkLXVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtdW5ldCUyMi4lMEF1bmV0LnB1c2hfdG9faHViKCUyMnlvdXItb3JnJTJGbXktZmluZXR1bmVkLXVuZXQlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

unet = UNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)

<span class="hljs-comment"># Push the \`unet\` to your namespace with the name &quot;my-finetuned-unet&quot;.</span>
unet.push_to_hub(<span class="hljs-string">&quot;my-finetuned-unet&quot;</span>)

<span class="hljs-comment"># Push the \`unet\` to an organization with the name &quot;my-finetuned-unet&quot;.</span>
unet.push_to_hub(<span class="hljs-string">&quot;your-org/my-finetuned-unet&quot;</span>)`}}),{c(){m=r("p"),A=a("Examples:"),v=d(),T(b.$$.fragment)},l(_){m=s(_,"P",{});var S=o(m);A=l(S,"Examples:"),S.forEach(t),v=n(_),w(b.$$.fragment,_)},m(_,S){p(_,m,S),e(m,A),p(_,v,S),$(b,_,S),y=!0},p:Kc,i(_){y||(P(b.$$.fragment,_),y=!0)},o(_){x(b.$$.fragment,_),y=!1},d(_){_&&t(m),_&&t(v),k(b,_)}}}function Wc(Xe){let m,A,v,b,y,_,S,K,U,_e,E,J,D,Ge,Qe,ve,yo,So,or,To,wo,ar,$o,Po,lr,xo,ko,Os,Ye,Ao,Ns,ge,ke,Ho,ir,Co,Uo,Oo,Ae,No,dr,Ro,Io,Rs,N,Lo,He,Ko,Jo,Ce,Bo,Zo,Is,be,nr,B,cr,Vo,Fo,hr,Wo,jo,ur,qo,zo,h,Z,fr,Xo,Go,pr,et,Qo,Yo,Ls,ea,V,mr,ta,ra,_r,tt,sa,oa,rt,aa,vr,la,ia,F,gr,da,na,br,st,ca,ha,ot,ua,Er,fa,pa,W,Dr,ma,_a,Mr,at,va,ga,Ee,ba,yr,Ea,Da,Sr,Ma,ya,j,Tr,Sa,Ta,wr,wa,$a,lt,Pa,$r,xa,ka,q,Pr,Aa,Ha,xr,Ca,Ua,it,Oa,kr,Na,Ra,z,Ar,Ia,La,Hr,dt,Ka,Ja,Ks,Ba,X,Cr,Za,Va,Ur,nt,Fa,Wa,ct,ja,Or,qa,za,G,Nr,Xa,Ga,Rr,ht,Qa,Ya,Js,el,Q,Ir,tl,rl,Lr,ut,sl,ol,ft,al,Kr,ll,il,Y,Jr,dl,nl,Br,pt,cl,hl,Bs,ul,ee,Zr,fl,pl,Vr,mt,ml,_l,_t,vl,Fr,gl,bl,te,Wr,El,Dl,jr,Ml,yl,Zs,Sl,re,qr,Tl,wl,zr,$l,Pl,Vs,xl,se,Xr,kl,Al,Gr,vt,Hl,Cl,Fs,Ul,oe,Qr,Ol,Nl,Yr,gt,Rl,Il,Ws,Ll,ae,es,Kl,Jl,ts,bt,Bl,Zl,js,Vl,le,rs,Fl,Wl,ss,Et,jl,ql,qs,zl,ie,os,Xl,Gl,as,Dt,Ql,Yl,Mt,ei,ls,ti,ri,de,is,si,oi,ds,yt,ai,li,zs,ii,ne,ns,di,ni,cs,St,ci,hi,Xs,Gs,De,ui,Tt,fi,pi,Qs,ce,Me,hs,Ue,mi,us,_i,Ys,g,Oe,vi,fs,gi,bi,wt,$t,Ei,Di,Mi,H,Pt,yi,Si,ps,Ti,wi,ms,$i,Pi,_s,xi,ki,Ai,vs,Hi,Ci,gs,R,bs,Ui,Oi,Es,Ni,Ri,xt,Ii,Li,Ki,I,Ne,Ji,Ds,Bi,Zi,ye,Vi,Se,Re,Fi,Ie,Wi,kt,ji,qi,eo,he,Te,Ms,Le,zi,ys,Xi,to,ue,Ke,Gi,Je,Qi,Ss,Yi,ed,ro,fe,we,Ts,Be,td,ws,rd,so,Ze,$s,sd,od,oo,$e,ad,Ve,ld,id,ao,pe,Pe,Ps,Fe,dd,xs,nd,lo,O,We,cd,ks,hd,ud,L,je,fd,As,pd,md,xe,io;return _=new Us({}),Ue=new Us({}),Oe=new sr({props:{name:"class diffusers.SchedulerMixin",anchor:"diffusers.SchedulerMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L63"}}),Ne=new sr({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> (for example <code>google/ddpm-celebahq-256</code>) of a pretrained model hosted on
the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_model_directory</code>) containing the scheduler
configuration saved with <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained">save_pretrained()</a>.</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;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,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 where a downloaded pretrained model configuration is cached if the standard cache
is not 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 resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,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, for example, <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 to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,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>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,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, a commit id, or any identifier
allowed by Git.`,name:"revision"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L83"}}),ye=new Jc({props:{$$slots:{default:[Vc]},$$scope:{ctx:Xe}}}),Re=new sr({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"},{anchor:"diffusers.SchedulerMixin.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face Hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"diffusers.SchedulerMixin.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L149"}}),Le=new Us({}),Ke=new sr({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 <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"}}),Be=new Us({}),Fe=new Us({}),We=new sr({props:{name:"class diffusers.utils.PushToHubMixin",anchor:"diffusers.utils.PushToHubMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/hub_utils.py#L373"}}),je=new sr({props:{name:"push_to_hub",anchor:"diffusers.utils.PushToHubMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Optional[str] = None"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"variant",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your model, scheduler, or pipeline files to. It should
contain your organization name when pushing to an organization. <code>repo_id</code> can also be a path to a local
directory.`,name:"repo_id"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Default to <code>&quot;Upload {object}&quot;</code>.`,name:"commit_message"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. The token generated when running
<code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to convert the model weights to the <code>safetensors</code> format.`,name:"safe_serialization"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If specified, weights are saved in the format <code>pytorch_model.&lt;variant&gt;.bin</code>.`,name:"variant"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/hub_utils.py#L402"}}),xe=new Zc({props:{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.example",$$slots:{default:[Fc]},$$scope:{ctx:Xe}}}),{c(){m=r("meta"),A=d(),v=r("h1"),b=r("a"),y=r("span"),T(_.$$.fragment),S=d(),K=r("span"),U=a("Schedulers"),_e=d(),E=r("p"),J=a("\u{1F917} Diffusers provides many scheduler functions for the diffusion process. A scheduler takes a model\u2019s output (the sample which the diffusion process is iterating on) and a timestep to return a denoised sample. The timestep is important because it dictates where in the diffusion process the step is; data is generated by iterating forward "),D=r("em"),Ge=a("n"),Qe=a(" timesteps and inference occurs by propagating backward through the timesteps. Based on the timestep, a scheduler may be "),ve=r("em"),yo=a("discrete"),So=a(" in which case the timestep is an "),or=r("code"),To=a("int"),wo=a(" or "),ar=r("em"),$o=a("continuous"),Po=a(" in which case the timestep is a "),lr=r("code"),xo=a("float"),ko=a("."),Os=d(),Ye=r("p"),Ao=a("Depending on the context, a scheduler defines how to iteratively add noise to an image or how to update a sample based on a model\u2019s output:"),Ns=d(),ge=r("ul"),ke=r("li"),Ho=a("during "),ir=r("em"),Co=a("training"),Uo=a(", a scheduler adds noise (there are different algorithms for how to add noise) to a sample to train a diffusion model"),Oo=d(),Ae=r("li"),No=a("during "),dr=r("em"),Ro=a("inference"),Io=a(", a scheduler defines how to update a sample based on a pretrained model\u2019s output"),Rs=d(),N=r("p"),Lo=a("Many schedulers are implemented from the "),He=r("a"),Ko=a("k-diffusion"),Jo=a(" library by "),Ce=r("a"),Bo=a("Katherine Crowson"),Zo=a(", and they\u2019re also widely used in A1111. To help you map the schedulers from k-diffusion and A1111 to the schedulers in \u{1F917} Diffusers, take a look at the table below:"),Is=d(),be=r("table"),nr=r("thead"),B=r("tr"),cr=r("th"),Vo=a("A1111/k-diffusion"),Fo=d(),hr=r("th"),Wo=a("\u{1F917} Diffusers"),jo=d(),ur=r("th"),qo=a("Usage"),zo=d(),h=r("tbody"),Z=r("tr"),fr=r("td"),Xo=a("DPM++ 2M"),Go=d(),pr=r("td"),et=r("a"),Qo=a("DPMSolverMultistepScheduler"),Yo=d(),Ls=r("td"),ea=d(),V=r("tr"),mr=r("td"),ta=a("DPM++ 2M Karras"),ra=d(),_r=r("td"),tt=r("a"),sa=a("DPMSolverMultistepScheduler"),oa=d(),rt=r("td"),aa=a("init with "),vr=r("code"),la=a("use_karras_sigmas=True"),ia=d(),F=r("tr"),gr=r("td"),da=a("DPM++ 2M SDE"),na=d(),br=r("td"),st=r("a"),ca=a("DPMSolverMultistepScheduler"),ha=d(),ot=r("td"),ua=a("init with "),Er=r("code"),fa=a('algorithm_type="sde-dpmsolver++"'),pa=d(),W=r("tr"),Dr=r("td"),ma=a("DPM++ 2M SDE Karras"),_a=d(),Mr=r("td"),at=r("a"),va=a("DPMSolverMultistepScheduler"),ga=d(),Ee=r("td"),ba=a("init with "),yr=r("code"),Ea=a("use_karras_sigmas=True"),Da=a(" and "),Sr=r("code"),Ma=a('algorithm_type="sde-dpmsolver++"'),ya=d(),j=r("tr"),Tr=r("td"),Sa=a("DPM++ 2S a"),Ta=d(),wr=r("td"),wa=a("N/A"),$a=d(),lt=r("td"),Pa=a("very similar to  "),$r=r("code"),xa=a("DPMSolverSinglestepScheduler"),ka=d(),q=r("tr"),Pr=r("td"),Aa=a("DPM++ 2S a Karras"),Ha=d(),xr=r("td"),Ca=a("N/A"),Ua=d(),it=r("td"),Oa=a("very similar to  "),kr=r("code"),Na=a("DPMSolverSinglestepScheduler(use_karras_sigmas=True, ...)"),Ra=d(),z=r("tr"),Ar=r("td"),Ia=a("DPM++ SDE"),La=d(),Hr=r("td"),dt=r("a"),Ka=a("DPMSolverSinglestepScheduler"),Ja=d(),Ks=r("td"),Ba=d(),X=r("tr"),Cr=r("td"),Za=a("DPM++ SDE Karras"),Va=d(),Ur=r("td"),nt=r("a"),Fa=a("DPMSolverSinglestepScheduler"),Wa=d(),ct=r("td"),ja=a("init with "),Or=r("code"),qa=a("use_karras_sigmas=True"),za=d(),G=r("tr"),Nr=r("td"),Xa=a("DPM2"),Ga=d(),Rr=r("td"),ht=r("a"),Qa=a("KDPM2DiscreteScheduler"),Ya=d(),Js=r("td"),el=d(),Q=r("tr"),Ir=r("td"),tl=a("DPM2 Karras"),rl=d(),Lr=r("td"),ut=r("a"),sl=a("KDPM2DiscreteScheduler"),ol=d(),ft=r("td"),al=a("init with "),Kr=r("code"),ll=a("use_karras_sigmas=True"),il=d(),Y=r("tr"),Jr=r("td"),dl=a("DPM2 a"),nl=d(),Br=r("td"),pt=r("a"),cl=a("KDPM2AncestralDiscreteScheduler"),hl=d(),Bs=r("td"),ul=d(),ee=r("tr"),Zr=r("td"),fl=a("DPM2 a Karras"),pl=d(),Vr=r("td"),mt=r("a"),ml=a("KDPM2AncestralDiscreteScheduler"),_l=d(),_t=r("td"),vl=a("init with "),Fr=r("code"),gl=a("use_karras_sigmas=True"),bl=d(),te=r("tr"),Wr=r("td"),El=a("DPM adaptive"),Dl=d(),jr=r("td"),Ml=a("N/A"),yl=d(),Zs=r("td"),Sl=d(),re=r("tr"),qr=r("td"),Tl=a("DPM fast"),wl=d(),zr=r("td"),$l=a("N/A"),Pl=d(),Vs=r("td"),xl=d(),se=r("tr"),Xr=r("td"),kl=a("Euler"),Al=d(),Gr=r("td"),vt=r("a"),Hl=a("EulerDiscreteScheduler"),Cl=d(),Fs=r("td"),Ul=d(),oe=r("tr"),Qr=r("td"),Ol=a("Euler a"),Nl=d(),Yr=r("td"),gt=r("a"),Rl=a("EulerAncestralDiscreteScheduler"),Il=d(),Ws=r("td"),Ll=d(),ae=r("tr"),es=r("td"),Kl=a("Heun"),Jl=d(),ts=r("td"),bt=r("a"),Bl=a("HeunDiscreteScheduler"),Zl=d(),js=r("td"),Vl=d(),le=r("tr"),rs=r("td"),Fl=a("LMS"),Wl=d(),ss=r("td"),Et=r("a"),jl=a("LMSDiscreteScheduler"),ql=d(),qs=r("td"),zl=d(),ie=r("tr"),os=r("td"),Xl=a("LMS Karras"),Gl=d(),as=r("td"),Dt=r("a"),Ql=a("LMSDiscreteScheduler"),Yl=d(),Mt=r("td"),ei=a("init with "),ls=r("code"),ti=a("use_karras_sigmas=True"),ri=d(),de=r("tr"),is=r("td"),si=a("N/A"),oi=d(),ds=r("td"),yt=r("a"),ai=a("DEISMultistepScheduler"),li=d(),zs=r("td"),ii=d(),ne=r("tr"),ns=r("td"),di=a("N/A"),ni=d(),cs=r("td"),St=r("a"),ci=a("UniPCMultistepScheduler"),hi=d(),Xs=r("td"),Gs=d(),De=r("p"),ui=a("All schedulers are built from the base "),Tt=r("a"),fi=a("SchedulerMixin"),pi=a(" class which implements low level utilities shared by all schedulers."),Qs=d(),ce=r("h2"),Me=r("a"),hs=r("span"),T(Ue.$$.fragment),mi=d(),us=r("span"),_i=a("SchedulerMixin"),Ys=d(),g=r("div"),T(Oe.$$.fragment),vi=d(),fs=r("p"),gi=a("Base class for all schedulers."),bi=d(),wt=r("p"),$t=r("a"),Ei=a("SchedulerMixin"),Di=a(` contains common functions shared by all schedulers such as general loading and saving
functionalities.`),Mi=d(),H=r("p"),Pt=r("a"),yi=a("ConfigMixin"),Si=a(" takes care of storing the configuration attributes (like "),ps=r("code"),Ti=a("num_train_timesteps"),wi=a(`) that are passed to
the scheduler\u2019s `),ms=r("code"),$i=a("__init__"),Pi=a(" function, and the attributes can be accessed by "),_s=r("code"),xi=a("scheduler.config.num_train_timesteps"),ki=a("."),Ai=d(),vs=r("p"),Hi=a("Class attributes:"),Ci=d(),gs=r("ul"),R=r("li"),bs=r("strong"),Ui=a("_compatibles"),Oi=a(" ("),Es=r("code"),Ni=a("List[str]"),Ri=a(`) \u2014 A list of scheduler classes that are compatible with the parent scheduler
class. Use `),xt=r("a"),Ii=a("from_config()"),Li=a(` to load a different compatible scheduler class (should be overridden
by parent class).`),Ki=d(),I=r("div"),T(Ne.$$.fragment),Ji=d(),Ds=r("p"),Bi=a("Instantiate a scheduler from a pre-defined JSON configuration file in a local directory or Hub repository."),Zi=d(),T(ye.$$.fragment),Vi=d(),Se=r("div"),T(Re.$$.fragment),Fi=d(),Ie=r("p"),Wi=a(`Save a scheduler configuration object to a directory so that it can be reloaded using the
`),kt=r("a"),ji=a("from_pretrained()"),qi=a(" class method."),eo=d(),he=r("h2"),Te=r("a"),Ms=r("span"),T(Le.$$.fragment),zi=d(),ys=r("span"),Xi=a("SchedulerOutput"),to=d(),ue=r("div"),T(Ke.$$.fragment),Gi=d(),Je=r("p"),Qi=a("Base class for the output of a scheduler\u2019s "),Ss=r("code"),Yi=a("step"),ed=a(" function."),ro=d(),fe=r("h2"),we=r("a"),Ts=r("span"),T(Be.$$.fragment),td=d(),ws=r("span"),rd=a("KarrasDiffusionSchedulers"),so=d(),Ze=r("p"),$s=r("code"),sd=a("KarrasDiffusionSchedulers"),od=a(" are a broad generalization of schedulers in \u{1F917} Diffusers. The schedulers in this class are distinguished at a high level by their noise sampling strategy, the type of network and scaling, the training strategy, and how the loss is weighed."),oo=d(),$e=r("p"),ad=a("The different schedulers in this class, depending on the ordinary differential equations (ODE) solver type, fall into the above taxonomy and provide a good abstraction for the design of the main schedulers implemented in \u{1F917} Diffusers. The schedulers in this class are given "),Ve=r("a"),ld=a("here"),id=a("."),ao=d(),pe=r("h2"),Pe=r("a"),Ps=r("span"),T(Fe.$$.fragment),dd=d(),xs=r("span"),nd=a("PushToHubMixin"),lo=d(),O=r("div"),T(We.$$.fragment),cd=d(),ks=r("p"),hd=a("A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub."),ud=d(),L=r("div"),T(je.$$.fragment),fd=d(),As=r("p"),pd=a("Upload model, scheduler, or pipeline files to the \u{1F917} Hugging Face Hub."),md=d(),T(xe.$$.fragment),this.h()},l(i){const f=Ic('[data-svelte="svelte-1phssyn"]',document.head);m=s(f,"META",{name:!0,content:!0}),f.forEach(t),A=n(i),v=s(i,"H1",{class:!0});var qe=o(v);b=s(qe,"A",{id:!0,class:!0,href:!0});var Hs=o(b);y=s(Hs,"SPAN",{});var wd=o(y);w(_.$$.fragment,wd),wd.forEach(t),Hs.forEach(t),S=n(qe),K=s(qe,"SPAN",{});var $d=o(K);U=l($d,"Schedulers"),$d.forEach(t),qe.forEach(t),_e=n(i),E=s(i,"P",{});var C=o(E);J=l(C,"\u{1F917} Diffusers provides many scheduler functions for the diffusion process. A scheduler takes a model\u2019s output (the sample which the diffusion process is iterating on) and a timestep to return a denoised sample. The timestep is important because it dictates where in the diffusion process the step is; data is generated by iterating forward "),D=s(C,"EM",{});var Pd=o(D);Ge=l(Pd,"n"),Pd.forEach(t),Qe=l(C," timesteps and inference occurs by propagating backward through the timesteps. Based on the timestep, a scheduler may be "),ve=s(C,"EM",{});var xd=o(ve);yo=l(xd,"discrete"),xd.forEach(t),So=l(C," in which case the timestep is an "),or=s(C,"CODE",{});var kd=o(or);To=l(kd,"int"),kd.forEach(t),wo=l(C," or "),ar=s(C,"EM",{});var Ad=o(ar);$o=l(Ad,"continuous"),Ad.forEach(t),Po=l(C," in which case the timestep is a "),lr=s(C,"CODE",{});var Hd=o(lr);xo=l(Hd,"float"),Hd.forEach(t),ko=l(C,"."),C.forEach(t),Os=n(i),Ye=s(i,"P",{});var Cd=o(Ye);Ao=l(Cd,"Depending on the context, a scheduler defines how to iteratively add noise to an image or how to update a sample based on a model\u2019s output:"),Cd.forEach(t),Ns=n(i),ge=s(i,"UL",{});var no=o(ge);ke=s(no,"LI",{});var co=o(ke);Ho=l(co,"during "),ir=s(co,"EM",{});var Ud=o(ir);Co=l(Ud,"training"),Ud.forEach(t),Uo=l(co,", a scheduler adds noise (there are different algorithms for how to add noise) to a sample to train a diffusion model"),co.forEach(t),Oo=n(no),Ae=s(no,"LI",{});var ho=o(Ae);No=l(ho,"during "),dr=s(ho,"EM",{});var Od=o(dr);Ro=l(Od,"inference"),Od.forEach(t),Io=l(ho,", a scheduler defines how to update a sample based on a pretrained model\u2019s output"),ho.forEach(t),no.forEach(t),Rs=n(i),N=s(i,"P",{});var At=o(N);Lo=l(At,"Many schedulers are implemented from the "),He=s(At,"A",{href:!0,rel:!0});var Nd=o(He);Ko=l(Nd,"k-diffusion"),Nd.forEach(t),Jo=l(At," library by "),Ce=s(At,"A",{href:!0,rel:!0});var Rd=o(Ce);Bo=l(Rd,"Katherine Crowson"),Rd.forEach(t),Zo=l(At,", and they\u2019re also widely used in A1111. To help you map the schedulers from k-diffusion and A1111 to the schedulers in \u{1F917} Diffusers, take a look at the table below:"),At.forEach(t),Is=n(i),be=s(i,"TABLE",{});var uo=o(be);nr=s(uo,"THEAD",{});var Id=o(nr);B=s(Id,"TR",{});var Ht=o(B);cr=s(Ht,"TH",{});var Ld=o(cr);Vo=l(Ld,"A1111/k-diffusion"),Ld.forEach(t),Fo=n(Ht),hr=s(Ht,"TH",{});var Kd=o(hr);Wo=l(Kd,"\u{1F917} Diffusers"),Kd.forEach(t),jo=n(Ht),ur=s(Ht,"TH",{});var Jd=o(ur);qo=l(Jd,"Usage"),Jd.forEach(t),Ht.forEach(t),Id.forEach(t),zo=n(uo),h=s(uo,"TBODY",{});var u=o(h);Z=s(u,"TR",{});var Ct=o(Z);fr=s(Ct,"TD",{});var Bd=o(fr);Xo=l(Bd,"DPM++ 2M"),Bd.forEach(t),Go=n(Ct),pr=s(Ct,"TD",{});var Zd=o(pr);et=s(Zd,"A",{href:!0});var Vd=o(et);Qo=l(Vd,"DPMSolverMultistepScheduler"),Vd.forEach(t),Zd.forEach(t),Yo=n(Ct),Ls=s(Ct,"TD",{}),o(Ls).forEach(t),Ct.forEach(t),ea=n(u),V=s(u,"TR",{});var Ut=o(V);mr=s(Ut,"TD",{});var Fd=o(mr);ta=l(Fd,"DPM++ 2M Karras"),Fd.forEach(t),ra=n(Ut),_r=s(Ut,"TD",{});var Wd=o(_r);tt=s(Wd,"A",{href:!0});var jd=o(tt);sa=l(jd,"DPMSolverMultistepScheduler"),jd.forEach(t),Wd.forEach(t),oa=n(Ut),rt=s(Ut,"TD",{});var _d=o(rt);aa=l(_d,"init with "),vr=s(_d,"CODE",{});var qd=o(vr);la=l(qd,"use_karras_sigmas=True"),qd.forEach(t),_d.forEach(t),Ut.forEach(t),ia=n(u),F=s(u,"TR",{});var Ot=o(F);gr=s(Ot,"TD",{});var zd=o(gr);da=l(zd,"DPM++ 2M SDE"),zd.forEach(t),na=n(Ot),br=s(Ot,"TD",{});var Xd=o(br);st=s(Xd,"A",{href:!0});var Gd=o(st);ca=l(Gd,"DPMSolverMultistepScheduler"),Gd.forEach(t),Xd.forEach(t),ha=n(Ot),ot=s(Ot,"TD",{});var vd=o(ot);ua=l(vd,"init with "),Er=s(vd,"CODE",{});var Qd=o(Er);fa=l(Qd,'algorithm_type="sde-dpmsolver++"'),Qd.forEach(t),vd.forEach(t),Ot.forEach(t),pa=n(u),W=s(u,"TR",{});var Nt=o(W);Dr=s(Nt,"TD",{});var Yd=o(Dr);ma=l(Yd,"DPM++ 2M SDE Karras"),Yd.forEach(t),_a=n(Nt),Mr=s(Nt,"TD",{});var en=o(Mr);at=s(en,"A",{href:!0});var tn=o(at);va=l(tn,"DPMSolverMultistepScheduler"),tn.forEach(t),en.forEach(t),ga=n(Nt),Ee=s(Nt,"TD",{});var Cs=o(Ee);ba=l(Cs,"init with "),yr=s(Cs,"CODE",{});var rn=o(yr);Ea=l(rn,"use_karras_sigmas=True"),rn.forEach(t),Da=l(Cs," and "),Sr=s(Cs,"CODE",{});var sn=o(Sr);Ma=l(sn,'algorithm_type="sde-dpmsolver++"'),sn.forEach(t),Cs.forEach(t),Nt.forEach(t),ya=n(u),j=s(u,"TR",{});var Rt=o(j);Tr=s(Rt,"TD",{});var on=o(Tr);Sa=l(on,"DPM++ 2S a"),on.forEach(t),Ta=n(Rt),wr=s(Rt,"TD",{});var an=o(wr);wa=l(an,"N/A"),an.forEach(t),$a=n(Rt),lt=s(Rt,"TD",{});var gd=o(lt);Pa=l(gd,"very similar to  "),$r=s(gd,"CODE",{});var ln=o($r);xa=l(ln,"DPMSolverSinglestepScheduler"),ln.forEach(t),gd.forEach(t),Rt.forEach(t),ka=n(u),q=s(u,"TR",{});var It=o(q);Pr=s(It,"TD",{});var dn=o(Pr);Aa=l(dn,"DPM++ 2S a Karras"),dn.forEach(t),Ha=n(It),xr=s(It,"TD",{});var nn=o(xr);Ca=l(nn,"N/A"),nn.forEach(t),Ua=n(It),it=s(It,"TD",{});var bd=o(it);Oa=l(bd,"very similar to  "),kr=s(bd,"CODE",{});var cn=o(kr);Na=l(cn,"DPMSolverSinglestepScheduler(use_karras_sigmas=True, ...)"),cn.forEach(t),bd.forEach(t),It.forEach(t),Ra=n(u),z=s(u,"TR",{});var Lt=o(z);Ar=s(Lt,"TD",{});var hn=o(Ar);Ia=l(hn,"DPM++ SDE"),hn.forEach(t),La=n(Lt),Hr=s(Lt,"TD",{});var un=o(Hr);dt=s(un,"A",{href:!0});var fn=o(dt);Ka=l(fn,"DPMSolverSinglestepScheduler"),fn.forEach(t),un.forEach(t),Ja=n(Lt),Ks=s(Lt,"TD",{}),o(Ks).forEach(t),Lt.forEach(t),Ba=n(u),X=s(u,"TR",{});var Kt=o(X);Cr=s(Kt,"TD",{});var pn=o(Cr);Za=l(pn,"DPM++ SDE Karras"),pn.forEach(t),Va=n(Kt),Ur=s(Kt,"TD",{});var mn=o(Ur);nt=s(mn,"A",{href:!0});var _n=o(nt);Fa=l(_n,"DPMSolverSinglestepScheduler"),_n.forEach(t),mn.forEach(t),Wa=n(Kt),ct=s(Kt,"TD",{});var Ed=o(ct);ja=l(Ed,"init with "),Or=s(Ed,"CODE",{});var vn=o(Or);qa=l(vn,"use_karras_sigmas=True"),vn.forEach(t),Ed.forEach(t),Kt.forEach(t),za=n(u),G=s(u,"TR",{});var Jt=o(G);Nr=s(Jt,"TD",{});var gn=o(Nr);Xa=l(gn,"DPM2"),gn.forEach(t),Ga=n(Jt),Rr=s(Jt,"TD",{});var bn=o(Rr);ht=s(bn,"A",{href:!0});var En=o(ht);Qa=l(En,"KDPM2DiscreteScheduler"),En.forEach(t),bn.forEach(t),Ya=n(Jt),Js=s(Jt,"TD",{}),o(Js).forEach(t),Jt.forEach(t),el=n(u),Q=s(u,"TR",{});var Bt=o(Q);Ir=s(Bt,"TD",{});var Dn=o(Ir);tl=l(Dn,"DPM2 Karras"),Dn.forEach(t),rl=n(Bt),Lr=s(Bt,"TD",{});var Mn=o(Lr);ut=s(Mn,"A",{href:!0});var yn=o(ut);sl=l(yn,"KDPM2DiscreteScheduler"),yn.forEach(t),Mn.forEach(t),ol=n(Bt),ft=s(Bt,"TD",{});var Dd=o(ft);al=l(Dd,"init with "),Kr=s(Dd,"CODE",{});var Sn=o(Kr);ll=l(Sn,"use_karras_sigmas=True"),Sn.forEach(t),Dd.forEach(t),Bt.forEach(t),il=n(u),Y=s(u,"TR",{});var Zt=o(Y);Jr=s(Zt,"TD",{});var Tn=o(Jr);dl=l(Tn,"DPM2 a"),Tn.forEach(t),nl=n(Zt),Br=s(Zt,"TD",{});var wn=o(Br);pt=s(wn,"A",{href:!0});var $n=o(pt);cl=l($n,"KDPM2AncestralDiscreteScheduler"),$n.forEach(t),wn.forEach(t),hl=n(Zt),Bs=s(Zt,"TD",{}),o(Bs).forEach(t),Zt.forEach(t),ul=n(u),ee=s(u,"TR",{});var Vt=o(ee);Zr=s(Vt,"TD",{});var Pn=o(Zr);fl=l(Pn,"DPM2 a Karras"),Pn.forEach(t),pl=n(Vt),Vr=s(Vt,"TD",{});var xn=o(Vr);mt=s(xn,"A",{href:!0});var kn=o(mt);ml=l(kn,"KDPM2AncestralDiscreteScheduler"),kn.forEach(t),xn.forEach(t),_l=n(Vt),_t=s(Vt,"TD",{});var Md=o(_t);vl=l(Md,"init with "),Fr=s(Md,"CODE",{});var An=o(Fr);gl=l(An,"use_karras_sigmas=True"),An.forEach(t),Md.forEach(t),Vt.forEach(t),bl=n(u),te=s(u,"TR",{});var Ft=o(te);Wr=s(Ft,"TD",{});var Hn=o(Wr);El=l(Hn,"DPM adaptive"),Hn.forEach(t),Dl=n(Ft),jr=s(Ft,"TD",{});var Cn=o(jr);Ml=l(Cn,"N/A"),Cn.forEach(t),yl=n(Ft),Zs=s(Ft,"TD",{}),o(Zs).forEach(t),Ft.forEach(t),Sl=n(u),re=s(u,"TR",{});var Wt=o(re);qr=s(Wt,"TD",{});var Un=o(qr);Tl=l(Un,"DPM fast"),Un.forEach(t),wl=n(Wt),zr=s(Wt,"TD",{});var On=o(zr);$l=l(On,"N/A"),On.forEach(t),Pl=n(Wt),Vs=s(Wt,"TD",{}),o(Vs).forEach(t),Wt.forEach(t),xl=n(u),se=s(u,"TR",{});var jt=o(se);Xr=s(jt,"TD",{});var Nn=o(Xr);kl=l(Nn,"Euler"),Nn.forEach(t),Al=n(jt),Gr=s(jt,"TD",{});var Rn=o(Gr);vt=s(Rn,"A",{href:!0});var In=o(vt);Hl=l(In,"EulerDiscreteScheduler"),In.forEach(t),Rn.forEach(t),Cl=n(jt),Fs=s(jt,"TD",{}),o(Fs).forEach(t),jt.forEach(t),Ul=n(u),oe=s(u,"TR",{});var qt=o(oe);Qr=s(qt,"TD",{});var Ln=o(Qr);Ol=l(Ln,"Euler a"),Ln.forEach(t),Nl=n(qt),Yr=s(qt,"TD",{});var Kn=o(Yr);gt=s(Kn,"A",{href:!0});var Jn=o(gt);Rl=l(Jn,"EulerAncestralDiscreteScheduler"),Jn.forEach(t),Kn.forEach(t),Il=n(qt),Ws=s(qt,"TD",{}),o(Ws).forEach(t),qt.forEach(t),Ll=n(u),ae=s(u,"TR",{});var zt=o(ae);es=s(zt,"TD",{});var Bn=o(es);Kl=l(Bn,"Heun"),Bn.forEach(t),Jl=n(zt),ts=s(zt,"TD",{});var Zn=o(ts);bt=s(Zn,"A",{href:!0});var Vn=o(bt);Bl=l(Vn,"HeunDiscreteScheduler"),Vn.forEach(t),Zn.forEach(t),Zl=n(zt),js=s(zt,"TD",{}),o(js).forEach(t),zt.forEach(t),Vl=n(u),le=s(u,"TR",{});var Xt=o(le);rs=s(Xt,"TD",{});var Fn=o(rs);Fl=l(Fn,"LMS"),Fn.forEach(t),Wl=n(Xt),ss=s(Xt,"TD",{});var Wn=o(ss);Et=s(Wn,"A",{href:!0});var jn=o(Et);jl=l(jn,"LMSDiscreteScheduler"),jn.forEach(t),Wn.forEach(t),ql=n(Xt),qs=s(Xt,"TD",{}),o(qs).forEach(t),Xt.forEach(t),zl=n(u),ie=s(u,"TR",{});var Gt=o(ie);os=s(Gt,"TD",{});var qn=o(os);Xl=l(qn,"LMS Karras"),qn.forEach(t),Gl=n(Gt),as=s(Gt,"TD",{});var zn=o(as);Dt=s(zn,"A",{href:!0});var Xn=o(Dt);Ql=l(Xn,"LMSDiscreteScheduler"),Xn.forEach(t),zn.forEach(t),Yl=n(Gt),Mt=s(Gt,"TD",{});var yd=o(Mt);ei=l(yd,"init with "),ls=s(yd,"CODE",{});var Gn=o(ls);ti=l(Gn,"use_karras_sigmas=True"),Gn.forEach(t),yd.forEach(t),Gt.forEach(t),ri=n(u),de=s(u,"TR",{});var Qt=o(de);is=s(Qt,"TD",{});var Qn=o(is);si=l(Qn,"N/A"),Qn.forEach(t),oi=n(Qt),ds=s(Qt,"TD",{});var Yn=o(ds);yt=s(Yn,"A",{href:!0});var ec=o(yt);ai=l(ec,"DEISMultistepScheduler"),ec.forEach(t),Yn.forEach(t),li=n(Qt),zs=s(Qt,"TD",{}),o(zs).forEach(t),Qt.forEach(t),ii=n(u),ne=s(u,"TR",{});var Yt=o(ne);ns=s(Yt,"TD",{});var tc=o(ns);di=l(tc,"N/A"),tc.forEach(t),ni=n(Yt),cs=s(Yt,"TD",{});var rc=o(cs);St=s(rc,"A",{href:!0});var sc=o(St);ci=l(sc,"UniPCMultistepScheduler"),sc.forEach(t),rc.forEach(t),hi=n(Yt),Xs=s(Yt,"TD",{}),o(Xs).forEach(t),Yt.forEach(t),u.forEach(t),uo.forEach(t),Gs=n(i),De=s(i,"P",{});var fo=o(De);ui=l(fo,"All schedulers are built from the base "),Tt=s(fo,"A",{href:!0});var oc=o(Tt);fi=l(oc,"SchedulerMixin"),oc.forEach(t),pi=l(fo," class which implements low level utilities shared by all schedulers."),fo.forEach(t),Qs=n(i),ce=s(i,"H2",{class:!0});var po=o(ce);Me=s(po,"A",{id:!0,class:!0,href:!0});var ac=o(Me);hs=s(ac,"SPAN",{});var lc=o(hs);w(Ue.$$.fragment,lc),lc.forEach(t),ac.forEach(t),mi=n(po),us=s(po,"SPAN",{});var ic=o(us);_i=l(ic,"SchedulerMixin"),ic.forEach(t),po.forEach(t),Ys=n(i),g=s(i,"DIV",{class:!0});var M=o(g);w(Oe.$$.fragment,M),vi=n(M),fs=s(M,"P",{});var dc=o(fs);gi=l(dc,"Base class for all schedulers."),dc.forEach(t),bi=n(M),wt=s(M,"P",{});var Sd=o(wt);$t=s(Sd,"A",{href:!0});var nc=o($t);Ei=l(nc,"SchedulerMixin"),nc.forEach(t),Di=l(Sd,` contains common functions shared by all schedulers such as general loading and saving
functionalities.`),Sd.forEach(t),Mi=n(M),H=s(M,"P",{});var me=o(H);Pt=s(me,"A",{href:!0});var cc=o(Pt);yi=l(cc,"ConfigMixin"),cc.forEach(t),Si=l(me," takes care of storing the configuration attributes (like "),ps=s(me,"CODE",{});var hc=o(ps);Ti=l(hc,"num_train_timesteps"),hc.forEach(t),wi=l(me,`) that are passed to
the scheduler\u2019s `),ms=s(me,"CODE",{});var uc=o(ms);$i=l(uc,"__init__"),uc.forEach(t),Pi=l(me," function, and the attributes can be accessed by "),_s=s(me,"CODE",{});var fc=o(_s);xi=l(fc,"scheduler.config.num_train_timesteps"),fc.forEach(t),ki=l(me,"."),me.forEach(t),Ai=n(M),vs=s(M,"P",{});var pc=o(vs);Hi=l(pc,"Class attributes:"),pc.forEach(t),Ci=n(M),gs=s(M,"UL",{});var mc=o(gs);R=s(mc,"LI",{});var ze=o(R);bs=s(ze,"STRONG",{});var _c=o(bs);Ui=l(_c,"_compatibles"),_c.forEach(t),Oi=l(ze," ("),Es=s(ze,"CODE",{});var vc=o(Es);Ni=l(vc,"List[str]"),vc.forEach(t),Ri=l(ze,`) \u2014 A list of scheduler classes that are compatible with the parent scheduler
class. Use `),xt=s(ze,"A",{href:!0});var gc=o(xt);Ii=l(gc,"from_config()"),gc.forEach(t),Li=l(ze,` to load a different compatible scheduler class (should be overridden
by parent class).`),ze.forEach(t),mc.forEach(t),Ki=n(M),I=s(M,"DIV",{class:!0});var er=o(I);w(Ne.$$.fragment,er),Ji=n(er),Ds=s(er,"P",{});var bc=o(Ds);Bi=l(bc,"Instantiate a scheduler from a pre-defined JSON configuration file in a local directory or Hub repository."),bc.forEach(t),Zi=n(er),w(ye.$$.fragment,er),er.forEach(t),Vi=n(M),Se=s(M,"DIV",{class:!0});var mo=o(Se);w(Re.$$.fragment,mo),Fi=n(mo),Ie=s(mo,"P",{});var _o=o(Ie);Wi=l(_o,`Save a scheduler configuration object to a directory so that it can be reloaded using the
`),kt=s(_o,"A",{href:!0});var Ec=o(kt);ji=l(Ec,"from_pretrained()"),Ec.forEach(t),qi=l(_o," class method."),_o.forEach(t),mo.forEach(t),M.forEach(t),eo=n(i),he=s(i,"H2",{class:!0});var vo=o(he);Te=s(vo,"A",{id:!0,class:!0,href:!0});var Dc=o(Te);Ms=s(Dc,"SPAN",{});var Mc=o(Ms);w(Le.$$.fragment,Mc),Mc.forEach(t),Dc.forEach(t),zi=n(vo),ys=s(vo,"SPAN",{});var yc=o(ys);Xi=l(yc,"SchedulerOutput"),yc.forEach(t),vo.forEach(t),to=n(i),ue=s(i,"DIV",{class:!0});var go=o(ue);w(Ke.$$.fragment,go),Gi=n(go),Je=s(go,"P",{});var bo=o(Je);Qi=l(bo,"Base class for the output of a scheduler\u2019s "),Ss=s(bo,"CODE",{});var Sc=o(Ss);Yi=l(Sc,"step"),Sc.forEach(t),ed=l(bo," function."),bo.forEach(t),go.forEach(t),ro=n(i),fe=s(i,"H2",{class:!0});var Eo=o(fe);we=s(Eo,"A",{id:!0,class:!0,href:!0});var Tc=o(we);Ts=s(Tc,"SPAN",{});var wc=o(Ts);w(Be.$$.fragment,wc),wc.forEach(t),Tc.forEach(t),td=n(Eo),ws=s(Eo,"SPAN",{});var $c=o(ws);rd=l($c,"KarrasDiffusionSchedulers"),$c.forEach(t),Eo.forEach(t),so=n(i),Ze=s(i,"P",{});var Td=o(Ze);$s=s(Td,"CODE",{});var Pc=o($s);sd=l(Pc,"KarrasDiffusionSchedulers"),Pc.forEach(t),od=l(Td," are a broad generalization of schedulers in \u{1F917} Diffusers. The schedulers in this class are distinguished at a high level by their noise sampling strategy, the type of network and scaling, the training strategy, and how the loss is weighed."),Td.forEach(t),oo=n(i),$e=s(i,"P",{});var Do=o($e);ad=l(Do,"The different schedulers in this class, depending on the ordinary differential equations (ODE) solver type, fall into the above taxonomy and provide a good abstraction for the design of the main schedulers implemented in \u{1F917} Diffusers. The schedulers in this class are given "),Ve=s(Do,"A",{href:!0,rel:!0});var xc=o(Ve);ld=l(xc,"here"),xc.forEach(t),id=l(Do,"."),Do.forEach(t),ao=n(i),pe=s(i,"H2",{class:!0});var Mo=o(pe);Pe=s(Mo,"A",{id:!0,class:!0,href:!0});var kc=o(Pe);Ps=s(kc,"SPAN",{});var Ac=o(Ps);w(Fe.$$.fragment,Ac),Ac.forEach(t),kc.forEach(t),dd=n(Mo),xs=s(Mo,"SPAN",{});var Hc=o(xs);nd=l(Hc,"PushToHubMixin"),Hc.forEach(t),Mo.forEach(t),lo=n(i),O=s(i,"DIV",{class:!0});var tr=o(O);w(We.$$.fragment,tr),cd=n(tr),ks=s(tr,"P",{});var Cc=o(ks);hd=l(Cc,"A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub."),Cc.forEach(t),ud=n(tr),L=s(tr,"DIV",{class:!0});var rr=o(L);w(je.$$.fragment,rr),fd=n(rr),As=s(rr,"P",{});var Uc=o(As);pd=l(Uc,"Upload model, scheduler, or pipeline files to the \u{1F917} Hugging Face Hub."),Uc.forEach(t),md=n(rr),w(xe.$$.fragment,rr),rr.forEach(t),tr.forEach(t),this.h()},h(){c(m,"name","hf:doc:metadata"),c(m,"content",JSON.stringify(jc)),c(b,"id","schedulers"),c(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"),c(b,"href","#schedulers"),c(v,"class","relative group"),c(He,"href","https://github.com/crowsonkb/k-diffusion"),c(He,"rel","nofollow"),c(Ce,"href","https://github.com/crowsonkb/"),c(Ce,"rel","nofollow"),c(et,"href","/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler"),c(tt,"href","/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler"),c(st,"href","/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler"),c(at,"href","/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler"),c(dt,"href","/docs/diffusers/main/en/api/schedulers/singlestep_dpm_solver#diffusers.DPMSolverSinglestepScheduler"),c(nt,"href","/docs/diffusers/main/en/api/schedulers/singlestep_dpm_solver#diffusers.DPMSolverSinglestepScheduler"),c(ht,"href","/docs/diffusers/main/en/api/schedulers/dpm_discrete#diffusers.KDPM2DiscreteScheduler"),c(ut,"href","/docs/diffusers/main/en/api/schedulers/dpm_discrete#diffusers.KDPM2DiscreteScheduler"),c(pt,"href","/docs/diffusers/main/en/api/schedulers/dpm_discrete_ancestral#diffusers.KDPM2AncestralDiscreteScheduler"),c(mt,"href","/docs/diffusers/main/en/api/schedulers/dpm_discrete_ancestral#diffusers.KDPM2AncestralDiscreteScheduler"),c(vt,"href","/docs/diffusers/main/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),c(gt,"href","/docs/diffusers/main/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler"),c(bt,"href","/docs/diffusers/main/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler"),c(Et,"href","/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler"),c(Dt,"href","/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler"),c(yt,"href","/docs/diffusers/main/en/api/schedulers/deis#diffusers.DEISMultistepScheduler"),c(St,"href","/docs/diffusers/main/en/api/schedulers/unipc#diffusers.UniPCMultistepScheduler"),c(Tt,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),c(Me,"id","diffusers.SchedulerMixin"),c(Me,"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"),c(Me,"href","#diffusers.SchedulerMixin"),c(ce,"class","relative group"),c($t,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),c(Pt,"href","/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin"),c(xt,"href","/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.from_config"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(kt,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),c(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Te,"id","diffusers.schedulers.scheduling_utils.SchedulerOutput"),c(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"),c(Te,"href","#diffusers.schedulers.scheduling_utils.SchedulerOutput"),c(he,"class","relative group"),c(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(we,"id","karrasdiffusionschedulers"),c(we,"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"),c(we,"href","#karrasdiffusionschedulers"),c(fe,"class","relative group"),c(Ve,"href","https://github.com/huggingface/diffusers/blob/a69754bb879ed55b9b6dc9dd0b3cf4fa4124c765/src/diffusers/schedulers/scheduling_utils.py#L32"),c(Ve,"rel","nofollow"),c(Pe,"id","diffusers.utils.PushToHubMixin"),c(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"),c(Pe,"href","#diffusers.utils.PushToHubMixin"),c(pe,"class","relative group"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,f){e(document.head,m),p(i,A,f),p(i,v,f),e(v,b),e(b,y),$(_,y,null),e(v,S),e(v,K),e(K,U),p(i,_e,f),p(i,E,f),e(E,J),e(E,D),e(D,Ge),e(E,Qe),e(E,ve),e(ve,yo),e(E,So),e(E,or),e(or,To),e(E,wo),e(E,ar),e(ar,$o),e(E,Po),e(E,lr),e(lr,xo),e(E,ko),p(i,Os,f),p(i,Ye,f),e(Ye,Ao),p(i,Ns,f),p(i,ge,f),e(ge,ke),e(ke,Ho),e(ke,ir),e(ir,Co),e(ke,Uo),e(ge,Oo),e(ge,Ae),e(Ae,No),e(Ae,dr),e(dr,Ro),e(Ae,Io),p(i,Rs,f),p(i,N,f),e(N,Lo),e(N,He),e(He,Ko),e(N,Jo),e(N,Ce),e(Ce,Bo),e(N,Zo),p(i,Is,f),p(i,be,f),e(be,nr),e(nr,B),e(B,cr),e(cr,Vo),e(B,Fo),e(B,hr),e(hr,Wo),e(B,jo),e(B,ur),e(ur,qo),e(be,zo),e(be,h),e(h,Z),e(Z,fr),e(fr,Xo),e(Z,Go),e(Z,pr),e(pr,et),e(et,Qo),e(Z,Yo),e(Z,Ls),e(h,ea),e(h,V),e(V,mr),e(mr,ta),e(V,ra),e(V,_r),e(_r,tt),e(tt,sa),e(V,oa),e(V,rt),e(rt,aa),e(rt,vr),e(vr,la),e(h,ia),e(h,F),e(F,gr),e(gr,da),e(F,na),e(F,br),e(br,st),e(st,ca),e(F,ha),e(F,ot),e(ot,ua),e(ot,Er),e(Er,fa),e(h,pa),e(h,W),e(W,Dr),e(Dr,ma),e(W,_a),e(W,Mr),e(Mr,at),e(at,va),e(W,ga),e(W,Ee),e(Ee,ba),e(Ee,yr),e(yr,Ea),e(Ee,Da),e(Ee,Sr),e(Sr,Ma),e(h,ya),e(h,j),e(j,Tr),e(Tr,Sa),e(j,Ta),e(j,wr),e(wr,wa),e(j,$a),e(j,lt),e(lt,Pa),e(lt,$r),e($r,xa),e(h,ka),e(h,q),e(q,Pr),e(Pr,Aa),e(q,Ha),e(q,xr),e(xr,Ca),e(q,Ua),e(q,it),e(it,Oa),e(it,kr),e(kr,Na),e(h,Ra),e(h,z),e(z,Ar),e(Ar,Ia),e(z,La),e(z,Hr),e(Hr,dt),e(dt,Ka),e(z,Ja),e(z,Ks),e(h,Ba),e(h,X),e(X,Cr),e(Cr,Za),e(X,Va),e(X,Ur),e(Ur,nt),e(nt,Fa),e(X,Wa),e(X,ct),e(ct,ja),e(ct,Or),e(Or,qa),e(h,za),e(h,G),e(G,Nr),e(Nr,Xa),e(G,Ga),e(G,Rr),e(Rr,ht),e(ht,Qa),e(G,Ya),e(G,Js),e(h,el),e(h,Q),e(Q,Ir),e(Ir,tl),e(Q,rl),e(Q,Lr),e(Lr,ut),e(ut,sl),e(Q,ol),e(Q,ft),e(ft,al),e(ft,Kr),e(Kr,ll),e(h,il),e(h,Y),e(Y,Jr),e(Jr,dl),e(Y,nl),e(Y,Br),e(Br,pt),e(pt,cl),e(Y,hl),e(Y,Bs),e(h,ul),e(h,ee),e(ee,Zr),e(Zr,fl),e(ee,pl),e(ee,Vr),e(Vr,mt),e(mt,ml),e(ee,_l),e(ee,_t),e(_t,vl),e(_t,Fr),e(Fr,gl),e(h,bl),e(h,te),e(te,Wr),e(Wr,El),e(te,Dl),e(te,jr),e(jr,Ml),e(te,yl),e(te,Zs),e(h,Sl),e(h,re),e(re,qr),e(qr,Tl),e(re,wl),e(re,zr),e(zr,$l),e(re,Pl),e(re,Vs),e(h,xl),e(h,se),e(se,Xr),e(Xr,kl),e(se,Al),e(se,Gr),e(Gr,vt),e(vt,Hl),e(se,Cl),e(se,Fs),e(h,Ul),e(h,oe),e(oe,Qr),e(Qr,Ol),e(oe,Nl),e(oe,Yr),e(Yr,gt),e(gt,Rl),e(oe,Il),e(oe,Ws),e(h,Ll),e(h,ae),e(ae,es),e(es,Kl),e(ae,Jl),e(ae,ts),e(ts,bt),e(bt,Bl),e(ae,Zl),e(ae,js),e(h,Vl),e(h,le),e(le,rs),e(rs,Fl),e(le,Wl),e(le,ss),e(ss,Et),e(Et,jl),e(le,ql),e(le,qs),e(h,zl),e(h,ie),e(ie,os),e(os,Xl),e(ie,Gl),e(ie,as),e(as,Dt),e(Dt,Ql),e(ie,Yl),e(ie,Mt),e(Mt,ei),e(Mt,ls),e(ls,ti),e(h,ri),e(h,de),e(de,is),e(is,si),e(de,oi),e(de,ds),e(ds,yt),e(yt,ai),e(de,li),e(de,zs),e(h,ii),e(h,ne),e(ne,ns),e(ns,di),e(ne,ni),e(ne,cs),e(cs,St),e(St,ci),e(ne,hi),e(ne,Xs),p(i,Gs,f),p(i,De,f),e(De,ui),e(De,Tt),e(Tt,fi),e(De,pi),p(i,Qs,f),p(i,ce,f),e(ce,Me),e(Me,hs),$(Ue,hs,null),e(ce,mi),e(ce,us),e(us,_i),p(i,Ys,f),p(i,g,f),$(Oe,g,null),e(g,vi),e(g,fs),e(fs,gi),e(g,bi),e(g,wt),e(wt,$t),e($t,Ei),e(wt,Di),e(g,Mi),e(g,H),e(H,Pt),e(Pt,yi),e(H,Si),e(H,ps),e(ps,Ti),e(H,wi),e(H,ms),e(ms,$i),e(H,Pi),e(H,_s),e(_s,xi),e(H,ki),e(g,Ai),e(g,vs),e(vs,Hi),e(g,Ci),e(g,gs),e(gs,R),e(R,bs),e(bs,Ui),e(R,Oi),e(R,Es),e(Es,Ni),e(R,Ri),e(R,xt),e(xt,Ii),e(R,Li),e(g,Ki),e(g,I),$(Ne,I,null),e(I,Ji),e(I,Ds),e(Ds,Bi),e(I,Zi),$(ye,I,null),e(g,Vi),e(g,Se),$(Re,Se,null),e(Se,Fi),e(Se,Ie),e(Ie,Wi),e(Ie,kt),e(kt,ji),e(Ie,qi),p(i,eo,f),p(i,he,f),e(he,Te),e(Te,Ms),$(Le,Ms,null),e(he,zi),e(he,ys),e(ys,Xi),p(i,to,f),p(i,ue,f),$(Ke,ue,null),e(ue,Gi),e(ue,Je),e(Je,Qi),e(Je,Ss),e(Ss,Yi),e(Je,ed),p(i,ro,f),p(i,fe,f),e(fe,we),e(we,Ts),$(Be,Ts,null),e(fe,td),e(fe,ws),e(ws,rd),p(i,so,f),p(i,Ze,f),e(Ze,$s),e($s,sd),e(Ze,od),p(i,oo,f),p(i,$e,f),e($e,ad),e($e,Ve),e(Ve,ld),e($e,id),p(i,ao,f),p(i,pe,f),e(pe,Pe),e(Pe,Ps),$(Fe,Ps,null),e(pe,dd),e(pe,xs),e(xs,nd),p(i,lo,f),p(i,O,f),$(We,O,null),e(O,cd),e(O,ks),e(ks,hd),e(O,ud),e(O,L),$(je,L,null),e(L,fd),e(L,As),e(As,pd),e(L,md),$(xe,L,null),io=!0},p(i,[f]){const qe={};f&2&&(qe.$$scope={dirty:f,ctx:i}),ye.$set(qe);const Hs={};f&2&&(Hs.$$scope={dirty:f,ctx:i}),xe.$set(Hs)},i(i){io||(P(_.$$.fragment,i),P(Ue.$$.fragment,i),P(Oe.$$.fragment,i),P(Ne.$$.fragment,i),P(ye.$$.fragment,i),P(Re.$$.fragment,i),P(Le.$$.fragment,i),P(Ke.$$.fragment,i),P(Be.$$.fragment,i),P(Fe.$$.fragment,i),P(We.$$.fragment,i),P(je.$$.fragment,i),P(xe.$$.fragment,i),io=!0)},o(i){x(_.$$.fragment,i),x(Ue.$$.fragment,i),x(Oe.$$.fragment,i),x(Ne.$$.fragment,i),x(ye.$$.fragment,i),x(Re.$$.fragment,i),x(Le.$$.fragment,i),x(Ke.$$.fragment,i),x(Be.$$.fragment,i),x(Fe.$$.fragment,i),x(We.$$.fragment,i),x(je.$$.fragment,i),x(xe.$$.fragment,i),io=!1},d(i){t(m),i&&t(A),i&&t(v),k(_),i&&t(_e),i&&t(E),i&&t(Os),i&&t(Ye),i&&t(Ns),i&&t(ge),i&&t(Rs),i&&t(N),i&&t(Is),i&&t(be),i&&t(Gs),i&&t(De),i&&t(Qs),i&&t(ce),k(Ue),i&&t(Ys),i&&t(g),k(Oe),k(Ne),k(ye),k(Re),i&&t(eo),i&&t(he),k(Le),i&&t(to),i&&t(ue),k(Ke),i&&t(ro),i&&t(fe),k(Be),i&&t(so),i&&t(Ze),i&&t(oo),i&&t($e),i&&t(ao),i&&t(pe),k(Fe),i&&t(lo),i&&t(O),k(We),k(je),k(xe)}}}const jc={local:"schedulers",sections:[{local:"diffusers.SchedulerMixin",title:"SchedulerMixin"},{local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",title:"SchedulerOutput"},{local:"karrasdiffusionschedulers",title:"KarrasDiffusionSchedulers"},{local:"diffusers.utils.PushToHubMixin",title:"PushToHubMixin"}],title:"Schedulers"};function qc(Xe){return Lc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class th extends Oc{constructor(m){super();Nc(this,m,qc,Wc,Rc,{})}}export{th as default,jc as metadata};
