import{S as kt,i as Mt,s as Tt,e as n,k as u,w as V,t as o,M as At,c as a,d as r,m as h,a as s,x as J,h as i,b as d,G as e,g as v,y as U,L as Ct,q as W,o as j,B as z,v as Ft}from"../../../chunks/vendor-hf-doc-builder.js";import{D as nt}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as at}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Ot(st){let _,ie,b,w,K,E,_e,Q,be,de,P,$,X,D,Pe,Y,ye,le,g,we,N,$e,xe,k,Se,Re,M,Ee,ce,y,x,Z,T,De,ee,ke,pe,c,A,Me,te,Te,Ae,l,L,Ce,Fe,re,Oe,Ie,ne,Ne,Le,ae,qe,Be,q,Ge,He,B,Ve,Je,G,Ue,We,je,H,ze,C,Ke,Qe,S,F,Xe,se,Ye,Ze,R,O,et,oe,tt,ue;return E=new at({}),D=new at({}),T=new at({}),A=new nt({props:{name:"class diffusers.RePaintScheduler",anchor:"diffusers.RePaintScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.0001"},{name:"beta_end",val:": float = 0.02"},{name:"beta_schedule",val:": str = 'linear'"},{name:"eta",val:": float = 0.0"},{name:"trained_betas",val:": typing.Optional[numpy.ndarray] = None"},{name:"clip_sample",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.RePaintScheduler.num_train_timesteps",description:"<strong>num_train_timesteps</strong> (<code>int</code>) &#x2014; number of diffusion steps used to train the model.",name:"num_train_timesteps"},{anchor:"diffusers.RePaintScheduler.beta_start",description:"<strong>beta_start</strong> (<code>float</code>) &#x2014; the starting <code>beta</code> value of inference.",name:"beta_start"},{anchor:"diffusers.RePaintScheduler.beta_end",description:"<strong>beta_end</strong> (<code>float</code>) &#x2014; the final <code>beta</code> value.",name:"beta_end"},{anchor:"diffusers.RePaintScheduler.beta_schedule",description:`<strong>beta_schedule</strong> (<code>str</code>) &#x2014;
the beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from
<code>linear</code>, <code>scaled_linear</code>, <code>squaredcos_cap_v2</code> or <code>sigmoid</code>.`,name:"beta_schedule"},{anchor:"diffusers.RePaintScheduler.eta",description:`<strong>eta</strong> (<code>float</code>) &#x2014;
The weight of noise for added noise in a diffusion step. Its value is between 0.0 and 1.0 -0.0 is DDIM and
1.0 is DDPM scheduler respectively.`,name:"eta"},{anchor:"diffusers.RePaintScheduler.trained_betas",description:`<strong>trained_betas</strong> (<code>np.ndarray</code>, optional) &#x2014;
option to pass an array of betas directly to the constructor to bypass <code>beta_start</code>, <code>beta_end</code> etc.`,name:"trained_betas"},{anchor:"diffusers.RePaintScheduler.variance_type",description:`<strong>variance_type</strong> (<code>str</code>) &#x2014;
options to clip the variance used when adding noise to the denoised sample. Choose from <code>fixed_small</code>,
<code>fixed_small_log</code>, <code>fixed_large</code>, <code>fixed_large_log</code>, <code>learned</code> or <code>learned_range</code>.`,name:"variance_type"},{anchor:"diffusers.RePaintScheduler.clip_sample",description:`<strong>clip_sample</strong> (<code>bool</code>, default <code>True</code>) &#x2014;
option to clip predicted sample between -1 and 1 for numerical stability.`,name:"clip_sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_repaint.py#L90"}}),F=new nt({props:{name:"scale_model_input",anchor:"diffusers.RePaintScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.RePaintScheduler.scale_model_input.sample",description:"<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014; input sample",name:"sample"},{anchor:"diffusers.RePaintScheduler.scale_model_input.timestep",description:"<strong>timestep</strong> (<code>int</code>, optional) &#x2014; current timestep",name:"timestep"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_repaint.py#L168",returnDescription:`
<p>scaled input sample</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),O=new nt({props:{name:"step",anchor:"diffusers.RePaintScheduler.step",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"sample",val:": FloatTensor"},{name:"original_image",val:": FloatTensor"},{name:"mask",val:": FloatTensor"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.RePaintScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014; direct output from learned
diffusion model.`,name:"model_output"},{anchor:"diffusers.RePaintScheduler.step.timestep",description:"<strong>timestep</strong> (<code>int</code>) &#x2014; current discrete timestep in the diffusion chain.",name:"timestep"},{anchor:"diffusers.RePaintScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
current instance of sample being created by diffusion process.`,name:"sample"},{anchor:"diffusers.RePaintScheduler.step.original_image",description:`<strong>original_image</strong> (<code>torch.FloatTensor</code>) &#x2014;
the original image to inpaint on.`,name:"original_image"},{anchor:"diffusers.RePaintScheduler.step.mask",description:`<strong>mask</strong> (<code>torch.FloatTensor</code>) &#x2014;
the mask where 0.0 values define which part of the original image to inpaint (change).`,name:"mask"},{anchor:"diffusers.RePaintScheduler.step.generator",description:"<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014; random number generator.",name:"generator"},{anchor:"diffusers.RePaintScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) &#x2014; option for returning tuple rather than
DDPMSchedulerOutput class`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_repaint.py#L231",returnDescription:`
<p><code>~schedulers.scheduling_utils.RePaintSchedulerOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple</code>. When
returning a tuple, the first element is the sample tensor.</p>
`,returnType:`
<p><code>~schedulers.scheduling_utils.RePaintSchedulerOutput</code> or <code>tuple</code></p>
`}}),{c(){_=n("meta"),ie=u(),b=n("h1"),w=n("a"),K=n("span"),V(E.$$.fragment),_e=u(),Q=n("span"),be=o("RePaint scheduler"),de=u(),P=n("h2"),$=n("a"),X=n("span"),V(D.$$.fragment),Pe=u(),Y=n("span"),ye=o("Overview"),le=u(),g=n("p"),we=o(`DDPM-based inpainting scheduler for unsupervised inpainting with extreme masks.
Intended for use with `),N=n("a"),$e=o("RePaintPipeline"),xe=o(`.
Based on the paper `),k=n("a"),Se=o("RePaint: Inpainting using Denoising Diffusion Probabilistic Models"),Re=o(`
and the original implementation by Andreas Lugmayr et al.: `),M=n("a"),Ee=o("https://github.com/andreas128/RePaint"),ce=u(),y=n("h2"),x=n("a"),Z=n("span"),V(T.$$.fragment),De=u(),ee=n("span"),ke=o("RePaintScheduler"),pe=u(),c=n("div"),V(A.$$.fragment),Me=u(),te=n("p"),Te=o("RePaint is a schedule for DDPM inpainting inside a given mask."),Ae=u(),l=n("p"),L=n("a"),Ce=o("~ConfigMixin"),Fe=o(" takes care of storing all config attributes that are passed in the scheduler\u2019s "),re=n("code"),Oe=o("__init__"),Ie=o(`
function, such as `),ne=n("code"),Ne=o("num_train_timesteps"),Le=o(". They can be accessed via "),ae=n("code"),qe=o("scheduler.config.num_train_timesteps"),Be=o(`.
`),q=n("a"),Ge=o("SchedulerMixin"),He=o(" provides general loading and saving functionality via the "),B=n("a"),Ve=o("SchedulerMixin.save_pretrained()"),Je=o(` and
`),G=n("a"),Ue=o("from_pretrained()"),We=o(" functions."),je=u(),H=n("p"),ze=o("For more details, see the original paper: "),C=n("a"),Ke=o("https://arxiv.org/pdf/2201.09865.pdf"),Qe=u(),S=n("div"),V(F.$$.fragment),Xe=u(),se=n("p"),Ye=o(`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),Ze=u(),R=n("div"),V(O.$$.fragment),et=u(),oe=n("p"),tt=o(`Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion
process from the learned model outputs (most often the predicted noise).`),this.h()},l(t){const f=At('[data-svelte="svelte-1phssyn"]',document.head);_=a(f,"META",{name:!0,content:!0}),f.forEach(r),ie=h(t),b=a(t,"H1",{class:!0});var he=s(b);w=a(he,"A",{id:!0,class:!0,href:!0});var ot=s(w);K=a(ot,"SPAN",{});var it=s(K);J(E.$$.fragment,it),it.forEach(r),ot.forEach(r),_e=h(he),Q=a(he,"SPAN",{});var dt=s(Q);be=i(dt,"RePaint scheduler"),dt.forEach(r),he.forEach(r),de=h(t),P=a(t,"H2",{class:!0});var fe=s(P);$=a(fe,"A",{id:!0,class:!0,href:!0});var lt=s($);X=a(lt,"SPAN",{});var ct=s(X);J(D.$$.fragment,ct),ct.forEach(r),lt.forEach(r),Pe=h(fe),Y=a(fe,"SPAN",{});var pt=s(Y);ye=i(pt,"Overview"),pt.forEach(r),fe.forEach(r),le=h(t),g=a(t,"P",{});var I=s(g);we=i(I,`DDPM-based inpainting scheduler for unsupervised inpainting with extreme masks.
Intended for use with `),N=a(I,"A",{href:!0});var ut=s(N);$e=i(ut,"RePaintPipeline"),ut.forEach(r),xe=i(I,`.
Based on the paper `),k=a(I,"A",{href:!0,rel:!0});var ht=s(k);Se=i(ht,"RePaint: Inpainting using Denoising Diffusion Probabilistic Models"),ht.forEach(r),Re=i(I,`
and the original implementation by Andreas Lugmayr et al.: `),M=a(I,"A",{href:!0,rel:!0});var ft=s(M);Ee=i(ft,"https://github.com/andreas128/RePaint"),ft.forEach(r),I.forEach(r),ce=h(t),y=a(t,"H2",{class:!0});var me=s(y);x=a(me,"A",{id:!0,class:!0,href:!0});var mt=s(x);Z=a(mt,"SPAN",{});var gt=s(Z);J(T.$$.fragment,gt),gt.forEach(r),mt.forEach(r),De=h(me),ee=a(me,"SPAN",{});var vt=s(ee);ke=i(vt,"RePaintScheduler"),vt.forEach(r),me.forEach(r),pe=h(t),c=a(t,"DIV",{class:!0});var m=s(c);J(A.$$.fragment,m),Me=h(m),te=a(m,"P",{});var _t=s(te);Te=i(_t,"RePaint is a schedule for DDPM inpainting inside a given mask."),_t.forEach(r),Ae=h(m),l=a(m,"P",{});var p=s(l);L=a(p,"A",{href:!0});var bt=s(L);Ce=i(bt,"~ConfigMixin"),bt.forEach(r),Fe=i(p," takes care of storing all config attributes that are passed in the scheduler\u2019s "),re=a(p,"CODE",{});var Pt=s(re);Oe=i(Pt,"__init__"),Pt.forEach(r),Ie=i(p,`
function, such as `),ne=a(p,"CODE",{});var yt=s(ne);Ne=i(yt,"num_train_timesteps"),yt.forEach(r),Le=i(p,". They can be accessed via "),ae=a(p,"CODE",{});var wt=s(ae);qe=i(wt,"scheduler.config.num_train_timesteps"),wt.forEach(r),Be=i(p,`.
`),q=a(p,"A",{href:!0});var $t=s(q);Ge=i($t,"SchedulerMixin"),$t.forEach(r),He=i(p," provides general loading and saving functionality via the "),B=a(p,"A",{href:!0});var xt=s(B);Ve=i(xt,"SchedulerMixin.save_pretrained()"),xt.forEach(r),Je=i(p,` and
`),G=a(p,"A",{href:!0});var St=s(G);Ue=i(St,"from_pretrained()"),St.forEach(r),We=i(p," functions."),p.forEach(r),je=h(m),H=a(m,"P",{});var rt=s(H);ze=i(rt,"For more details, see the original paper: "),C=a(rt,"A",{href:!0,rel:!0});var Rt=s(C);Ke=i(Rt,"https://arxiv.org/pdf/2201.09865.pdf"),Rt.forEach(r),rt.forEach(r),Qe=h(m),S=a(m,"DIV",{class:!0});var ge=s(S);J(F.$$.fragment,ge),Xe=h(ge),se=a(ge,"P",{});var Et=s(se);Ye=i(Et,`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),Et.forEach(r),ge.forEach(r),Ze=h(m),R=a(m,"DIV",{class:!0});var ve=s(R);J(O.$$.fragment,ve),et=h(ve),oe=a(ve,"P",{});var Dt=s(oe);tt=i(Dt,`Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion
process from the learned model outputs (most often the predicted noise).`),Dt.forEach(r),ve.forEach(r),m.forEach(r),this.h()},h(){d(_,"name","hf:doc:metadata"),d(_,"content",JSON.stringify(It)),d(w,"id","repaint-scheduler"),d(w,"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"),d(w,"href","#repaint-scheduler"),d(b,"class","relative group"),d($,"id","overview"),d($,"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"),d($,"href","#overview"),d(P,"class","relative group"),d(N,"href","/docs/diffusers/v0.19.0/en/api/pipelines/repaint#diffusers.RePaintPipeline"),d(k,"href","https://arxiv.org/abs/2201.09865"),d(k,"rel","nofollow"),d(M,"href","https://github.com/andreas128/RePaint"),d(M,"rel","nofollow"),d(x,"id","diffusers.RePaintScheduler"),d(x,"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"),d(x,"href","#diffusers.RePaintScheduler"),d(y,"class","relative group"),d(L,"href","/docs/diffusers/v0.19.0/en/api/configuration#diffusers.ConfigMixin"),d(q,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin"),d(B,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained"),d(G,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),d(C,"href","https://arxiv.org/pdf/2201.09865.pdf"),d(C,"rel","nofollow"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,f){e(document.head,_),v(t,ie,f),v(t,b,f),e(b,w),e(w,K),U(E,K,null),e(b,_e),e(b,Q),e(Q,be),v(t,de,f),v(t,P,f),e(P,$),e($,X),U(D,X,null),e(P,Pe),e(P,Y),e(Y,ye),v(t,le,f),v(t,g,f),e(g,we),e(g,N),e(N,$e),e(g,xe),e(g,k),e(k,Se),e(g,Re),e(g,M),e(M,Ee),v(t,ce,f),v(t,y,f),e(y,x),e(x,Z),U(T,Z,null),e(y,De),e(y,ee),e(ee,ke),v(t,pe,f),v(t,c,f),U(A,c,null),e(c,Me),e(c,te),e(te,Te),e(c,Ae),e(c,l),e(l,L),e(L,Ce),e(l,Fe),e(l,re),e(re,Oe),e(l,Ie),e(l,ne),e(ne,Ne),e(l,Le),e(l,ae),e(ae,qe),e(l,Be),e(l,q),e(q,Ge),e(l,He),e(l,B),e(B,Ve),e(l,Je),e(l,G),e(G,Ue),e(l,We),e(c,je),e(c,H),e(H,ze),e(H,C),e(C,Ke),e(c,Qe),e(c,S),U(F,S,null),e(S,Xe),e(S,se),e(se,Ye),e(c,Ze),e(c,R),U(O,R,null),e(R,et),e(R,oe),e(oe,tt),ue=!0},p:Ct,i(t){ue||(W(E.$$.fragment,t),W(D.$$.fragment,t),W(T.$$.fragment,t),W(A.$$.fragment,t),W(F.$$.fragment,t),W(O.$$.fragment,t),ue=!0)},o(t){j(E.$$.fragment,t),j(D.$$.fragment,t),j(T.$$.fragment,t),j(A.$$.fragment,t),j(F.$$.fragment,t),j(O.$$.fragment,t),ue=!1},d(t){r(_),t&&r(ie),t&&r(b),z(E),t&&r(de),t&&r(P),z(D),t&&r(le),t&&r(g),t&&r(ce),t&&r(y),z(T),t&&r(pe),t&&r(c),z(A),z(F),z(O)}}}const It={local:"repaint-scheduler",sections:[{local:"overview",title:"Overview"},{local:"diffusers.RePaintScheduler",title:"RePaintScheduler"}],title:"RePaint scheduler"};function Nt(st){return Ft(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gt extends kt{constructor(_){super();Mt(this,_,Nt,Ot,Tt,{})}}export{Gt as default,It as metadata};
