import{s as fe,o as he,n as ge}from"../chunks/scheduler.182ea377.js";import{S as ve,i as Se,g as d,s as i,r as D,A as _e,h as c,f as r,c as o,j as z,u as E,x as g,k as B,y as p,a as n,v as T,d as P,t as M,w as k}from"../chunks/index.abf12888.js";import{T as be}from"../chunks/Tip.230e2334.js";import{D as ie}from"../chunks/Docstring.81ce6c10.js";import{H as ue,E as $e}from"../chunks/EditOnGithub.9b8e78e4.js";function xe(G){let s,v="🚧 This scheduler is under construction!";return{c(){s=d("p"),s.textContent=v},l(m){s=c(m,"P",{"data-svelte-h":!0}),g(s)!=="svelte-mvh4c7"&&(s.textContent=v)},m(m,L){n(m,s,L)},p:ge,d(m){m&&r(s)}}}function we(G){let s,v,m,L,S,N,_,oe='<code>ScoreSdeVpScheduler</code> is a variance preserving stochastic differential equation (SDE) scheduler.  It was introduced in the <a href="https://huggingface.co/papers/2011.13456" rel="nofollow">Score-Based Generative Modeling through Stochastic Differential Equations</a> paper by Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, Ben Poole.',W,b,ae="The abstract from the paper is:",F,$,de="<em>Creating noise from data is easy; creating data from noise is generative modeling. We present a stochastic differential equation (SDE) that smoothly transforms a complex data distribution to a known prior distribution by slowly injecting noise, and a corresponding reverse-time SDE that transforms the prior distribution back into the data distribution by slowly removing the noise. Crucially, the reverse-time SDE depends only on the time-dependent gradient field (\\aka, score) of the perturbed data distribution. By leveraging advances in score-based generative modeling, we can accurately estimate these scores with neural networks, and use numerical SDE solvers to generate samples. We show that this framework encapsulates previous approaches in score-based generative modeling and diffusion probabilistic modeling, allowing for new sampling procedures and new modeling capabilities. In particular, we introduce a predictor-corrector framework to correct errors in the evolution of the discretized reverse-time SDE. We also derive an equivalent neural ODE that samples from the same distribution as the SDE, but additionally enables exact likelihood computation, and improved sampling efficiency. In addition, we provide a new way to solve inverse problems with score-based models, as demonstrated with experiments on class-conditional generation, image inpainting, and colorization. Combined with multiple architectural improvements, we achieve record-breaking performance for unconditional image generation on CIFAR-10 with an Inception score of 9.89 and FID of 2.20, a competitive likelihood of 2.99 bits/dim, and demonstrate high fidelity generation of 1024 x 1024 images for the first time from a score-based generative model.</em>",K,u,O,x,R,a,w,Z,H,ce="<code>ScoreSdeVpScheduler</code> is a variance preserving stochastic differential equation (SDE) scheduler.",ee,I,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,f,y,re,q,pe="Sets the continuous timesteps used for the diffusion chain (to be run before inference).",se,h,V,ne,A,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).`,U,C,J,j,Y;return S=new ue({props:{title:"ScoreSdeVpScheduler",local:"scoresdevpscheduler",headingTag:"h1"}}),u=new be({props:{warning:!0,$$slots:{default:[xe]},$$scope:{ctx:G}}}),x=new ue({props:{title:"ScoreSdeVpScheduler",local:"diffusers.schedulers.ScoreSdeVpScheduler",headingTag:"h2"}}),w=new ie({props:{name:"class diffusers.schedulers.ScoreSdeVpScheduler",anchor:"diffusers.schedulers.ScoreSdeVpScheduler",parameters:[{name:"num_train_timesteps",val:" = 2000"},{name:"beta_min",val:" = 0.1"},{name:"beta_max",val:" = 20"},{name:"sampling_eps",val:" = 0.001"}],parametersDescription:[{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.num_train_timesteps",description:`<strong>num_train_timesteps</strong> (<code>int</code>, defaults to 2000) &#x2014;
The number of diffusion steps to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.beta_min",description:"<strong>beta_min</strong> (<code>int</code>, defaults to 0.1) &#x2014;",name:"beta_min"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.beta_max",description:"<strong>beta_max</strong> (<code>int</code>, defaults to 20) &#x2014;",name:"beta_max"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.sampling_eps",description:`<strong>sampling_eps</strong> (<code>int</code>, defaults to 1e-3) &#x2014;
The end value of sampling where timesteps decrease progressively from 1 to epsilon.`,name:"sampling_eps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py#L27"}}),y=new ie({props:{name:"set_timesteps",anchor:"diffusers.schedulers.ScoreSdeVpScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:""},{name:"device",val:": Union = None"}],parametersDescription:[{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.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.schedulers.ScoreSdeVpScheduler.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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py#L51"}}),V=new ie({props:{name:"step_pred",anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred",parameters:[{name:"score",val:""},{name:"x",val:""},{name:"t",val:""},{name:"generator",val:" = None"}],parametersDescription:[{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.score",description:"<strong>score</strong> () &#x2014;",name:"score"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.x",description:"<strong>x</strong> () &#x2014;",name:"x"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.t",description:"<strong>t</strong> () &#x2014;",name:"t"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py#L63"}}),C=new $e({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/score_sde_vp.md"}}),{c(){s=d("meta"),v=i(),m=d("p"),L=i(),D(S.$$.fragment),N=i(),_=d("p"),_.innerHTML=oe,W=i(),b=d("p"),b.textContent=ae,F=i(),$=d("p"),$.innerHTML=de,K=i(),D(u.$$.fragment),O=i(),D(x.$$.fragment),R=i(),a=d("div"),D(w.$$.fragment),Z=i(),H=d("p"),H.innerHTML=ce,ee=i(),I=d("p"),I.innerHTML=le,te=i(),f=d("div"),D(y.$$.fragment),re=i(),q=d("p"),q.textContent=pe,se=i(),h=d("div"),D(V.$$.fragment),ne=i(),A=d("p"),A.textContent=me,U=i(),D(C.$$.fragment),J=i(),j=d("p"),this.h()},l(e){const t=_e("svelte-u9bgzb",document.head);s=c(t,"META",{name:!0,content:!0}),t.forEach(r),v=o(e),m=c(e,"P",{}),z(m).forEach(r),L=o(e),E(S.$$.fragment,e),N=o(e),_=c(e,"P",{"data-svelte-h":!0}),g(_)!=="svelte-am1tgf"&&(_.innerHTML=oe),W=o(e),b=c(e,"P",{"data-svelte-h":!0}),g(b)!=="svelte-1cwsb16"&&(b.textContent=ae),F=o(e),$=c(e,"P",{"data-svelte-h":!0}),g($)!=="svelte-omf9ly"&&($.innerHTML=de),K=o(e),E(u.$$.fragment,e),O=o(e),E(x.$$.fragment,e),R=o(e),a=c(e,"DIV",{class:!0});var l=z(a);E(w.$$.fragment,l),Z=o(l),H=c(l,"P",{"data-svelte-h":!0}),g(H)!=="svelte-ij3gjh"&&(H.innerHTML=ce),ee=o(l),I=c(l,"P",{"data-svelte-h":!0}),g(I)!=="svelte-linuuh"&&(I.innerHTML=le),te=o(l),f=c(l,"DIV",{class:!0});var Q=z(f);E(y.$$.fragment,Q),re=o(Q),q=c(Q,"P",{"data-svelte-h":!0}),g(q)!=="svelte-8cg672"&&(q.textContent=pe),Q.forEach(r),se=o(l),h=c(l,"DIV",{class:!0});var X=z(h);E(V.$$.fragment,X),ne=o(X),A=c(X,"P",{"data-svelte-h":!0}),g(A)!=="svelte-hi84tp"&&(A.textContent=me),X.forEach(r),l.forEach(r),U=o(e),E(C.$$.fragment,e),J=o(e),j=c(e,"P",{}),z(j).forEach(r),this.h()},h(){B(s,"name","hf:doc:metadata"),B(s,"content",ye),B(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(a,"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,t){p(document.head,s),n(e,v,t),n(e,m,t),n(e,L,t),T(S,e,t),n(e,N,t),n(e,_,t),n(e,W,t),n(e,b,t),n(e,F,t),n(e,$,t),n(e,K,t),T(u,e,t),n(e,O,t),T(x,e,t),n(e,R,t),n(e,a,t),T(w,a,null),p(a,Z),p(a,H),p(a,ee),p(a,I),p(a,te),p(a,f),T(y,f,null),p(f,re),p(f,q),p(a,se),p(a,h),T(V,h,null),p(h,ne),p(h,A),n(e,U,t),T(C,e,t),n(e,J,t),n(e,j,t),Y=!0},p(e,[t]){const l={};t&2&&(l.$$scope={dirty:t,ctx:e}),u.$set(l)},i(e){Y||(P(S.$$.fragment,e),P(u.$$.fragment,e),P(x.$$.fragment,e),P(w.$$.fragment,e),P(y.$$.fragment,e),P(V.$$.fragment,e),P(C.$$.fragment,e),Y=!0)},o(e){M(S.$$.fragment,e),M(u.$$.fragment,e),M(x.$$.fragment,e),M(w.$$.fragment,e),M(y.$$.fragment,e),M(V.$$.fragment,e),M(C.$$.fragment,e),Y=!1},d(e){e&&(r(v),r(m),r(L),r(N),r(_),r(W),r(b),r(F),r($),r(K),r(O),r(R),r(a),r(U),r(J),r(j)),r(s),k(S,e),k(u,e),k(x,e),k(w),k(y),k(V),k(C,e)}}}const ye='{"title":"ScoreSdeVpScheduler","local":"scoresdevpscheduler","sections":[{"title":"ScoreSdeVpScheduler","local":"diffusers.schedulers.ScoreSdeVpScheduler","sections":[],"depth":2}],"depth":1}';function Ve(G){return he(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Me extends ve{constructor(s){super(),Se(this,s,Ve,we,fe,{})}}export{Me as component};
