import{s as he,n as ge,o as _e}from"../chunks/scheduler.53228c21.js";import{S as De,i as be,e as d,s as r,c as h,h as ve,a,d as t,b as i,f as q,g,j as N,k as O,l as n,m as l,n as _,t as D,o as b,p as v}from"../chunks/index.100fac89.js";import{C as xe}from"../chunks/CopyLLMTxtMenu.0ee1b69b.js";import{D as Y}from"../chunks/Docstring.db856a1e.js";import{H as fe,E as $e}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.136ef3fd.js";function Ce(de){let p,F,z,k,x,A,$,U,C,ae='<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.',W,M,R,s,y,Z,X,ce=`<code>DDIMScheduler</code> extends the denoising procedure introduced in denoising diffusion probabilistic models (DDPMs) with
non-Markovian guidance.`,ee,w,le=`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.`,te,u,S,oe,L,pe=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,se,m,I,ne,P,ue="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",re,f,T,ie,E,me=`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).`,G,V,j,H,B;return x=new xe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),$=new fe({props:{title:"CogVideoXDDIMScheduler",local:"cogvideoxddimscheduler",headingTag:"h1"}}),M=new fe({props:{title:"CogVideoXDDIMScheduler",local:"diffusers.CogVideoXDDIMScheduler",headingTag:"h2"}}),y=new Y({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"}}),S=new Y({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>
`}}),I=new Y({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"}}),T=new Y({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>
`}}),V=new $e({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/ddim_cogvideox.md"}}),{c(){p=d("meta"),F=r(),z=d("p"),k=r(),h(x.$$.fragment),A=r(),h($.$$.fragment),U=r(),C=d("p"),C.innerHTML=ae,W=r(),h(M.$$.fragment),R=r(),s=d("div"),h(y.$$.fragment),Z=r(),X=d("p"),X.innerHTML=ce,ee=r(),w=d("p"),w.innerHTML=le,te=r(),u=d("div"),h(S.$$.fragment),oe=r(),L=d("p"),L.textContent=pe,se=r(),m=d("div"),h(I.$$.fragment),ne=r(),P=d("p"),P.textContent=ue,re=r(),f=d("div"),h(T.$$.fragment),ie=r(),E=d("p"),E.textContent=me,G=r(),h(V.$$.fragment),j=r(),H=d("p"),this.h()},l(e){const o=ve("svelte-u9bgzb",document.head);p=a(o,"META",{name:!0,content:!0}),o.forEach(t),F=i(e),z=a(e,"P",{}),q(z).forEach(t),k=i(e),g(x.$$.fragment,e),A=i(e),g($.$$.fragment,e),U=i(e),C=a(e,"P",{"data-svelte-h":!0}),N(C)!=="svelte-w3gaf8"&&(C.innerHTML=ae),W=i(e),g(M.$$.fragment,e),R=i(e),s=a(e,"DIV",{class:!0});var c=q(s);g(y.$$.fragment,c),Z=i(c),X=a(c,"P",{"data-svelte-h":!0}),N(X)!=="svelte-1wae91k"&&(X.innerHTML=ce),ee=i(c),w=a(c,"P",{"data-svelte-h":!0}),N(w)!=="svelte-linuuh"&&(w.innerHTML=le),te=i(c),u=a(c,"DIV",{class:!0});var J=q(u);g(S.$$.fragment,J),oe=i(J),L=a(J,"P",{"data-svelte-h":!0}),N(L)!=="svelte-1rkfgpx"&&(L.textContent=pe),J.forEach(t),se=i(c),m=a(c,"DIV",{class:!0});var K=q(m);g(I.$$.fragment,K),ne=i(K),P=a(K,"P",{"data-svelte-h":!0}),N(P)!=="svelte-1vzm9q"&&(P.textContent=ue),K.forEach(t),re=i(c),f=a(c,"DIV",{class:!0});var Q=q(f);g(T.$$.fragment,Q),ie=i(Q),E=a(Q,"P",{"data-svelte-h":!0}),N(E)!=="svelte-hi84tp"&&(E.textContent=me),Q.forEach(t),c.forEach(t),G=i(e),g(V.$$.fragment,e),j=i(e),H=a(e,"P",{}),q(H).forEach(t),this.h()},h(){O(p,"name","hf:doc:metadata"),O(p,"content",Me),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(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(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(s,"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,o){n(document.head,p),l(e,F,o),l(e,z,o),l(e,k,o),_(x,e,o),l(e,A,o),_($,e,o),l(e,U,o),l(e,C,o),l(e,W,o),_(M,e,o),l(e,R,o),l(e,s,o),_(y,s,null),n(s,Z),n(s,X),n(s,ee),n(s,w),n(s,te),n(s,u),_(S,u,null),n(u,oe),n(u,L),n(s,se),n(s,m),_(I,m,null),n(m,ne),n(m,P),n(s,re),n(s,f),_(T,f,null),n(f,ie),n(f,E),l(e,G,o),_(V,e,o),l(e,j,o),l(e,H,o),B=!0},p:ge,i(e){B||(D(x.$$.fragment,e),D($.$$.fragment,e),D(M.$$.fragment,e),D(y.$$.fragment,e),D(S.$$.fragment,e),D(I.$$.fragment,e),D(T.$$.fragment,e),D(V.$$.fragment,e),B=!0)},o(e){b(x.$$.fragment,e),b($.$$.fragment,e),b(M.$$.fragment,e),b(y.$$.fragment,e),b(S.$$.fragment,e),b(I.$$.fragment,e),b(T.$$.fragment,e),b(V.$$.fragment,e),B=!1},d(e){e&&(t(F),t(z),t(k),t(A),t(U),t(C),t(W),t(R),t(s),t(G),t(j),t(H)),t(p),v(x,e),v($,e),v(M,e),v(y),v(S),v(I),v(T),v(V,e)}}}const Me='{"title":"CogVideoXDDIMScheduler","local":"cogvideoxddimscheduler","sections":[{"title":"CogVideoXDDIMScheduler","local":"diffusers.CogVideoXDDIMScheduler","sections":[],"depth":2}],"depth":1}';function ye(de){return _e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class we extends De{constructor(p){super(),be(this,p,ye,Ce,he,{})}}export{we as component};
