import{S as Zt,i as eo,s as io,e as t,k as n,w as c,t as d,M as so,c as o,d as s,m as l,a as r,x as h,h as u,b as a,N as to,G as i,g as f,y as m,L as oo,q as g,o as _,B as v,v as ro}from"../../../chunks/vendor-hf-doc-builder.js";import{D as Ee}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Xi}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as w}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function ao(it){let D,ci,A,q,Le,Z,Zi,qe,es,hi,P,C,Ce,ee,is,He,ss,mi,ie,se,ts,os,gi,ke,rs,_i,H,as,te,ns,ls,vi,E,G,Ge,oe,ps,Ve,fs,$i,V,Re,k,Oe,ds,us,Ue,cs,hs,xe,ms,gs,ze,x,Be,re,_s,vs,Ke,Fe,$s,bs,je,ae,Me,st,bi,j,R,Je,ne,ys,Ye,ws,yi,M,O,Qe,le,Ds,We,As,wi,pe,Di,I,U,Xe,fe,Ps,Ze,Es,Ai,de,Pi,N,z,ei,ue,ks,ii,xs,Ei,ce,ki,T,B,si,he,js,ti,Ms,xi,me,ji,S,K,oi,ge,Is,ri,Ns,Mi,$,_e,Ts,ve,Ss,Ie,Ls,qs,Cs,F,$e,Hs,ai,Gs,Vs,J,be,Rs,ni,Os,Us,Y,ye,zs,li,Bs,Ii,L,Q,pi,we,Ks,fi,Fs,Ni,b,De,Js,W,Ae,Ys,di,Qs,Ws,X,Pe,Xs,ui,Zs,Ti;return Z=new w({}),ee=new w({}),oe=new w({}),ne=new w({}),le=new w({}),pe=new Xi({props:{code:`import torch
from IPython.display import Audio
from diffusers import DiffusionPipeline

device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = DiffusionPipeline.from_pretrained("teticio/audio-diffusion-256").to(device)

output = pipe()
display(output.images[0])
display(Audio(output.audios[0], rate=mel.get_sample_rate()))`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;teticio/audio-diffusion-256&quot;</span>).to(device)

output = pipe()
display(output.images[<span class="hljs-number">0</span>])
display(Audio(output.audios[<span class="hljs-number">0</span>], rate=mel.get_sample_rate()))`}}),fe=new w({}),de=new Xi({props:{code:`import torch
from IPython.display import Audio
from diffusers import DiffusionPipeline

device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = DiffusionPipeline.from_pretrained("teticio/latent-audio-diffusion-256").to(device)

output = pipe()
display(output.images[0])
display(Audio(output.audios[0], rate=pipe.mel.get_sample_rate()))`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;teticio/latent-audio-diffusion-256&quot;</span>).to(device)

output = pipe()
display(output.images[<span class="hljs-number">0</span>])
display(Audio(output.audios[<span class="hljs-number">0</span>], rate=pipe.mel.get_sample_rate()))`}}),ue=new w({}),ce=new Xi({props:{code:`import torch
from IPython.display import Audio
from diffusers import DiffusionPipeline

device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = DiffusionPipeline.from_pretrained("teticio/audio-diffusion-ddim-256").to(device)

output = pipe()
display(output.images[0])
display(Audio(output.audios[0], rate=pipe.mel.get_sample_rate()))`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;teticio/audio-diffusion-ddim-256&quot;</span>).to(device)

output = pipe()
display(output.images[<span class="hljs-number">0</span>])
display(Audio(output.audios[<span class="hljs-number">0</span>], rate=pipe.mel.get_sample_rate()))`}}),he=new w({}),me=new Xi({props:{code:`output = pipe(
    raw_audio=output.audios[0, 0],
    start_step=int(pipe.get_default_steps() / 2),
    mask_start_secs=1,
    mask_end_secs=1,
)
display(output.images[0])
display(Audio(output.audios[0], rate=pipe.mel.get_sample_rate()))`,highlighted:`output = pipe(
    raw_audio=output.audios[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>],
    start_step=<span class="hljs-built_in">int</span>(pipe.get_default_steps() / <span class="hljs-number">2</span>),
    mask_start_secs=<span class="hljs-number">1</span>,
    mask_end_secs=<span class="hljs-number">1</span>,
)
display(output.images[<span class="hljs-number">0</span>])
display(Audio(output.audios[<span class="hljs-number">0</span>], rate=pipe.mel.get_sample_rate()))`}}),ge=new w({}),_e=new Ee({props:{name:"class diffusers.AudioDiffusionPipeline",anchor:"diffusers.AudioDiffusionPipeline",parameters:[{name:"vqvae",val:": AutoencoderKL"},{name:"unet",val:": UNet2DConditionModel"},{name:"mel",val:": Mel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_ddpm.DDPMScheduler]"}],parametersDescription:[{anchor:"diffusers.AudioDiffusionPipeline.vqae",description:'<strong>vqae</strong> (<a href="/docs/diffusers/v0.11.0/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014; Variational AutoEncoder for Latent Audio Diffusion or None',name:"vqae"},{anchor:"diffusers.AudioDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.11.0/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; UNET model',name:"unet"},{anchor:"diffusers.AudioDiffusionPipeline.mel",description:'<strong>mel</strong> (<a href="/docs/diffusers/v0.11.0/en/api/pipelines/audio_diffusion#diffusers.Mel">Mel</a>) &#x2014; transform audio &lt;-&gt; spectrogram',name:"mel"},{anchor:"diffusers.AudioDiffusionPipeline.scheduler",description:"<strong>scheduler</strong> ([<code>DDIMScheduler</code> or <code>DDPMScheduler</code>]) &#x2014; de-noising scheduler",name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.11.0/src/diffusers/pipelines/audio_diffusion/pipeline_audio_diffusion.py#L30"}}),$e=new Ee({props:{name:"__call__",anchor:"diffusers.AudioDiffusionPipeline.__call__",parameters:[{name:"batch_size",val:": int = 1"},{name:"audio_file",val:": str = None"},{name:"raw_audio",val:": ndarray = None"},{name:"slice",val:": int = 0"},{name:"start_step",val:": int = 0"},{name:"steps",val:": int = None"},{name:"generator",val:": Generator = None"},{name:"mask_start_secs",val:": float = 0"},{name:"mask_end_secs",val:": float = 0"},{name:"step_generator",val:": Generator = None"},{name:"eta",val:": float = 0"},{name:"noise",val:": Tensor = None"},{name:"return_dict",val:" = True"}],parametersDescription:[{anchor:"diffusers.AudioDiffusionPipeline.__call__.batch_size",description:"<strong>batch_size</strong> (<code>int</code>) &#x2014; number of samples to generate",name:"batch_size"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.audio_file",description:"<strong>audio_file</strong> (<code>str</code>) &#x2014; must be a file on disk due to Librosa limitation or",name:"audio_file"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.raw_audio",description:"<strong>raw_audio</strong> (<code>np.ndarray</code>) &#x2014; audio as numpy array",name:"raw_audio"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.slice",description:"<strong>slice</strong> (<code>int</code>) &#x2014; slice number of audio to convert",name:"slice"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.start_step",description:"<strong>start_step</strong> (int) &#x2014; step to start from",name:"start_step"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.steps",description:"<strong>steps</strong> (<code>int</code>) &#x2014; number of de-noising steps (defaults to 50 for DDIM, 1000 for DDPM)",name:"steps"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.generator",description:"<strong>generator</strong> (<code>torch.Generator</code>) &#x2014; random number generator or None",name:"generator"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.mask_start_secs",description:"<strong>mask_start_secs</strong> (<code>float</code>) &#x2014; number of seconds of audio to mask (not generate) at start",name:"mask_start_secs"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.mask_end_secs",description:"<strong>mask_end_secs</strong> (<code>float</code>) &#x2014; number of seconds of audio to mask (not generate) at end",name:"mask_end_secs"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.step_generator",description:"<strong>step_generator</strong> (<code>torch.Generator</code>) &#x2014; random number generator used to de-noise or None",name:"step_generator"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.eta",description:"<strong>eta</strong> (<code>float</code>) &#x2014; parameter between 0 and 1 used with DDIM scheduler",name:"eta"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.noise",description:"<strong>noise</strong> (<code>torch.Tensor</code>) &#x2014; noise tensor of shape (batch_size, 1, height, width) or None",name:"noise"},{anchor:"diffusers.AudioDiffusionPipeline.__call__.return_dict",description:"<strong>return_dict</strong> (<code>bool</code>) &#x2014; if True return AudioPipelineOutput, ImagePipelineOutput else Tuple",name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.11.0/src/diffusers/pipelines/audio_diffusion/pipeline_audio_diffusion.py#L77",returnDescription:`
<p>mel spectrograms (<code>float</code>, <code>List[np.ndarray]</code>): sample rate and raw audios</p>
`,returnType:`
<p><code>List[PIL Image]</code></p>
`}}),be=new Ee({props:{name:"encode",anchor:"diffusers.AudioDiffusionPipeline.encode",parameters:[{name:"images",val:": typing.List[PIL.Image.Image]"},{name:"steps",val:": int = 50"}],parametersDescription:[{anchor:"diffusers.AudioDiffusionPipeline.encode.images",description:"<strong>images</strong> (<code>List[PIL Image]</code>) &#x2014; list of images to encode",name:"images"},{anchor:"diffusers.AudioDiffusionPipeline.encode.steps",description:"<strong>steps</strong> (<code>int</code>) &#x2014; number of encoding steps to perform (defaults to 50)",name:"steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.11.0/src/diffusers/pipelines/audio_diffusion/pipeline_audio_diffusion.py#L197",returnDescription:`
<p>noise tensor of shape (batch_size, 1, height, width)</p>
`,returnType:`
<p><code>np.ndarray</code></p>
`}}),ye=new Ee({props:{name:"slerp",anchor:"diffusers.AudioDiffusionPipeline.slerp",parameters:[{name:"x0",val:": Tensor"},{name:"x1",val:": Tensor"},{name:"alpha",val:": float"}],parametersDescription:[{anchor:"diffusers.AudioDiffusionPipeline.slerp.x0",description:"<strong>x0</strong> (<code>torch.Tensor</code>) &#x2014; first tensor to interpolate between",name:"x0"},{anchor:"diffusers.AudioDiffusionPipeline.slerp.x1",description:"<strong>x1</strong> (<code>torch.Tensor</code>) &#x2014; seconds tensor to interpolate between",name:"x1"},{anchor:"diffusers.AudioDiffusionPipeline.slerp.alpha",description:"<strong>alpha</strong> (<code>float</code>) &#x2014; interpolation between 0 and 1",name:"alpha"}],source:"https://github.com/huggingface/diffusers/blob/v0.11.0/src/diffusers/pipelines/audio_diffusion/pipeline_audio_diffusion.py#L234",returnDescription:`
<p>interpolated tensor</p>
`,returnType:`
<p><code>torch.Tensor</code></p>
`}}),we=new w({}),De=new Ee({props:{name:"class diffusers.Mel",anchor:"diffusers.Mel",parameters:[{name:"x_res",val:": int = 256"},{name:"y_res",val:": int = 256"},{name:"sample_rate",val:": int = 22050"},{name:"n_fft",val:": int = 2048"},{name:"hop_length",val:": int = 512"},{name:"top_db",val:": int = 80"},{name:"n_iter",val:": int = 32"}],parametersDescription:[{anchor:"diffusers.Mel.x_res",description:"<strong>x_res</strong> (<code>int</code>) &#x2014; x resolution of spectrogram (time)",name:"x_res"},{anchor:"diffusers.Mel.y_res",description:"<strong>y_res</strong> (<code>int</code>) &#x2014; y resolution of spectrogram (frequency bins)",name:"y_res"},{anchor:"diffusers.Mel.sample_rate",description:"<strong>sample_rate</strong> (<code>int</code>) &#x2014; sample rate of audio",name:"sample_rate"},{anchor:"diffusers.Mel.n_fft",description:"<strong>n_fft</strong> (<code>int</code>) &#x2014; number of Fast Fourier Transforms",name:"n_fft"},{anchor:"diffusers.Mel.hop_length",description:"<strong>hop_length</strong> (<code>int</code>) &#x2014; hop length (a higher number is recommended for lower than 256 y_res)",name:"hop_length"},{anchor:"diffusers.Mel.top_db",description:"<strong>top_db</strong> (<code>int</code>) &#x2014; loudest in decibels",name:"top_db"},{anchor:"diffusers.Mel.n_iter",description:"<strong>n_iter</strong> (<code>int</code>) &#x2014; number of iterations for Griffin Linn mel inversion",name:"n_iter"}],source:"https://github.com/huggingface/diffusers/blob/v0.11.0/src/diffusers/pipelines/audio_diffusion/mel.py#L42"}}),Ae=new Ee({props:{name:"audio_slice_to_image",anchor:"diffusers.Mel.audio_slice_to_image",parameters:[{name:"slice",val:": int"}],parametersDescription:[{anchor:"diffusers.Mel.audio_slice_to_image.slice",description:"<strong>slice</strong> (<code>int</code>) &#x2014; slice number of audio to convert (out of get_number_of_slices())",name:"slice"}],source:"https://github.com/huggingface/diffusers/blob/v0.11.0/src/diffusers/pipelines/audio_diffusion/mel.py#L133",returnDescription:`
<p>grayscale image of x_res x y_res</p>
`,returnType:`
<p><code>PIL Image</code></p>
`}}),Pe=new Ee({props:{name:"image_to_audio",anchor:"diffusers.Mel.image_to_audio",parameters:[{name:"image",val:": Image"}],parametersDescription:[{anchor:"diffusers.Mel.image_to_audio.image",description:"<strong>image</strong> (<code>PIL Image</code>) &#x2014; x_res x y_res grayscale image",name:"image"}],source:"https://github.com/huggingface/diffusers/blob/v0.11.0/src/diffusers/pipelines/audio_diffusion/mel.py#L150",returnDescription:`
<p>raw audio</p>
`,returnType:`
<p>audio (<code>np.ndarray</code>)</p>
`}}),{c(){D=t("meta"),ci=n(),A=t("h1"),q=t("a"),Le=t("span"),c(Z.$$.fragment),Zi=n(),qe=t("span"),es=d("Audio Diffusion"),hi=n(),P=t("h2"),C=t("a"),Ce=t("span"),c(ee.$$.fragment),is=n(),He=t("span"),ss=d("Overview"),mi=n(),ie=t("p"),se=t("a"),ts=d("Audio Diffusion"),os=d(" by Robert Dargavel Smith."),gi=n(),ke=t("p"),rs=d(`Audio Diffusion leverages the recent advances in image generation using diffusion models by converting audio samples to
and from mel spectrogram images.`),_i=n(),H=t("p"),as=d("The original codebase of this implementation can be found "),te=t("a"),ns=d("here"),ls=d(`, including
training scripts and example notebooks.`),vi=n(),E=t("h2"),G=t("a"),Ge=t("span"),c(oe.$$.fragment),ps=n(),Ve=t("span"),fs=d("Available Pipelines:"),$i=n(),V=t("table"),Re=t("thead"),k=t("tr"),Oe=t("th"),ds=d("Pipeline"),us=n(),Ue=t("th"),cs=d("Tasks"),hs=n(),xe=t("th"),ms=d("Colab"),gs=n(),ze=t("tbody"),x=t("tr"),Be=t("td"),re=t("a"),_s=d("pipeline_audio_diffusion.py"),vs=n(),Ke=t("td"),Fe=t("em"),$s=d("Unconditional Audio Generation"),bs=n(),je=t("td"),ae=t("a"),Me=t("img"),bi=n(),j=t("h2"),R=t("a"),Je=t("span"),c(ne.$$.fragment),ys=n(),Ye=t("span"),ws=d("Examples:"),yi=n(),M=t("h3"),O=t("a"),Qe=t("span"),c(le.$$.fragment),Ds=n(),We=t("span"),As=d("Audio Diffusion"),wi=n(),c(pe.$$.fragment),Di=n(),I=t("h3"),U=t("a"),Xe=t("span"),c(fe.$$.fragment),Ps=n(),Ze=t("span"),Es=d("Latent Audio Diffusion"),Ai=n(),c(de.$$.fragment),Pi=n(),N=t("h3"),z=t("a"),ei=t("span"),c(ue.$$.fragment),ks=n(),ii=t("span"),xs=d("Audio Diffusion with DDIM (faster)"),Ei=n(),c(ce.$$.fragment),ki=n(),T=t("h3"),B=t("a"),si=t("span"),c(he.$$.fragment),js=n(),ti=t("span"),Ms=d("Variations, in-painting, out-painting etc."),xi=n(),c(me.$$.fragment),ji=n(),S=t("h2"),K=t("a"),oi=t("span"),c(ge.$$.fragment),Is=n(),ri=t("span"),Ns=d("AudioDiffusionPipeline"),Mi=n(),$=t("div"),c(_e.$$.fragment),Ts=n(),ve=t("p"),Ss=d("This model inherits from "),Ie=t("a"),Ls=d("DiffusionPipeline"),qs=d(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Cs=n(),F=t("div"),c($e.$$.fragment),Hs=n(),ai=t("p"),Gs=d("Generate random mel spectrogram from audio input and convert to audio."),Vs=n(),J=t("div"),c(be.$$.fragment),Rs=n(),ni=t("p"),Os=d("Reverse step process: recover noisy image from generated image."),Us=n(),Y=t("div"),c(ye.$$.fragment),zs=n(),li=t("p"),Bs=d("Spherical Linear intERPolation"),Ii=n(),L=t("h2"),Q=t("a"),pi=t("span"),c(we.$$.fragment),Ks=n(),fi=t("span"),Fs=d("Mel"),Ni=n(),b=t("div"),c(De.$$.fragment),Js=n(),W=t("div"),c(Ae.$$.fragment),Ys=n(),di=t("p"),Qs=d("Convert slice of audio to spectrogram."),Ws=n(),X=t("div"),c(Pe.$$.fragment),Xs=n(),ui=t("p"),Zs=d("Converts spectrogram to audio."),this.h()},l(e){const p=so('[data-svelte="svelte-1phssyn"]',document.head);D=o(p,"META",{name:!0,content:!0}),p.forEach(s),ci=l(e),A=o(e,"H1",{class:!0});var Si=r(A);q=o(Si,"A",{id:!0,class:!0,href:!0});var tt=r(q);Le=o(tt,"SPAN",{});var ot=r(Le);h(Z.$$.fragment,ot),ot.forEach(s),tt.forEach(s),Zi=l(Si),qe=o(Si,"SPAN",{});var rt=r(qe);es=u(rt,"Audio Diffusion"),rt.forEach(s),Si.forEach(s),hi=l(e),P=o(e,"H2",{class:!0});var Li=r(P);C=o(Li,"A",{id:!0,class:!0,href:!0});var at=r(C);Ce=o(at,"SPAN",{});var nt=r(Ce);h(ee.$$.fragment,nt),nt.forEach(s),at.forEach(s),is=l(Li),He=o(Li,"SPAN",{});var lt=r(He);ss=u(lt,"Overview"),lt.forEach(s),Li.forEach(s),mi=l(e),ie=o(e,"P",{});var et=r(ie);se=o(et,"A",{href:!0,rel:!0});var pt=r(se);ts=u(pt,"Audio Diffusion"),pt.forEach(s),os=u(et," by Robert Dargavel Smith."),et.forEach(s),gi=l(e),ke=o(e,"P",{});var ft=r(ke);rs=u(ft,`Audio Diffusion leverages the recent advances in image generation using diffusion models by converting audio samples to
and from mel spectrogram images.`),ft.forEach(s),_i=l(e),H=o(e,"P",{});var qi=r(H);as=u(qi,"The original codebase of this implementation can be found "),te=o(qi,"A",{href:!0,rel:!0});var dt=r(te);ns=u(dt,"here"),dt.forEach(s),ls=u(qi,`, including
training scripts and example notebooks.`),qi.forEach(s),vi=l(e),E=o(e,"H2",{class:!0});var Ci=r(E);G=o(Ci,"A",{id:!0,class:!0,href:!0});var ut=r(G);Ge=o(ut,"SPAN",{});var ct=r(Ge);h(oe.$$.fragment,ct),ct.forEach(s),ut.forEach(s),ps=l(Ci),Ve=o(Ci,"SPAN",{});var ht=r(Ve);fs=u(ht,"Available Pipelines:"),ht.forEach(s),Ci.forEach(s),$i=l(e),V=o(e,"TABLE",{});var Hi=r(V);Re=o(Hi,"THEAD",{});var mt=r(Re);k=o(mt,"TR",{});var Ne=r(k);Oe=o(Ne,"TH",{});var gt=r(Oe);ds=u(gt,"Pipeline"),gt.forEach(s),us=l(Ne),Ue=o(Ne,"TH",{});var _t=r(Ue);cs=u(_t,"Tasks"),_t.forEach(s),hs=l(Ne),xe=o(Ne,"TH",{align:!0});var vt=r(xe);ms=u(vt,"Colab"),vt.forEach(s),Ne.forEach(s),mt.forEach(s),gs=l(Hi),ze=o(Hi,"TBODY",{});var $t=r(ze);x=o($t,"TR",{});var Te=r(x);Be=o(Te,"TD",{});var bt=r(Be);re=o(bt,"A",{href:!0,rel:!0});var yt=r(re);_s=u(yt,"pipeline_audio_diffusion.py"),yt.forEach(s),bt.forEach(s),vs=l(Te),Ke=o(Te,"TD",{});var wt=r(Ke);Fe=o(wt,"EM",{});var Dt=r(Fe);$s=u(Dt,"Unconditional Audio Generation"),Dt.forEach(s),wt.forEach(s),bs=l(Te),je=o(Te,"TD",{align:!0});var At=r(je);ae=o(At,"A",{href:!0,rel:!0});var Pt=r(ae);Me=o(Pt,"IMG",{src:!0,alt:!0}),Pt.forEach(s),At.forEach(s),Te.forEach(s),$t.forEach(s),Hi.forEach(s),bi=l(e),j=o(e,"H2",{class:!0});var Gi=r(j);R=o(Gi,"A",{id:!0,class:!0,href:!0});var Et=r(R);Je=o(Et,"SPAN",{});var kt=r(Je);h(ne.$$.fragment,kt),kt.forEach(s),Et.forEach(s),ys=l(Gi),Ye=o(Gi,"SPAN",{});var xt=r(Ye);ws=u(xt,"Examples:"),xt.forEach(s),Gi.forEach(s),yi=l(e),M=o(e,"H3",{class:!0});var Vi=r(M);O=o(Vi,"A",{id:!0,class:!0,href:!0});var jt=r(O);Qe=o(jt,"SPAN",{});var Mt=r(Qe);h(le.$$.fragment,Mt),Mt.forEach(s),jt.forEach(s),Ds=l(Vi),We=o(Vi,"SPAN",{});var It=r(We);As=u(It,"Audio Diffusion"),It.forEach(s),Vi.forEach(s),wi=l(e),h(pe.$$.fragment,e),Di=l(e),I=o(e,"H3",{class:!0});var Ri=r(I);U=o(Ri,"A",{id:!0,class:!0,href:!0});var Nt=r(U);Xe=o(Nt,"SPAN",{});var Tt=r(Xe);h(fe.$$.fragment,Tt),Tt.forEach(s),Nt.forEach(s),Ps=l(Ri),Ze=o(Ri,"SPAN",{});var St=r(Ze);Es=u(St,"Latent Audio Diffusion"),St.forEach(s),Ri.forEach(s),Ai=l(e),h(de.$$.fragment,e),Pi=l(e),N=o(e,"H3",{class:!0});var Oi=r(N);z=o(Oi,"A",{id:!0,class:!0,href:!0});var Lt=r(z);ei=o(Lt,"SPAN",{});var qt=r(ei);h(ue.$$.fragment,qt),qt.forEach(s),Lt.forEach(s),ks=l(Oi),ii=o(Oi,"SPAN",{});var Ct=r(ii);xs=u(Ct,"Audio Diffusion with DDIM (faster)"),Ct.forEach(s),Oi.forEach(s),Ei=l(e),h(ce.$$.fragment,e),ki=l(e),T=o(e,"H3",{class:!0});var Ui=r(T);B=o(Ui,"A",{id:!0,class:!0,href:!0});var Ht=r(B);si=o(Ht,"SPAN",{});var Gt=r(si);h(he.$$.fragment,Gt),Gt.forEach(s),Ht.forEach(s),js=l(Ui),ti=o(Ui,"SPAN",{});var Vt=r(ti);Ms=u(Vt,"Variations, in-painting, out-painting etc."),Vt.forEach(s),Ui.forEach(s),xi=l(e),h(me.$$.fragment,e),ji=l(e),S=o(e,"H2",{class:!0});var zi=r(S);K=o(zi,"A",{id:!0,class:!0,href:!0});var Rt=r(K);oi=o(Rt,"SPAN",{});var Ot=r(oi);h(ge.$$.fragment,Ot),Ot.forEach(s),Rt.forEach(s),Is=l(zi),ri=o(zi,"SPAN",{});var Ut=r(ri);Ns=u(Ut,"AudioDiffusionPipeline"),Ut.forEach(s),zi.forEach(s),Mi=l(e),$=o(e,"DIV",{class:!0});var y=r($);h(_e.$$.fragment,y),Ts=l(y),ve=o(y,"P",{});var Bi=r(ve);Ss=u(Bi,"This model inherits from "),Ie=o(Bi,"A",{href:!0});var zt=r(Ie);Ls=u(zt,"DiffusionPipeline"),zt.forEach(s),qs=u(Bi,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Bi.forEach(s),Cs=l(y),F=o(y,"DIV",{class:!0});var Ki=r(F);h($e.$$.fragment,Ki),Hs=l(Ki),ai=o(Ki,"P",{});var Bt=r(ai);Gs=u(Bt,"Generate random mel spectrogram from audio input and convert to audio."),Bt.forEach(s),Ki.forEach(s),Vs=l(y),J=o(y,"DIV",{class:!0});var Fi=r(J);h(be.$$.fragment,Fi),Rs=l(Fi),ni=o(Fi,"P",{});var Kt=r(ni);Os=u(Kt,"Reverse step process: recover noisy image from generated image."),Kt.forEach(s),Fi.forEach(s),Us=l(y),Y=o(y,"DIV",{class:!0});var Ji=r(Y);h(ye.$$.fragment,Ji),zs=l(Ji),li=o(Ji,"P",{});var Ft=r(li);Bs=u(Ft,"Spherical Linear intERPolation"),Ft.forEach(s),Ji.forEach(s),y.forEach(s),Ii=l(e),L=o(e,"H2",{class:!0});var Yi=r(L);Q=o(Yi,"A",{id:!0,class:!0,href:!0});var Jt=r(Q);pi=o(Jt,"SPAN",{});var Yt=r(pi);h(we.$$.fragment,Yt),Yt.forEach(s),Jt.forEach(s),Ks=l(Yi),fi=o(Yi,"SPAN",{});var Qt=r(fi);Fs=u(Qt,"Mel"),Qt.forEach(s),Yi.forEach(s),Ni=l(e),b=o(e,"DIV",{class:!0});var Se=r(b);h(De.$$.fragment,Se),Js=l(Se),W=o(Se,"DIV",{class:!0});var Qi=r(W);h(Ae.$$.fragment,Qi),Ys=l(Qi),di=o(Qi,"P",{});var Wt=r(di);Qs=u(Wt,"Convert slice of audio to spectrogram."),Wt.forEach(s),Qi.forEach(s),Ws=l(Se),X=o(Se,"DIV",{class:!0});var Wi=r(X);h(Pe.$$.fragment,Wi),Xs=l(Wi),ui=o(Wi,"P",{});var Xt=r(ui);Zs=u(Xt,"Converts spectrogram to audio."),Xt.forEach(s),Wi.forEach(s),Se.forEach(s),this.h()},h(){a(D,"name","hf:doc:metadata"),a(D,"content",JSON.stringify(no)),a(q,"id","audio-diffusion"),a(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(q,"href","#audio-diffusion"),a(A,"class","relative group"),a(C,"id","overview"),a(C,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(C,"href","#overview"),a(P,"class","relative group"),a(se,"href","https://github.com/teticio/audio-diffusion"),a(se,"rel","nofollow"),a(te,"href","https://github.com/teticio/audio-diffusion"),a(te,"rel","nofollow"),a(G,"id","available-pipelines"),a(G,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(G,"href","#available-pipelines"),a(E,"class","relative group"),a(xe,"align","center"),a(re,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/audio_diffusion/pipeline_audio_diffusion.py"),a(re,"rel","nofollow"),to(Me.src,st="https://colab.research.google.com/assets/colab-badge.svg")||a(Me,"src",st),a(Me,"alt","Open In Colab"),a(ae,"href","https://colab.research.google.com/github/teticio/audio-diffusion/blob/master/notebooks/audio_diffusion_pipeline.ipynb"),a(ae,"rel","nofollow"),a(je,"align","center"),a(R,"id","examples"),a(R,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(R,"href","#examples"),a(j,"class","relative group"),a(O,"id","audio-diffusion"),a(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(O,"href","#audio-diffusion"),a(M,"class","relative group"),a(U,"id","latent-audio-diffusion"),a(U,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(U,"href","#latent-audio-diffusion"),a(I,"class","relative group"),a(z,"id","audio-diffusion-with-ddim-faster"),a(z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(z,"href","#audio-diffusion-with-ddim-faster"),a(N,"class","relative group"),a(B,"id","variations-inpainting-outpainting-etc"),a(B,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(B,"href","#variations-inpainting-outpainting-etc"),a(T,"class","relative group"),a(K,"id","diffusers.AudioDiffusionPipeline"),a(K,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(K,"href","#diffusers.AudioDiffusionPipeline"),a(S,"class","relative group"),a(Ie,"href","/docs/diffusers/v0.11.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),a(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(Q,"id","diffusers.Mel"),a(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(Q,"href","#diffusers.Mel"),a(L,"class","relative group"),a(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(b,"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,p){i(document.head,D),f(e,ci,p),f(e,A,p),i(A,q),i(q,Le),m(Z,Le,null),i(A,Zi),i(A,qe),i(qe,es),f(e,hi,p),f(e,P,p),i(P,C),i(C,Ce),m(ee,Ce,null),i(P,is),i(P,He),i(He,ss),f(e,mi,p),f(e,ie,p),i(ie,se),i(se,ts),i(ie,os),f(e,gi,p),f(e,ke,p),i(ke,rs),f(e,_i,p),f(e,H,p),i(H,as),i(H,te),i(te,ns),i(H,ls),f(e,vi,p),f(e,E,p),i(E,G),i(G,Ge),m(oe,Ge,null),i(E,ps),i(E,Ve),i(Ve,fs),f(e,$i,p),f(e,V,p),i(V,Re),i(Re,k),i(k,Oe),i(Oe,ds),i(k,us),i(k,Ue),i(Ue,cs),i(k,hs),i(k,xe),i(xe,ms),i(V,gs),i(V,ze),i(ze,x),i(x,Be),i(Be,re),i(re,_s),i(x,vs),i(x,Ke),i(Ke,Fe),i(Fe,$s),i(x,bs),i(x,je),i(je,ae),i(ae,Me),f(e,bi,p),f(e,j,p),i(j,R),i(R,Je),m(ne,Je,null),i(j,ys),i(j,Ye),i(Ye,ws),f(e,yi,p),f(e,M,p),i(M,O),i(O,Qe),m(le,Qe,null),i(M,Ds),i(M,We),i(We,As),f(e,wi,p),m(pe,e,p),f(e,Di,p),f(e,I,p),i(I,U),i(U,Xe),m(fe,Xe,null),i(I,Ps),i(I,Ze),i(Ze,Es),f(e,Ai,p),m(de,e,p),f(e,Pi,p),f(e,N,p),i(N,z),i(z,ei),m(ue,ei,null),i(N,ks),i(N,ii),i(ii,xs),f(e,Ei,p),m(ce,e,p),f(e,ki,p),f(e,T,p),i(T,B),i(B,si),m(he,si,null),i(T,js),i(T,ti),i(ti,Ms),f(e,xi,p),m(me,e,p),f(e,ji,p),f(e,S,p),i(S,K),i(K,oi),m(ge,oi,null),i(S,Is),i(S,ri),i(ri,Ns),f(e,Mi,p),f(e,$,p),m(_e,$,null),i($,Ts),i($,ve),i(ve,Ss),i(ve,Ie),i(Ie,Ls),i(ve,qs),i($,Cs),i($,F),m($e,F,null),i(F,Hs),i(F,ai),i(ai,Gs),i($,Vs),i($,J),m(be,J,null),i(J,Rs),i(J,ni),i(ni,Os),i($,Us),i($,Y),m(ye,Y,null),i(Y,zs),i(Y,li),i(li,Bs),f(e,Ii,p),f(e,L,p),i(L,Q),i(Q,pi),m(we,pi,null),i(L,Ks),i(L,fi),i(fi,Fs),f(e,Ni,p),f(e,b,p),m(De,b,null),i(b,Js),i(b,W),m(Ae,W,null),i(W,Ys),i(W,di),i(di,Qs),i(b,Ws),i(b,X),m(Pe,X,null),i(X,Xs),i(X,ui),i(ui,Zs),Ti=!0},p:oo,i(e){Ti||(g(Z.$$.fragment,e),g(ee.$$.fragment,e),g(oe.$$.fragment,e),g(ne.$$.fragment,e),g(le.$$.fragment,e),g(pe.$$.fragment,e),g(fe.$$.fragment,e),g(de.$$.fragment,e),g(ue.$$.fragment,e),g(ce.$$.fragment,e),g(he.$$.fragment,e),g(me.$$.fragment,e),g(ge.$$.fragment,e),g(_e.$$.fragment,e),g($e.$$.fragment,e),g(be.$$.fragment,e),g(ye.$$.fragment,e),g(we.$$.fragment,e),g(De.$$.fragment,e),g(Ae.$$.fragment,e),g(Pe.$$.fragment,e),Ti=!0)},o(e){_(Z.$$.fragment,e),_(ee.$$.fragment,e),_(oe.$$.fragment,e),_(ne.$$.fragment,e),_(le.$$.fragment,e),_(pe.$$.fragment,e),_(fe.$$.fragment,e),_(de.$$.fragment,e),_(ue.$$.fragment,e),_(ce.$$.fragment,e),_(he.$$.fragment,e),_(me.$$.fragment,e),_(ge.$$.fragment,e),_(_e.$$.fragment,e),_($e.$$.fragment,e),_(be.$$.fragment,e),_(ye.$$.fragment,e),_(we.$$.fragment,e),_(De.$$.fragment,e),_(Ae.$$.fragment,e),_(Pe.$$.fragment,e),Ti=!1},d(e){s(D),e&&s(ci),e&&s(A),v(Z),e&&s(hi),e&&s(P),v(ee),e&&s(mi),e&&s(ie),e&&s(gi),e&&s(ke),e&&s(_i),e&&s(H),e&&s(vi),e&&s(E),v(oe),e&&s($i),e&&s(V),e&&s(bi),e&&s(j),v(ne),e&&s(yi),e&&s(M),v(le),e&&s(wi),v(pe,e),e&&s(Di),e&&s(I),v(fe),e&&s(Ai),v(de,e),e&&s(Pi),e&&s(N),v(ue),e&&s(Ei),v(ce,e),e&&s(ki),e&&s(T),v(he),e&&s(xi),v(me,e),e&&s(ji),e&&s(S),v(ge),e&&s(Mi),e&&s($),v(_e),v($e),v(be),v(ye),e&&s(Ii),e&&s(L),v(we),e&&s(Ni),e&&s(b),v(De),v(Ae),v(Pe)}}}const no={local:"audio-diffusion",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"examples",sections:[{local:"audio-diffusion",title:"Audio Diffusion"},{local:"latent-audio-diffusion",title:"Latent Audio Diffusion"},{local:"audio-diffusion-with-ddim-faster",title:"Audio Diffusion with DDIM (faster)"},{local:"variations-inpainting-outpainting-etc",title:"Variations, in-painting, out-painting etc."}],title:"Examples:"},{local:"diffusers.AudioDiffusionPipeline",title:"AudioDiffusionPipeline"},{local:"diffusers.Mel",title:"Mel"}],title:"Audio Diffusion"};function lo(it){return ro(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ho extends Zt{constructor(D){super();eo(this,D,lo,ao,io,{})}}export{ho as default,no as metadata};
