import{s as ze,n as Ue,o as Ae}from"../chunks/scheduler.53228c21.js";import{S as je,i as qe,e as d,s as r,c as l,h as Fe,a,d as s,b as i,f as b,g as p,j as v,k as x,l as t,m as u,n as m,t as f,o as h,p as g}from"../chunks/index.100fac89.js";import{C as Be}from"../chunks/CopyLLMTxtMenu.999d3d86.js";import{D as A}from"../chunks/Docstring.46d0934e.js";import{H as Me,E as Ge}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d27ae4df.js";function Re(Ie){let _,X,K,Y,M,Z,I,ee,w,we='<code>IPNDMScheduler</code> is a fourth-order Improved Pseudo Linear Multistep scheduler. The original implementation can be found at <a href="https://github.com/crowsonkb/v-diffusion-pytorch/blob/987f8985e38208345c1959b0ea767a625831cc9b/diffusion/sampling.py#L296" rel="nofollow">crowsonkb/v-diffusion-pytorch</a>.',te,N,se,o,C,fe,j,Ne="A fourth-order Improved Pseudo Linear Multistep scheduler.",he,q,Ce=`This model inherits from <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin">ConfigMixin</a>. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`,ge,S,L,_e,F,Le="Find the index of a given timestep in the timestep schedule.",$e,D,E,be,B,Ee=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,ve,y,O,xe,G,Oe="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",Se,P,k,De,R,ke="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",ye,T,H,Pe,W,He=`Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with
the linear multistep method. It performs one forward pass multiple times to approximate the solution.`,ne,V,re,$,z,Te,J,Ve="Base class for the output of a scheduler’s <code>step</code> function.",ie,U,oe,Q,de;return M=new Be({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),I=new Me({props:{title:"IPNDMScheduler",local:"ipndmscheduler",headingTag:"h1"}}),N=new Me({props:{title:"IPNDMScheduler",local:"diffusers.IPNDMScheduler",headingTag:"h2"}}),C=new A({props:{name:"class diffusers.IPNDMScheduler",anchor:"diffusers.IPNDMScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"trained_betas",val:": typing.Union[numpy.ndarray, typing.List[float], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.IPNDMScheduler.num_train_timesteps",description:`<strong>num_train_timesteps</strong> (<code>int</code>, defaults to 1000) &#x2014;
The number of diffusion steps to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.IPNDMScheduler.trained_betas",description:`<strong>trained_betas</strong> (<code>np.ndarray</code>, <em>optional</em>) &#x2014;
Pass an array of betas directly to the constructor to bypass <code>beta_start</code> and <code>beta_end</code>.`,name:"trained_betas"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ipndm.py#L25"}}),L=new A({props:{name:"index_for_timestep",anchor:"diffusers.IPNDMScheduler.index_for_timestep",parameters:[{name:"timestep",val:": typing.Union[float, torch.Tensor]"},{name:"schedule_timesteps",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"diffusers.IPNDMScheduler.index_for_timestep.timestep",description:`<strong>timestep</strong> (<code>float</code> or <code>torch.Tensor</code>) &#x2014;
The timestep value to find in the schedule.`,name:"timestep"},{anchor:"diffusers.IPNDMScheduler.index_for_timestep.schedule_timesteps",description:`<strong>schedule_timesteps</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
The timestep schedule to search in. If <code>None</code>, uses <code>self.timesteps</code>.`,name:"schedule_timesteps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ipndm.py#L115",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The index of the timestep in the schedule. For the very first step, returns the second index if
multiple matches exist to avoid skipping a sigma when starting mid-schedule (e.g., for image-to-image).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>int</code></p>
`}}),E=new A({props:{name:"scale_model_input",anchor:"diffusers.IPNDMScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.IPNDMScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
The input sample.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ipndm.py#L219",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A scaled input sample.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),O=new A({props:{name:"set_begin_index",anchor:"diffusers.IPNDMScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.IPNDMScheduler.set_begin_index.begin_index",description:`<strong>begin_index</strong> (<code>int</code>, defaults to <code>0</code>) &#x2014;
The begin index for the scheduler.`,name:"begin_index"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ipndm.py#L76"}}),k=new A({props:{name:"set_timesteps",anchor:"diffusers.IPNDMScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.IPNDMScheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) &#x2014;
The number of diffusion steps used when generating samples with a pre-trained model.`,name:"num_inference_steps"},{anchor:"diffusers.IPNDMScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, <em>optional</em>) &#x2014;
The device to which the timesteps should be moved to. If <code>None</code>, the timesteps are not moved.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ipndm.py#L86"}}),H=new A({props:{name:"step",anchor:"diffusers.IPNDMScheduler.step",parameters:[{name:"model_output",val:": Tensor"},{name:"timestep",val:": typing.Union[int, torch.Tensor]"},{name:"sample",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.IPNDMScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.Tensor</code>) &#x2014;
The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.IPNDMScheduler.step.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.IPNDMScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.IPNDMScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.schedulers.scheduling_utils.SchedulerOutput">SchedulerOutput</a> or tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ipndm.py#L161",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> is returned, otherwise a
tuple is returned where the first element is the sample tensor.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> or <code>tuple</code></p>
`}}),V=new Me({props:{title:"SchedulerOutput",local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",headingTag:"h2"}}),z=new A({props:{name:"class diffusers.schedulers.scheduling_utils.SchedulerOutput",anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput",parameters:[{name:"prev_sample",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput.prev_sample",description:`<strong>prev_sample</strong> (<code>torch.Tensor</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#L62"}}),U=new Ge({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/ipndm.md"}}),{c(){_=d("meta"),X=r(),K=d("p"),Y=r(),l(M.$$.fragment),Z=r(),l(I.$$.fragment),ee=r(),w=d("p"),w.innerHTML=we,te=r(),l(N.$$.fragment),se=r(),o=d("div"),l(C.$$.fragment),fe=r(),j=d("p"),j.textContent=Ne,he=r(),q=d("p"),q.innerHTML=Ce,ge=r(),S=d("div"),l(L.$$.fragment),_e=r(),F=d("p"),F.textContent=Le,$e=r(),D=d("div"),l(E.$$.fragment),be=r(),B=d("p"),B.textContent=Ee,ve=r(),y=d("div"),l(O.$$.fragment),xe=r(),G=d("p"),G.textContent=Oe,Se=r(),P=d("div"),l(k.$$.fragment),De=r(),R=d("p"),R.textContent=ke,ye=r(),T=d("div"),l(H.$$.fragment),Pe=r(),W=d("p"),W.textContent=He,ne=r(),l(V.$$.fragment),re=r(),$=d("div"),l(z.$$.fragment),Te=r(),J=d("p"),J.innerHTML=Ve,ie=r(),l(U.$$.fragment),oe=r(),Q=d("p"),this.h()},l(e){const n=Fe("svelte-u9bgzb",document.head);_=a(n,"META",{name:!0,content:!0}),n.forEach(s),X=i(e),K=a(e,"P",{}),b(K).forEach(s),Y=i(e),p(M.$$.fragment,e),Z=i(e),p(I.$$.fragment,e),ee=i(e),w=a(e,"P",{"data-svelte-h":!0}),v(w)!=="svelte-z0ks0i"&&(w.innerHTML=we),te=i(e),p(N.$$.fragment,e),se=i(e),o=a(e,"DIV",{class:!0});var c=b(o);p(C.$$.fragment,c),fe=i(c),j=a(c,"P",{"data-svelte-h":!0}),v(j)!=="svelte-uir5v"&&(j.textContent=Ne),he=i(c),q=a(c,"P",{"data-svelte-h":!0}),v(q)!=="svelte-linuuh"&&(q.innerHTML=Ce),ge=i(c),S=a(c,"DIV",{class:!0});var ae=b(S);p(L.$$.fragment,ae),_e=i(ae),F=a(ae,"P",{"data-svelte-h":!0}),v(F)!=="svelte-1xn85hs"&&(F.textContent=Le),ae.forEach(s),$e=i(c),D=a(c,"DIV",{class:!0});var ce=b(D);p(E.$$.fragment,ce),be=i(ce),B=a(ce,"P",{"data-svelte-h":!0}),v(B)!=="svelte-1rkfgpx"&&(B.textContent=Ee),ce.forEach(s),ve=i(c),y=a(c,"DIV",{class:!0});var ue=b(y);p(O.$$.fragment,ue),xe=i(ue),G=a(ue,"P",{"data-svelte-h":!0}),v(G)!=="svelte-1k141rk"&&(G.textContent=Oe),ue.forEach(s),Se=i(c),P=a(c,"DIV",{class:!0});var le=b(P);p(k.$$.fragment,le),De=i(le),R=a(le,"P",{"data-svelte-h":!0}),v(R)!=="svelte-1vzm9q"&&(R.textContent=ke),le.forEach(s),ye=i(c),T=a(c,"DIV",{class:!0});var pe=b(T);p(H.$$.fragment,pe),Pe=i(pe),W=a(pe,"P",{"data-svelte-h":!0}),v(W)!=="svelte-1n4l8et"&&(W.textContent=He),pe.forEach(s),c.forEach(s),ne=i(e),p(V.$$.fragment,e),re=i(e),$=a(e,"DIV",{class:!0});var me=b($);p(z.$$.fragment,me),Te=i(me),J=a(me,"P",{"data-svelte-h":!0}),v(J)!=="svelte-6ojmkw"&&(J.innerHTML=Ve),me.forEach(s),ie=i(e),p(U.$$.fragment,e),oe=i(e),Q=a(e,"P",{}),b(Q).forEach(s),this.h()},h(){x(_,"name","hf:doc:metadata"),x(_,"content",We),x(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){t(document.head,_),u(e,X,n),u(e,K,n),u(e,Y,n),m(M,e,n),u(e,Z,n),m(I,e,n),u(e,ee,n),u(e,w,n),u(e,te,n),m(N,e,n),u(e,se,n),u(e,o,n),m(C,o,null),t(o,fe),t(o,j),t(o,he),t(o,q),t(o,ge),t(o,S),m(L,S,null),t(S,_e),t(S,F),t(o,$e),t(o,D),m(E,D,null),t(D,be),t(D,B),t(o,ve),t(o,y),m(O,y,null),t(y,xe),t(y,G),t(o,Se),t(o,P),m(k,P,null),t(P,De),t(P,R),t(o,ye),t(o,T),m(H,T,null),t(T,Pe),t(T,W),u(e,ne,n),m(V,e,n),u(e,re,n),u(e,$,n),m(z,$,null),t($,Te),t($,J),u(e,ie,n),m(U,e,n),u(e,oe,n),u(e,Q,n),de=!0},p:Ue,i(e){de||(f(M.$$.fragment,e),f(I.$$.fragment,e),f(N.$$.fragment,e),f(C.$$.fragment,e),f(L.$$.fragment,e),f(E.$$.fragment,e),f(O.$$.fragment,e),f(k.$$.fragment,e),f(H.$$.fragment,e),f(V.$$.fragment,e),f(z.$$.fragment,e),f(U.$$.fragment,e),de=!0)},o(e){h(M.$$.fragment,e),h(I.$$.fragment,e),h(N.$$.fragment,e),h(C.$$.fragment,e),h(L.$$.fragment,e),h(E.$$.fragment,e),h(O.$$.fragment,e),h(k.$$.fragment,e),h(H.$$.fragment,e),h(V.$$.fragment,e),h(z.$$.fragment,e),h(U.$$.fragment,e),de=!1},d(e){e&&(s(X),s(K),s(Y),s(Z),s(ee),s(w),s(te),s(se),s(o),s(ne),s(re),s($),s(ie),s(oe),s(Q)),s(_),g(M,e),g(I,e),g(N,e),g(C),g(L),g(E),g(O),g(k),g(H),g(V,e),g(z),g(U,e)}}}const We='{"title":"IPNDMScheduler","local":"ipndmscheduler","sections":[{"title":"IPNDMScheduler","local":"diffusers.IPNDMScheduler","sections":[],"depth":2},{"title":"SchedulerOutput","local":"diffusers.schedulers.scheduling_utils.SchedulerOutput","sections":[],"depth":2}],"depth":1}';function Je(Ie){return Ae(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class et extends je{constructor(_){super(),qe(this,_,Je,Re,ze,{})}}export{et as component};
