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 De,h as a,f as t,c as i,j as E,u as $,x as q,k as N,y as n,a as l,v as y,d as S,t as I,w as T}from"../chunks/index.da70eac4.js";import{D as K}from"../chunks/Docstring.9419aa1d.js";import{H as pe,E as be}from"../chunks/getInferenceSnippets.39110341.js";function ve(re){let u,z,O,A,h,F,g,ie='<code>CogVideoXDDIMScheduler</code> is based on <a href="https://huggingface.co/papers/2010.02502" rel="nofollow">Denoising Diffusion Implicit Models</a>, specifically for CogVideoX models.',k,_,U,o,D,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,p,b,ee,w,ce=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,te,f,v,oe,P,le="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",se,m,x,ne,L,ue=`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,C,R,H,G;return h=new pe({props:{title:"CogVideoXDDIMScheduler",local:"cogvideoxddimscheduler",headingTag:"h1"}}),_=new pe({props:{title:"CogVideoXDDIMScheduler",local:"diffusers.CogVideoXDDIMScheduler",headingTag:"h2"}}),D=new K({props:{name:"class diffusers.CogVideoXDDIMScheduler",anchor:"diffusers.CogVideoXDDIMScheduler",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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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_ddim_cogvideox.py#L126"}}),b=new K({props:{name:"scale_model_input",anchor:"diffusers.CogVideoXDDIMScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.CogVideoXDDIMScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
The input sample.`,name:"sample"},{anchor:"diffusers.CogVideoXDDIMScheduler.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_ddim_cogvideox.py#L243",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>
`}}),v=new K({props:{name:"set_timesteps",anchor:"diffusers.CogVideoXDDIMScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.CogVideoXDDIMScheduler.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_ddim_cogvideox.py#L260"}}),x=new K({props:{name:"step",anchor:"diffusers.CogVideoXDDIMScheduler.step",parameters:[{name:"model_output",val:": Tensor"},{name:"timestep",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 = True"}],parametersDescription:[{anchor:"diffusers.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.step.eta",description:`<strong>eta</strong> (<code>float</code>) &#x2014;
The weight of noise for added noise in diffusion step.`,name:"eta"},{anchor:"diffusers.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.step.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"},{anchor:"diffusers.CogVideoXDDIMScheduler.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.CogVideoXDDIMScheduler.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_ddim_cogvideox.py#L305",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>
`}}),C=new be({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/ddim_cogvideox.md"}}),{c(){u=d("meta"),z=r(),O=d("p"),A=r(),M(h.$$.fragment),F=r(),g=d("p"),g.innerHTML=ie,k=r(),M(_.$$.fragment),U=r(),o=d("div"),M(D.$$.fragment),Q=r(),V=d("p"),V.innerHTML=de,Y=r(),X=d("p"),X.innerHTML=ae,Z=r(),p=d("div"),M(b.$$.fragment),ee=r(),w=d("p"),w.textContent=ce,te=r(),f=d("div"),M(v.$$.fragment),oe=r(),P=d("p"),P.textContent=le,se=r(),m=d("div"),M(x.$$.fragment),ne=r(),L=d("p"),L.textContent=ue,W=r(),M(C.$$.fragment),R=r(),H=d("p"),this.h()},l(e){const s=De("svelte-u9bgzb",document.head);u=a(s,"META",{name:!0,content:!0}),s.forEach(t),z=i(e),O=a(e,"P",{}),E(O).forEach(t),A=i(e),$(h.$$.fragment,e),F=i(e),g=a(e,"P",{"data-svelte-h":!0}),q(g)!=="svelte-w3gaf8"&&(g.innerHTML=ie),k=i(e),$(_.$$.fragment,e),U=i(e),o=a(e,"DIV",{class:!0});var c=E(o);$(D.$$.fragment,c),Q=i(c),V=a(c,"P",{"data-svelte-h":!0}),q(V)!=="svelte-1wae91k"&&(V.innerHTML=de),Y=i(c),X=a(c,"P",{"data-svelte-h":!0}),q(X)!=="svelte-linuuh"&&(X.innerHTML=ae),Z=i(c),p=a(c,"DIV",{class:!0});var j=E(p);$(b.$$.fragment,j),ee=i(j),w=a(j,"P",{"data-svelte-h":!0}),q(w)!=="svelte-1rkfgpx"&&(w.textContent=ce),j.forEach(t),te=i(c),f=a(c,"DIV",{class:!0});var B=E(f);$(v.$$.fragment,B),oe=i(B),P=a(B,"P",{"data-svelte-h":!0}),q(P)!=="svelte-1vzm9q"&&(P.textContent=le),B.forEach(t),se=i(c),m=a(c,"DIV",{class:!0});var J=E(m);$(x.$$.fragment,J),ne=i(J),L=a(J,"P",{"data-svelte-h":!0}),q(L)!=="svelte-hi84tp"&&(L.textContent=ue),J.forEach(t),c.forEach(t),W=i(e),$(C.$$.fragment,e),R=i(e),H=a(e,"P",{}),E(H).forEach(t),this.h()},h(){N(u,"name","hf:doc:metadata"),N(u,"content",xe),N(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(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,u),l(e,z,s),l(e,O,s),l(e,A,s),y(h,e,s),l(e,F,s),l(e,g,s),l(e,k,s),y(_,e,s),l(e,U,s),l(e,o,s),y(D,o,null),n(o,Q),n(o,V),n(o,Y),n(o,X),n(o,Z),n(o,p),y(b,p,null),n(p,ee),n(p,w),n(o,te),n(o,f),y(v,f,null),n(f,oe),n(f,P),n(o,se),n(o,m),y(x,m,null),n(m,ne),n(m,L),l(e,W,s),y(C,e,s),l(e,R,s),l(e,H,s),G=!0},p:me,i(e){G||(S(h.$$.fragment,e),S(_.$$.fragment,e),S(D.$$.fragment,e),S(b.$$.fragment,e),S(v.$$.fragment,e),S(x.$$.fragment,e),S(C.$$.fragment,e),G=!0)},o(e){I(h.$$.fragment,e),I(_.$$.fragment,e),I(D.$$.fragment,e),I(b.$$.fragment,e),I(v.$$.fragment,e),I(x.$$.fragment,e),I(C.$$.fragment,e),G=!1},d(e){e&&(t(z),t(O),t(A),t(F),t(g),t(k),t(U),t(o),t(W),t(R),t(H)),t(u),T(h,e),T(_,e),T(D),T(b),T(v),T(x),T(C,e)}}}const xe='{"title":"CogVideoXDDIMScheduler","local":"cogvideoxddimscheduler","sections":[{"title":"CogVideoXDDIMScheduler","local":"diffusers.CogVideoXDDIMScheduler","sections":[],"depth":2}],"depth":1}';function Ce(re){return he(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ie extends ge{constructor(u){super(),_e(this,u,Ce,ve,fe,{})}}export{Ie as component};
