import{s as fe,n as me,o as he}from"../chunks/scheduler.8c3d61f6.js";import{S as ge,i as _e,g as d,s as r,r as M,A as be,h as a,f as t,c as i,j as L,u as C,x as F,k as O,y as n,a as l,v as P,d as $,t as y,w as T}from"../chunks/index.da70eac4.js";import{D as K}from"../chunks/Docstring.8332ccfe.js";import{H as ue,E as ve}from"../chunks/getInferenceSnippets.4986d68f.js";function xe(re){let p,N,q,z,h,H,g,ie='<code>CogVideoXDPMScheduler</code> is based on <a href="https://huggingface.co/papers/2206.00927" rel="nofollow">DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps</a> and <a href="https://huggingface.co/papers/2211.01095" rel="nofollow">DPM-Solver++: Fast Solver for Guided Sampling of Diffusion Probabilistic Models</a>, specifically for CogVideoX models.',k,_,U,o,b,Q,V,de=`<code>DDIMScheduler</code> extends the denoising procedure introduced in denoising diffusion probabilistic models (DDPMs) with
non-Markovian guidance.`,Y,X,ae=`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.`,Z,u,v,ee,w,ce=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,te,f,x,oe,I,le="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",se,m,D,ne,E,pe=`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).`,W,S,G,A,R;return h=new ue({props:{title:"CogVideoXDPMScheduler",local:"cogvideoxdpmscheduler",headingTag:"h1"}}),_=new ue({props:{title:"CogVideoXDPMScheduler",local:"diffusers.CogVideoXDPMScheduler",headingTag:"h2"}}),b=new K({props:{name:"class diffusers.CogVideoXDPMScheduler",anchor:"diffusers.CogVideoXDPMScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.00085"},{name:"beta_end",val:": float = 0.012"},{name:"beta_schedule",val:": str = 'scaled_linear'"},{name:"trained_betas",val:": typing.Union[numpy.ndarray, typing.List[float], NoneType] = None"},{name:"clip_sample",val:": bool = True"},{name:"set_alpha_to_one",val:": bool = True"},{name:"steps_offset",val:": int = 0"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"clip_sample_range",val:": float = 1.0"},{name:"sample_max_value",val:": float = 1.0"},{name:"timestep_spacing",val:": str = 'leading'"},{name:"rescale_betas_zero_snr",val:": bool = False"},{name:"snr_shift_scale",val:": float = 3.0"}],parametersDescription:[{anchor:"diffusers.CogVideoXDPMScheduler.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.CogVideoXDPMScheduler.beta_start",description:`<strong>beta_start</strong> (<code>float</code>, defaults to 0.0001) &#x2014;
The starting <code>beta</code> value of inference.`,name:"beta_start"},{anchor:"diffusers.CogVideoXDPMScheduler.beta_end",description:`<strong>beta_end</strong> (<code>float</code>, defaults to 0.02) &#x2014;
The final <code>beta</code> value.`,name:"beta_end"},{anchor:"diffusers.CogVideoXDPMScheduler.beta_schedule",description:`<strong>beta_schedule</strong> (<code>str</code>, defaults to <code>&quot;linear&quot;</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>, or <code>squaredcos_cap_v2</code>.`,name:"beta_schedule"},{anchor:"diffusers.CogVideoXDPMScheduler.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"},{anchor:"diffusers.CogVideoXDPMScheduler.clip_sample",description:`<strong>clip_sample</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Clip the predicted sample for numerical stability.`,name:"clip_sample"},{anchor:"diffusers.CogVideoXDPMScheduler.clip_sample_range",description:`<strong>clip_sample_range</strong> (<code>float</code>, defaults to 1.0) &#x2014;
The maximum magnitude for sample clipping. Valid only when <code>clip_sample=True</code>.`,name:"clip_sample_range"},{anchor:"diffusers.CogVideoXDPMScheduler.set_alpha_to_one",description:`<strong>set_alpha_to_one</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Each diffusion step uses the alphas product value at that step and at the previous one. For the final step
there is no previous alpha. When this option is <code>True</code> the previous alpha product is fixed to <code>1</code>,
otherwise it uses the alpha value at step 0.`,name:"set_alpha_to_one"},{anchor:"diffusers.CogVideoXDPMScheduler.steps_offset",description:`<strong>steps_offset</strong> (<code>int</code>, defaults to 0) &#x2014;
An offset added to the inference steps, as required by some model families.`,name:"steps_offset"},{anchor:"diffusers.CogVideoXDPMScheduler.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, defaults to <code>epsilon</code>, <em>optional</em>) &#x2014;
Prediction type of the scheduler function; can be <code>epsilon</code> (predicts the noise of the diffusion process),
<code>sample</code> (directly predicts the noisy sample<code>) or </code>v_prediction\` (see section 2.4 of <a href="https://imagen.research.google/video/paper.pdf" rel="nofollow">Imagen
Video</a> paper).`,name:"prediction_type"},{anchor:"diffusers.CogVideoXDPMScheduler.thresholding",description:`<strong>thresholding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the &#x201C;dynamic thresholding&#x201D; method. This is unsuitable for latent-space diffusion models such
as Stable Diffusion.`,name:"thresholding"},{anchor:"diffusers.CogVideoXDPMScheduler.dynamic_thresholding_ratio",description:`<strong>dynamic_thresholding_ratio</strong> (<code>float</code>, defaults to 0.995) &#x2014;
The ratio for the dynamic thresholding method. Valid only when <code>thresholding=True</code>.`,name:"dynamic_thresholding_ratio"},{anchor:"diffusers.CogVideoXDPMScheduler.sample_max_value",description:`<strong>sample_max_value</strong> (<code>float</code>, defaults to 1.0) &#x2014;
The threshold value for dynamic thresholding. Valid only when <code>thresholding=True</code>.`,name:"sample_max_value"},{anchor:"diffusers.CogVideoXDPMScheduler.timestep_spacing",description:`<strong>timestep_spacing</strong> (<code>str</code>, defaults to <code>&quot;leading&quot;</code>) &#x2014;
The way the timesteps should be scaled. Refer to Table 2 of the <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and
Sample Steps are Flawed</a> for more information.`,name:"timestep_spacing"},{anchor:"diffusers.CogVideoXDPMScheduler.rescale_betas_zero_snr",description:`<strong>rescale_betas_zero_snr</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
dark samples instead of limiting it to samples with medium brightness. Loosely related to
<a href="https://github.com/huggingface/diffusers/blob/74fd735eb073eb1d774b1ab4154a0876eb82f055/examples/dreambooth/train_dreambooth.py#L506" rel="nofollow"><code>--offset_noise</code></a>.`,name:"rescale_betas_zero_snr"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpm_cogvideox.py#L127"}}),v=new K({props:{name:"scale_model_input",anchor:"diffusers.CogVideoXDPMScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.CogVideoXDPMScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
The input sample.`,name:"sample"},{anchor:"diffusers.CogVideoXDPMScheduler.scale_model_input.timestep",description:`<strong>timestep</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The current timestep in the diffusion chain.`,name:"timestep"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpm_cogvideox.py#L244",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>
`}}),x=new K({props:{name:"set_timesteps",anchor:"diffusers.CogVideoXDPMScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.CogVideoXDPMScheduler.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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpm_cogvideox.py#L261"}}),D=new K({props:{name:"step",anchor:"diffusers.CogVideoXDPMScheduler.step",parameters:[{name:"model_output",val:": Tensor"},{name:"old_pred_original_sample",val:": Tensor"},{name:"timestep",val:": int"},{name:"timestep_back",val:": int"},{name:"sample",val:": Tensor"},{name:"eta",val:": float = 0.0"},{name:"use_clipped_model_output",val:": bool = False"},{name:"generator",val:" = None"},{name:"variance_noise",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.CogVideoXDPMScheduler.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.CogVideoXDPMScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.CogVideoXDPMScheduler.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.CogVideoXDPMScheduler.step.eta",description:`<strong>eta</strong> (<code>float</code>) &#x2014;
The weight of noise for added noise in diffusion step.`,name:"eta"},{anchor:"diffusers.CogVideoXDPMScheduler.step.use_clipped_model_output",description:`<strong>use_clipped_model_output</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, computes &#x201C;corrected&#x201D; <code>model_output</code> from the clipped predicted original sample. Necessary
because predicted original sample is clipped to [-1, 1] when <code>self.config.clip_sample</code> is <code>True</code>. If no
clipping has happened, &#x201C;corrected&#x201D; <code>model_output</code> would coincide with the one provided as input and
<code>use_clipped_model_output</code> has no effect.`,name:"use_clipped_model_output"},{anchor:"diffusers.CogVideoXDPMScheduler.step.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"},{anchor:"diffusers.CogVideoXDPMScheduler.step.variance_noise",description:`<strong>variance_noise</strong> (<code>torch.Tensor</code>) &#x2014;
Alternative to generating noise with <code>generator</code> by directly providing the noise for the variance
itself. Useful for methods such as <code>CycleDiffusion</code>.`,name:"variance_noise"},{anchor:"diffusers.CogVideoXDPMScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.schedulers.scheduling_ddim.DDIMSchedulerOutput">DDIMSchedulerOutput</a> or <code>tuple</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_dpm_cogvideox.py#L330",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/ddim#diffusers.schedulers.scheduling_ddim.DDIMSchedulerOutput"
>DDIMSchedulerOutput</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/ddim#diffusers.schedulers.scheduling_ddim.DDIMSchedulerOutput"
>DDIMSchedulerOutput</a> or <code>tuple</code></p>
`}}),S=new ve({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/multistep_dpm_solver_cogvideox.md"}}),{c(){p=d("meta"),N=r(),q=d("p"),z=r(),M(h.$$.fragment),H=r(),g=d("p"),g.innerHTML=ie,k=r(),M(_.$$.fragment),U=r(),o=d("div"),M(b.$$.fragment),Q=r(),V=d("p"),V.innerHTML=de,Y=r(),X=d("p"),X.innerHTML=ae,Z=r(),u=d("div"),M(v.$$.fragment),ee=r(),w=d("p"),w.textContent=ce,te=r(),f=d("div"),M(x.$$.fragment),oe=r(),I=d("p"),I.textContent=le,se=r(),m=d("div"),M(D.$$.fragment),ne=r(),E=d("p"),E.textContent=pe,W=r(),M(S.$$.fragment),G=r(),A=d("p"),this.h()},l(e){const s=be("svelte-u9bgzb",document.head);p=a(s,"META",{name:!0,content:!0}),s.forEach(t),N=i(e),q=a(e,"P",{}),L(q).forEach(t),z=i(e),C(h.$$.fragment,e),H=i(e),g=a(e,"P",{"data-svelte-h":!0}),F(g)!=="svelte-1m0njwz"&&(g.innerHTML=ie),k=i(e),C(_.$$.fragment,e),U=i(e),o=a(e,"DIV",{class:!0});var c=L(o);C(b.$$.fragment,c),Q=i(c),V=a(c,"P",{"data-svelte-h":!0}),F(V)!=="svelte-1wae91k"&&(V.innerHTML=de),Y=i(c),X=a(c,"P",{"data-svelte-h":!0}),F(X)!=="svelte-linuuh"&&(X.innerHTML=ae),Z=i(c),u=a(c,"DIV",{class:!0});var j=L(u);C(v.$$.fragment,j),ee=i(j),w=a(j,"P",{"data-svelte-h":!0}),F(w)!=="svelte-1rkfgpx"&&(w.textContent=ce),j.forEach(t),te=i(c),f=a(c,"DIV",{class:!0});var B=L(f);C(x.$$.fragment,B),oe=i(B),I=a(B,"P",{"data-svelte-h":!0}),F(I)!=="svelte-1vzm9q"&&(I.textContent=le),B.forEach(t),se=i(c),m=a(c,"DIV",{class:!0});var J=L(m);C(D.$$.fragment,J),ne=i(J),E=a(J,"P",{"data-svelte-h":!0}),F(E)!=="svelte-hi84tp"&&(E.textContent=pe),J.forEach(t),c.forEach(t),W=i(e),C(S.$$.fragment,e),G=i(e),A=a(e,"P",{}),L(A).forEach(t),this.h()},h(){O(p,"name","hf:doc:metadata"),O(p,"content",De),O(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(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(e,s){n(document.head,p),l(e,N,s),l(e,q,s),l(e,z,s),P(h,e,s),l(e,H,s),l(e,g,s),l(e,k,s),P(_,e,s),l(e,U,s),l(e,o,s),P(b,o,null),n(o,Q),n(o,V),n(o,Y),n(o,X),n(o,Z),n(o,u),P(v,u,null),n(u,ee),n(u,w),n(o,te),n(o,f),P(x,f,null),n(f,oe),n(f,I),n(o,se),n(o,m),P(D,m,null),n(m,ne),n(m,E),l(e,W,s),P(S,e,s),l(e,G,s),l(e,A,s),R=!0},p:me,i(e){R||($(h.$$.fragment,e),$(_.$$.fragment,e),$(b.$$.fragment,e),$(v.$$.fragment,e),$(x.$$.fragment,e),$(D.$$.fragment,e),$(S.$$.fragment,e),R=!0)},o(e){y(h.$$.fragment,e),y(_.$$.fragment,e),y(b.$$.fragment,e),y(v.$$.fragment,e),y(x.$$.fragment,e),y(D.$$.fragment,e),y(S.$$.fragment,e),R=!1},d(e){e&&(t(N),t(q),t(z),t(H),t(g),t(k),t(U),t(o),t(W),t(G),t(A)),t(p),T(h,e),T(_,e),T(b),T(v),T(x),T(D),T(S,e)}}}const De='{"title":"CogVideoXDPMScheduler","local":"cogvideoxdpmscheduler","sections":[{"title":"CogVideoXDPMScheduler","local":"diffusers.CogVideoXDPMScheduler","sections":[],"depth":2}],"depth":1}';function Se(re){return he(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ye extends ge{constructor(p){super(),_e(this,p,Se,xe,fe,{})}}export{ye as component};
