Buckets:

download
raw
10.3 kB
import"../chunks/DsnmJJEf.js";import{i as k,h as C,C as E,H as p,D as s,E as U,s as A}from"../chunks/DBNuz8hP.js";import{p as z,o as F,s as e,f as H,a as S,b as B,c as r,d as y,n as t,r as n}from"../chunks/CQ2f15a1.js";const G='{"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}';var R=y('<meta name="hf:doc:metadata"/>'),W=y(`<p></p> <!> <!> <p><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>.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>A fourth-order Improved Pseudo Linear Multistep scheduler.</p> <p>This model inherits from <a href="/docs/diffusers/pr_15328/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/pr_15328/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.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Find the index of a given timestep in the timestep schedule.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Sets the begin index for the scheduler. This function should be run from pipeline before the inference.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Sets the discrete timesteps used for the diffusion chain (to be run before inference).</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>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.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Base class for the output of a scheduler’s <code>step</code> function.</p></div> <!> <p></p>`,1);function K(D,T){z(T,!1),F(()=>{new URLSearchParams(window.location.search).get("fw")}),k();var l=W();C("37k5af",v=>{var x=R();A(x,"content",G),S(v,x)});var h=e(H(l),2);E(h,{containerStyle:"float: inline-end; margin-inline-start: 10px; display: inline-flex; position: relative; z-index: 10;"});var m=e(h,2);p(m,{title:"IPNDMScheduler",local:"ipndmscheduler",headingTag:"h1"});var f=e(m,4);p(f,{title:"IPNDMScheduler",local:"diffusers.IPNDMScheduler",headingTag:"h2"});var i=e(f,2),g=r(i);s(g,{name:"class diffusers.IPNDMScheduler",anchor:"diffusers.IPNDMScheduler",source:"https://github.com/huggingface/diffusers/blob/vr_15328/src/diffusers/schedulers/scheduling_ipndm.py#L24",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"trained_betas",val:": numpy.ndarray | list[float] | None = 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> or <code>List[float]</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"}]});var o=e(g,6),M=r(o);s(M,{name:"index_for_timestep",anchor:"diffusers.IPNDMScheduler.index_for_timestep",source:"https://github.com/huggingface/diffusers/blob/vr_15328/src/diffusers/schedulers/scheduling_ipndm.py#L124",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"}],returnDescription:`
<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:`
<p><code>int</code></p>
`}),t(2),n(o);var d=e(o,2),N=r(d);s(N,{name:"scale_model_input",anchor:"diffusers.IPNDMScheduler.scale_model_input",source:"https://github.com/huggingface/diffusers/blob/vr_15328/src/diffusers/schedulers/scheduling_ipndm.py#L228",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"}],returnDescription:`
<p>A scaled input sample.</p>
`,returnType:`
<p><code>torch.Tensor</code></p>
`}),t(2),n(d);var c=e(d,2),P=r(c);s(P,{name:"set_begin_index",anchor:"diffusers.IPNDMScheduler.set_begin_index",source:"https://github.com/huggingface/diffusers/blob/vr_15328/src/diffusers/schedulers/scheduling_ipndm.py#L85",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"}]}),t(2),n(c);var a=e(c,2),I=r(a);s(I,{name:"set_timesteps",anchor:"diffusers.IPNDMScheduler.set_timesteps",source:"https://github.com/huggingface/diffusers/blob/vr_15328/src/diffusers/schedulers/scheduling_ipndm.py#L95",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device, NoneType] = 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"}]}),t(2),n(a);var _=e(a,2),w=r(_);s(w,{name:"step",anchor:"diffusers.IPNDMScheduler.step",source:"https://github.com/huggingface/diffusers/blob/vr_15328/src/diffusers/schedulers/scheduling_ipndm.py#L170",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> or <code>torch.Tensor</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/pr_15328/en/api/schedulers/ipndm#diffusers.schedulers.scheduling_utils.SchedulerOutput">SchedulerOutput</a> or tuple.`,name:"return_dict"}],returnDescription:`
<p>If return_dict is <code>True</code>, <a
href="/docs/diffusers/pr_15328/en/api/schedulers/ipndm#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> is returned, otherwise a
tuple is returned where the first element is the sample tensor.</p>
`,returnType:`
<p><a
href="/docs/diffusers/pr_15328/en/api/schedulers/ipndm#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> or <code>tuple</code></p>
`}),t(2),n(_),n(i);var b=e(i,2);p(b,{title:"SchedulerOutput",local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",headingTag:"h2"});var u=e(b,2),O=r(u);s(O,{name:"class diffusers.schedulers.scheduling_utils.SchedulerOutput",anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput",source:"https://github.com/huggingface/diffusers/blob/vr_15328/src/diffusers/schedulers/scheduling_utils.py#L66",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"}]}),t(2),n(u);var L=e(u,2);U(L,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/ipndm.md"}),t(2),S(D,l),B()}export{K as component};

Xet Storage Details

Size:
10.3 kB
·
Xet hash:
fa5d418da4bdba2c554cc0baabc3137ac8a0eead930e73384f4b67e8b9e2d0ee

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.