Buckets:
| import"../chunks/DsnmJJEf.js";import{i as M,h as A,C,H as l,D as r,E as P,s as N}from"../chunks/BtE7mKSK.js";import{p as z,o as G,s as e,f as q,a as T,b as I,c as s,d as S,n as a,r as t}from"../chunks/jDjavuwI.js";const H='{"title":"KarrasVeScheduler","local":"karrasvescheduler","sections":[{"title":"KarrasVeScheduler","local":"diffusers.KarrasVeScheduler","sections":[],"depth":2},{"title":"KarrasVeOutput","local":"diffusers.schedulers.deprecated.scheduling_karras_ve.KarrasVeOutput","sections":[],"depth":2}],"depth":1}';var U=S('<meta name="hf:doc:metadata"/>'),W=S(`<p></p> <!> <!> <p><code>KarrasVeScheduler</code> is a stochastic sampler tailored to variance-expanding (VE) models. It is based on the <a href="https://huggingface.co/papers/2206.00364" rel="nofollow">Elucidating the Design Space of Diffusion-Based Generative Models</a> and <a href="https://huggingface.co/papers/2011.13456" rel="nofollow">Score-based generative modeling through stochastic differential equations</a> papers.</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 stochastic scheduler tailored to variance-expanding models.</p> <p>This model inherits from <a href="/docs/diffusers/pr_14178/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/pr_14178/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> <blockquote class="tip"><p>> For more details on the parameters, see <a href="https://huggingface.co/papers/2206.00364" rel="nofollow">Appendix E</a>. The grid | |
| search > values used to find the optimal <code>{s_noise, s_churn, s_min, s_max}</code> for a specific model are described in | |
| Table 5 of > the paper.</p></blockquote> <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>Explicit Langevin-like “churn” step of adding noise to the sample according to a <code>gamma_i ≥ 0</code> to reach a | |
| higher noise level <code>sigma_hat = sigma_i + gamma_i*sigma_i</code>.</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 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 diffusion | |
| process from the learned model outputs (most often the predicted noise).</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>Corrects the predicted sample based on the <code>model_output</code> of the network.</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>Output class for the scheduler’s step function output.</p></div> <!> <p></p>`,1);function j(V,K){z(K,!1),G(()=>{new URLSearchParams(window.location.search).get("fw")}),M();var u=W();A("1fef6kt",b=>{var x=U();N(x,"content",H),T(b,x)});var m=e(q(u),2);C(m,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var h=e(m,2);l(h,{title:"KarrasVeScheduler",local:"karrasvescheduler",headingTag:"h1"});var f=e(h,4);l(f,{title:"KarrasVeScheduler",local:"diffusers.KarrasVeScheduler",headingTag:"h2"});var o=e(f,2),g=s(o);r(g,{name:"class diffusers.KarrasVeScheduler",anchor:"diffusers.KarrasVeScheduler",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py#L48",parameters:[{name:"sigma_min",val:": float = 0.02"},{name:"sigma_max",val:": float = 100"},{name:"s_noise",val:": float = 1.007"},{name:"s_churn",val:": float = 80"},{name:"s_min",val:": float = 0.05"},{name:"s_max",val:": float = 50"}],parametersDescription:[{anchor:"diffusers.KarrasVeScheduler.sigma_min",description:`<strong>sigma_min</strong> (<code>float</code>, defaults to 0.02) — | |
| The minimum noise magnitude.`,name:"sigma_min"},{anchor:"diffusers.KarrasVeScheduler.sigma_max",description:`<strong>sigma_max</strong> (<code>float</code>, defaults to 100) — | |
| The maximum noise magnitude.`,name:"sigma_max"},{anchor:"diffusers.KarrasVeScheduler.s_noise",description:`<strong>s_noise</strong> (<code>float</code>, defaults to 1.007) — | |
| The amount of additional noise to counteract loss of detail during sampling. A reasonable range is [1.000, | |
| 1.011].`,name:"s_noise"},{anchor:"diffusers.KarrasVeScheduler.s_churn",description:`<strong>s_churn</strong> (<code>float</code>, defaults to 80) — | |
| The parameter controlling the overall amount of stochasticity. A reasonable range is [0, 100].`,name:"s_churn"},{anchor:"diffusers.KarrasVeScheduler.s_min",description:`<strong>s_min</strong> (<code>float</code>, defaults to 0.05) — | |
| The start value of the sigma range to add noise (enable stochasticity). A reasonable range is [0, 10].`,name:"s_min"},{anchor:"diffusers.KarrasVeScheduler.s_max",description:`<strong>s_max</strong> (<code>float</code>, defaults to 50) — | |
| The end value of the sigma range to add noise. A reasonable range is [0.2, 80].`,name:"s_max"}]});var n=e(g,8),O=s(n);r(O,{name:"add_noise_to_input",anchor:"diffusers.KarrasVeScheduler.add_noise_to_input",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py#L134",parameters:[{name:"sample",val:": Tensor"},{name:"sigma",val:": float"},{name:"generator",val:": typing.Optional[torch.Generator] = None"}],parametersDescription:[{anchor:"diffusers.KarrasVeScheduler.add_noise_to_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) — | |
| The input sample.`,name:"sample"},{anchor:"diffusers.KarrasVeScheduler.add_noise_to_input.sigma",description:"<strong>sigma</strong> (<code>float</code>) —",name:"sigma"},{anchor:"diffusers.KarrasVeScheduler.add_noise_to_input.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A random number generator.`,name:"generator"}]}),a(2),t(n);var d=e(n,2),y=s(d);r(y,{name:"scale_model_input",anchor:"diffusers.KarrasVeScheduler.scale_model_input",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py#L95",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": int = None"}],parametersDescription:[{anchor:"diffusers.KarrasVeScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) — | |
| The input sample.`,name:"sample"},{anchor:"diffusers.KarrasVeScheduler.scale_model_input.timestep",description:`<strong>timestep</strong> (<code>int</code>, <em>optional</em>) — | |
| The current timestep in the diffusion chain.`,name:"timestep"}],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> | |
| `}),a(2),t(d);var i=e(d,2),D=s(i);r(D,{name:"set_timesteps",anchor:"diffusers.KarrasVeScheduler.set_timesteps",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py#L112",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.KarrasVeScheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) — | |
| The number of diffusion steps used when generating samples with a pre-trained model.`,name:"num_inference_steps"},{anchor:"diffusers.KarrasVeScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, <em>optional</em>) — | |
| The device to which the timesteps should be moved to. If <code>None</code>, the timesteps are not moved.`,name:"device"}]}),a(2),t(i);var c=e(i,2),k=s(c);r(k,{name:"step",anchor:"diffusers.KarrasVeScheduler.step",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py#L160",parameters:[{name:"model_output",val:": Tensor"},{name:"sigma_hat",val:": float"},{name:"sigma_prev",val:": float"},{name:"sample_hat",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KarrasVeScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.Tensor</code>) — | |
| The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.KarrasVeScheduler.step.sigma_hat",description:"<strong>sigma_hat</strong> (<code>float</code>) —",name:"sigma_hat"},{anchor:"diffusers.KarrasVeScheduler.step.sigma_prev",description:"<strong>sigma_prev</strong> (<code>float</code>) —",name:"sigma_prev"},{anchor:"diffusers.KarrasVeScheduler.step.sample_hat",description:"<strong>sample_hat</strong> (<code>torch.Tensor</code>) —",name:"sample_hat"},{anchor:"diffusers.KarrasVeScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput</code> or <code>tuple</code>.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If return_dict is <code>True</code>, <code>~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput</code> 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><code>~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput</code> or <code>tuple</code></p> | |
| `}),a(2),t(c);var _=e(c,2),w=s(_);r(w,{name:"step_correct",anchor:"diffusers.KarrasVeScheduler.step_correct",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py#L199",parameters:[{name:"model_output",val:": Tensor"},{name:"sigma_hat",val:": float"},{name:"sigma_prev",val:": float"},{name:"sample_hat",val:": Tensor"},{name:"sample_prev",val:": Tensor"},{name:"derivative",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KarrasVeScheduler.step_correct.model_output",description:`<strong>model_output</strong> (<code>torch.Tensor</code>) — | |
| The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.KarrasVeScheduler.step_correct.sigma_hat",description:"<strong>sigma_hat</strong> (<code>float</code>) — TODO",name:"sigma_hat"},{anchor:"diffusers.KarrasVeScheduler.step_correct.sigma_prev",description:"<strong>sigma_prev</strong> (<code>float</code>) — TODO",name:"sigma_prev"},{anchor:"diffusers.KarrasVeScheduler.step_correct.sample_hat",description:"<strong>sample_hat</strong> (<code>torch.Tensor</code>) — TODO",name:"sample_hat"},{anchor:"diffusers.KarrasVeScheduler.step_correct.sample_prev",description:"<strong>sample_prev</strong> (<code>torch.Tensor</code>) — TODO",name:"sample_prev"},{anchor:"diffusers.KarrasVeScheduler.step_correct.derivative",description:"<strong>derivative</strong> (<code>torch.Tensor</code>) — TODO",name:"derivative"},{anchor:"diffusers.KarrasVeScheduler.step_correct.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/pr_14178/en/api/schedulers/ddpm#diffusers.schedulers.scheduling_ddpm.DDPMSchedulerOutput">DDPMSchedulerOutput</a> or <code>tuple</code>.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>updated sample in the diffusion chain. derivative (TODO): TODO</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>prev_sample (TODO)</p> | |
| `}),a(2),t(_),t(o);var v=e(o,2);l(v,{title:"KarrasVeOutput",local:"diffusers.schedulers.deprecated.scheduling_karras_ve.KarrasVeOutput",headingTag:"h2"});var p=e(v,2),E=s(p);r(E,{name:"class diffusers.schedulers.deprecated.scheduling_karras_ve.KarrasVeOutput",anchor:"diffusers.schedulers.deprecated.scheduling_karras_ve.KarrasVeOutput",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py#L28",parameters:[{name:"prev_sample",val:": Tensor"},{name:"derivative",val:": Tensor"},{name:"pred_original_sample",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"diffusers.schedulers.deprecated.scheduling_karras_ve.KarrasVeOutput.prev_sample",description:`<strong>prev_sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) — | |
| 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"},{anchor:"diffusers.schedulers.deprecated.scheduling_karras_ve.KarrasVeOutput.derivative",description:`<strong>derivative</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) — | |
| Derivative of predicted original image sample (x_0).`,name:"derivative"},{anchor:"diffusers.schedulers.deprecated.scheduling_karras_ve.KarrasVeOutput.pred_original_sample",description:`<strong>pred_original_sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) — | |
| The predicted denoised sample (x_{0}) based on the model output from the current timestep. | |
| <code>pred_original_sample</code> can be used to preview progress or for guidance.`,name:"pred_original_sample"}]}),a(2),t(p);var L=e(p,2);P(L,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/stochastic_karras_ve.md"}),a(2),T(V,u),I()}export{j as component}; | |
Xet Storage Details
- Size:
- 14.6 kB
- Xet hash:
- edc708069ca49651d03406b389ac9861fa80717ee4e7acbdb2d4f90eecdd43f6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.