import{S as bn,i as yn,s as wn,e as n,k as a,w as m,t as u,M as Dn,c as r,d as i,m as l,a as o,x as g,h as f,b as s,G as t,g as p,y as _,L as Mn,q as v,o as b,B as y,v as Pn}from"../../../chunks/vendor-hf-doc-builder.js";import{D as xt}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as le}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Tn(xi){let D,je,M,A,Me,V,$t,Pe,Et,Je,P,N,Te,Q,Lt,xe,St,Ke,O,It,W,kt,At,Ye,de,Nt,Xe,ue,$e,Ot,Ze,q,qt,F,Rt,Ct,et,T,R,Ee,j,zt,Le,Ut,tt,w,it,Bt,nt,Gt,rt,ot,x,C,Se,J,Ht,Ie,Vt,st,z,ke,$,Ae,Qt,Wt,Ne,Ft,jt,fe,Jt,Kt,K,E,Oe,Y,Yt,Xt,qe,Re,Zt,ei,pe,ti,ii,L,Ce,X,ni,ri,ze,Ue,oi,si,ce,ai,at,S,U,Be,Z,li,Ge,di,lt,I,B,He,ee,ui,Ve,fi,dt,h,te,pi,ie,ci,he,hi,mi,gi,me,ne,ut,k,G,Qe,re,_i,We,vi,ft,c,oe,bi,Fe,yi,wi,se,Di,ge,Mi,Pi,Ti,_e,ae,pt;return V=new le({}),Q=new le({}),j=new le({}),J=new le({}),Z=new le({}),ee=new le({}),te=new xt({props:{name:"class diffusers.LDMTextToImagePipeline",anchor:"diffusers.LDMTextToImagePipeline",parameters:[{name:"vqvae",val:": typing.Union[diffusers.models.vq_model.VQModel, diffusers.models.autoencoder_kl.AutoencoderKL]"},{name:"bert",val:": PreTrainedModel"},{name:"tokenizer",val:": PreTrainedTokenizer"},{name:"unet",val:": typing.Union[diffusers.models.unet_2d.UNet2DModel, diffusers.models.unet_2d_condition.UNet2DConditionModel]"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"}],parametersDescription:[{anchor:"diffusers.LDMTextToImagePipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
Vector-quantized (VQ) Model to encode and decode images to and from latent representations.`,name:"vqvae"},{anchor:"diffusers.LDMTextToImagePipeline.bert",description:`<strong>bert</strong> (<code>LDMBertModel</code>) &#x2014;
Text-encoder model based on <a href="https://huggingface.co/docs/transformers/model_doc/bert" rel="nofollow">BERT</a> architecture.`,name:"bert"},{anchor:"diffusers.LDMTextToImagePipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>transformers.BertTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer" rel="nofollow">BertTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.LDMTextToImagePipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.LDMTextToImagePipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.2/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L32"}}),ne=new xt({props:{name:"__call__",anchor:"diffusers.LDMTextToImagePipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": typing.Optional[int] = 50"},{name:"guidance_scale",val:": typing.Optional[float] = 1.0"},{name:"eta",val:": typing.Optional[float] = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.LDMTextToImagePipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code> at
the, usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.18.2/en/api/outputs#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L63",returnDescription:`
<p><code>~pipelines.utils.ImagePipelineOutput</code> if <code>return_dict</code> is
True, otherwise a \`tuple. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/outputs#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),re=new le({}),oe=new xt({props:{name:"class diffusers.LDMSuperResolutionPipeline",anchor:"diffusers.LDMSuperResolutionPipeline",parameters:[{name:"vqvae",val:": VQModel"},{name:"unet",val:": UNet2DModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler, diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteScheduler, diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep.DPMSolverMultistepScheduler]"}],parametersDescription:[{anchor:"diffusers.LDMSuperResolutionPipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
Vector-quantized (VQ) VAE Model to encode and decode images to and from latent representations.`,name:"vqvae"},{anchor:"diffusers.LDMSuperResolutionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d#diffusers.UNet2DModel">UNet2DModel</a>) &#x2014; U-Net architecture to denoise the encoded image.',name:"unet"},{anchor:"diffusers.LDMSuperResolutionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latens. Can be one of
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler">EulerDiscreteScheduler</a>,
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler">EulerAncestralDiscreteScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a>, or <a href="/docs/diffusers/v0.18.2/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py#L32"}}),ae=new xt({props:{name:"__call__",anchor:"diffusers.LDMSuperResolutionPipeline.__call__",parameters:[{name:"image",val:": typing.Union[torch.Tensor, PIL.Image.Image] = None"},{name:"batch_size",val:": typing.Optional[int] = 1"},{name:"num_inference_steps",val:": typing.Optional[int] = 100"},{name:"eta",val:": typing.Optional[float] = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.Tensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of images to generate.`,name:"batch_size"},{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.18.2/en/api/outputs#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py#L65",returnDescription:`
<p><code>~pipelines.utils.ImagePipelineOutput</code> if <code>return_dict</code> is
True, otherwise a \`tuple. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/outputs#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),{c(){D=n("meta"),je=a(),M=n("h1"),A=n("a"),Me=n("span"),m(V.$$.fragment),$t=a(),Pe=n("span"),Et=u("Latent Diffusion"),Je=a(),P=n("h2"),N=n("a"),Te=n("span"),m(Q.$$.fragment),Lt=a(),xe=n("span"),St=u("Overview"),Ke=a(),O=n("p"),It=u("Latent Diffusion was proposed in "),W=n("a"),kt=u("High-Resolution Image Synthesis with Latent Diffusion Models"),At=u(" by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),Ye=a(),de=n("p"),Nt=u("The abstract of the paper is the following:"),Xe=a(),ue=n("p"),$e=n("em"),Ot=u("By decomposing the image formation process into a sequential application of denoising autoencoders, diffusion models (DMs) achieve state-of-the-art synthesis results on image data and beyond. Additionally, their formulation allows for a guiding mechanism to control the image generation process without retraining. However, since these models typically operate directly in pixel space, optimization of powerful DMs often consumes hundreds of GPU days and inference is expensive due to sequential evaluations. To enable DM training on limited computational resources while retaining their quality and flexibility, we apply them in the latent space of powerful pretrained autoencoders. In contrast to previous work, training diffusion models on such a representation allows for the first time to reach a near-optimal point between complexity reduction and detail preservation, greatly boosting visual fidelity. By introducing cross-attention layers into the model architecture, we turn diffusion models into powerful and flexible generators for general conditioning inputs such as text or bounding boxes and high-resolution synthesis becomes possible in a convolutional manner. Our latent diffusion models (LDMs) achieve a new state of the art for image inpainting and highly competitive performance on various tasks, including unconditional image generation, semantic scene synthesis, and super-resolution, while significantly reducing computational requirements compared to pixel-based DMs."),Ze=a(),q=n("p"),qt=u("The original codebase can be found "),F=n("a"),Rt=u("here"),Ct=u("."),et=a(),T=n("h2"),R=n("a"),Ee=n("span"),m(j.$$.fragment),zt=a(),Le=n("span"),Ut=u("Tips:"),tt=a(),w=n("ul"),it=n("li"),Bt=a(),nt=n("li"),Gt=a(),rt=n("li"),ot=a(),x=n("h2"),C=n("a"),Se=n("span"),m(J.$$.fragment),Ht=a(),Ie=n("span"),Vt=u("Available Pipelines:"),st=a(),z=n("table"),ke=n("thead"),$=n("tr"),Ae=n("th"),Qt=u("Pipeline"),Wt=a(),Ne=n("th"),Ft=u("Tasks"),jt=a(),fe=n("th"),Jt=u("Colab"),Kt=a(),K=n("tbody"),E=n("tr"),Oe=n("td"),Y=n("a"),Yt=u("pipeline_latent_diffusion.py"),Xt=a(),qe=n("td"),Re=n("em"),Zt=u("Text-to-Image Generation"),ei=a(),pe=n("td"),ti=u("-"),ii=a(),L=n("tr"),Ce=n("td"),X=n("a"),ni=u("pipeline_latent_diffusion_superresolution.py"),ri=a(),ze=n("td"),Ue=n("em"),oi=u("Super Resolution"),si=a(),ce=n("td"),ai=u("-"),at=a(),S=n("h2"),U=n("a"),Be=n("span"),m(Z.$$.fragment),li=a(),Ge=n("span"),di=u("Examples:"),lt=a(),I=n("h2"),B=n("a"),He=n("span"),m(ee.$$.fragment),ui=a(),Ve=n("span"),fi=u("LDMTextToImagePipeline"),dt=a(),h=n("div"),m(te.$$.fragment),pi=a(),ie=n("p"),ci=u("This model inherits from "),he=n("a"),hi=u("DiffusionPipeline"),mi=u(`. 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.)`),gi=a(),me=n("div"),m(ne.$$.fragment),ut=a(),k=n("h2"),G=n("a"),Qe=n("span"),m(re.$$.fragment),_i=a(),We=n("span"),vi=u("LDMSuperResolutionPipeline"),ft=a(),c=n("div"),m(oe.$$.fragment),bi=a(),Fe=n("p"),yi=u("A pipeline for image super-resolution using Latent"),wi=a(),se=n("p"),Di=u("This class inherits from "),ge=n("a"),Mi=u("DiffusionPipeline"),Pi=u(`. 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.)`),Ti=a(),_e=n("div"),m(ae.$$.fragment),this.h()},l(e){const d=Dn('[data-svelte="svelte-1phssyn"]',document.head);D=r(d,"META",{name:!0,content:!0}),d.forEach(i),je=l(e),M=r(e,"H1",{class:!0});var ct=o(M);A=r(ct,"A",{id:!0,class:!0,href:!0});var $i=o(A);Me=r($i,"SPAN",{});var Ei=o(Me);g(V.$$.fragment,Ei),Ei.forEach(i),$i.forEach(i),$t=l(ct),Pe=r(ct,"SPAN",{});var Li=o(Pe);Et=f(Li,"Latent Diffusion"),Li.forEach(i),ct.forEach(i),Je=l(e),P=r(e,"H2",{class:!0});var ht=o(P);N=r(ht,"A",{id:!0,class:!0,href:!0});var Si=o(N);Te=r(Si,"SPAN",{});var Ii=o(Te);g(Q.$$.fragment,Ii),Ii.forEach(i),Si.forEach(i),Lt=l(ht),xe=r(ht,"SPAN",{});var ki=o(xe);St=f(ki,"Overview"),ki.forEach(i),ht.forEach(i),Ke=l(e),O=r(e,"P",{});var mt=o(O);It=f(mt,"Latent Diffusion was proposed in "),W=r(mt,"A",{href:!0,rel:!0});var Ai=o(W);kt=f(Ai,"High-Resolution Image Synthesis with Latent Diffusion Models"),Ai.forEach(i),At=f(mt," by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),mt.forEach(i),Ye=l(e),de=r(e,"P",{});var Ni=o(de);Nt=f(Ni,"The abstract of the paper is the following:"),Ni.forEach(i),Xe=l(e),ue=r(e,"P",{});var Oi=o(ue);$e=r(Oi,"EM",{});var qi=o($e);Ot=f(qi,"By decomposing the image formation process into a sequential application of denoising autoencoders, diffusion models (DMs) achieve state-of-the-art synthesis results on image data and beyond. Additionally, their formulation allows for a guiding mechanism to control the image generation process without retraining. However, since these models typically operate directly in pixel space, optimization of powerful DMs often consumes hundreds of GPU days and inference is expensive due to sequential evaluations. To enable DM training on limited computational resources while retaining their quality and flexibility, we apply them in the latent space of powerful pretrained autoencoders. In contrast to previous work, training diffusion models on such a representation allows for the first time to reach a near-optimal point between complexity reduction and detail preservation, greatly boosting visual fidelity. By introducing cross-attention layers into the model architecture, we turn diffusion models into powerful and flexible generators for general conditioning inputs such as text or bounding boxes and high-resolution synthesis becomes possible in a convolutional manner. Our latent diffusion models (LDMs) achieve a new state of the art for image inpainting and highly competitive performance on various tasks, including unconditional image generation, semantic scene synthesis, and super-resolution, while significantly reducing computational requirements compared to pixel-based DMs."),qi.forEach(i),Oi.forEach(i),Ze=l(e),q=r(e,"P",{});var gt=o(q);qt=f(gt,"The original codebase can be found "),F=r(gt,"A",{href:!0,rel:!0});var Ri=o(F);Rt=f(Ri,"here"),Ri.forEach(i),Ct=f(gt,"."),gt.forEach(i),et=l(e),T=r(e,"H2",{class:!0});var _t=o(T);R=r(_t,"A",{id:!0,class:!0,href:!0});var Ci=o(R);Ee=r(Ci,"SPAN",{});var zi=o(Ee);g(j.$$.fragment,zi),zi.forEach(i),Ci.forEach(i),zt=l(_t),Le=r(_t,"SPAN",{});var Ui=o(Le);Ut=f(Ui,"Tips:"),Ui.forEach(i),_t.forEach(i),tt=l(e),w=r(e,"UL",{});var ve=o(w);it=r(ve,"LI",{}),o(it).forEach(i),Bt=l(ve),nt=r(ve,"LI",{}),o(nt).forEach(i),Gt=l(ve),rt=r(ve,"LI",{}),o(rt).forEach(i),ve.forEach(i),ot=l(e),x=r(e,"H2",{class:!0});var vt=o(x);C=r(vt,"A",{id:!0,class:!0,href:!0});var Bi=o(C);Se=r(Bi,"SPAN",{});var Gi=o(Se);g(J.$$.fragment,Gi),Gi.forEach(i),Bi.forEach(i),Ht=l(vt),Ie=r(vt,"SPAN",{});var Hi=o(Ie);Vt=f(Hi,"Available Pipelines:"),Hi.forEach(i),vt.forEach(i),st=l(e),z=r(e,"TABLE",{});var bt=o(z);ke=r(bt,"THEAD",{});var Vi=o(ke);$=r(Vi,"TR",{});var be=o($);Ae=r(be,"TH",{});var Qi=o(Ae);Qt=f(Qi,"Pipeline"),Qi.forEach(i),Wt=l(be),Ne=r(be,"TH",{});var Wi=o(Ne);Ft=f(Wi,"Tasks"),Wi.forEach(i),jt=l(be),fe=r(be,"TH",{align:!0});var Fi=o(fe);Jt=f(Fi,"Colab"),Fi.forEach(i),be.forEach(i),Vi.forEach(i),Kt=l(bt),K=r(bt,"TBODY",{});var yt=o(K);E=r(yt,"TR",{});var ye=o(E);Oe=r(ye,"TD",{});var ji=o(Oe);Y=r(ji,"A",{href:!0,rel:!0});var Ji=o(Y);Yt=f(Ji,"pipeline_latent_diffusion.py"),Ji.forEach(i),ji.forEach(i),Xt=l(ye),qe=r(ye,"TD",{});var Ki=o(qe);Re=r(Ki,"EM",{});var Yi=o(Re);Zt=f(Yi,"Text-to-Image Generation"),Yi.forEach(i),Ki.forEach(i),ei=l(ye),pe=r(ye,"TD",{align:!0});var Xi=o(pe);ti=f(Xi,"-"),Xi.forEach(i),ye.forEach(i),ii=l(yt),L=r(yt,"TR",{});var we=o(L);Ce=r(we,"TD",{});var Zi=o(Ce);X=r(Zi,"A",{href:!0,rel:!0});var en=o(X);ni=f(en,"pipeline_latent_diffusion_superresolution.py"),en.forEach(i),Zi.forEach(i),ri=l(we),ze=r(we,"TD",{});var tn=o(ze);Ue=r(tn,"EM",{});var nn=o(Ue);oi=f(nn,"Super Resolution"),nn.forEach(i),tn.forEach(i),si=l(we),ce=r(we,"TD",{align:!0});var rn=o(ce);ai=f(rn,"-"),rn.forEach(i),we.forEach(i),yt.forEach(i),bt.forEach(i),at=l(e),S=r(e,"H2",{class:!0});var wt=o(S);U=r(wt,"A",{id:!0,class:!0,href:!0});var on=o(U);Be=r(on,"SPAN",{});var sn=o(Be);g(Z.$$.fragment,sn),sn.forEach(i),on.forEach(i),li=l(wt),Ge=r(wt,"SPAN",{});var an=o(Ge);di=f(an,"Examples:"),an.forEach(i),wt.forEach(i),lt=l(e),I=r(e,"H2",{class:!0});var Dt=o(I);B=r(Dt,"A",{id:!0,class:!0,href:!0});var ln=o(B);He=r(ln,"SPAN",{});var dn=o(He);g(ee.$$.fragment,dn),dn.forEach(i),ln.forEach(i),ui=l(Dt),Ve=r(Dt,"SPAN",{});var un=o(Ve);fi=f(un,"LDMTextToImagePipeline"),un.forEach(i),Dt.forEach(i),dt=l(e),h=r(e,"DIV",{class:!0});var De=o(h);g(te.$$.fragment,De),pi=l(De),ie=r(De,"P",{});var Mt=o(ie);ci=f(Mt,"This model inherits from "),he=r(Mt,"A",{href:!0});var fn=o(he);hi=f(fn,"DiffusionPipeline"),fn.forEach(i),mi=f(Mt,`. 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.)`),Mt.forEach(i),gi=l(De),me=r(De,"DIV",{class:!0});var pn=o(me);g(ne.$$.fragment,pn),pn.forEach(i),De.forEach(i),ut=l(e),k=r(e,"H2",{class:!0});var Pt=o(k);G=r(Pt,"A",{id:!0,class:!0,href:!0});var cn=o(G);Qe=r(cn,"SPAN",{});var hn=o(Qe);g(re.$$.fragment,hn),hn.forEach(i),cn.forEach(i),_i=l(Pt),We=r(Pt,"SPAN",{});var mn=o(We);vi=f(mn,"LDMSuperResolutionPipeline"),mn.forEach(i),Pt.forEach(i),ft=l(e),c=r(e,"DIV",{class:!0});var H=o(c);g(oe.$$.fragment,H),bi=l(H),Fe=r(H,"P",{});var gn=o(Fe);yi=f(gn,"A pipeline for image super-resolution using Latent"),gn.forEach(i),wi=l(H),se=r(H,"P",{});var Tt=o(se);Di=f(Tt,"This class inherits from "),ge=r(Tt,"A",{href:!0});var _n=o(ge);Mi=f(_n,"DiffusionPipeline"),_n.forEach(i),Pi=f(Tt,`. 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.)`),Tt.forEach(i),Ti=l(H),_e=r(H,"DIV",{class:!0});var vn=o(_e);g(ae.$$.fragment,vn),vn.forEach(i),H.forEach(i),this.h()},h(){s(D,"name","hf:doc:metadata"),s(D,"content",JSON.stringify(xn)),s(A,"id","latent-diffusion"),s(A,"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"),s(A,"href","#latent-diffusion"),s(M,"class","relative group"),s(N,"id","overview"),s(N,"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"),s(N,"href","#overview"),s(P,"class","relative group"),s(W,"href","https://arxiv.org/abs/2112.10752"),s(W,"rel","nofollow"),s(F,"href","https://github.com/CompVis/latent-diffusion"),s(F,"rel","nofollow"),s(R,"id","tips"),s(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"),s(R,"href","#tips"),s(T,"class","relative group"),s(C,"id","available-pipelines"),s(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"),s(C,"href","#available-pipelines"),s(x,"class","relative group"),s(fe,"align","center"),s(Y,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py"),s(Y,"rel","nofollow"),s(pe,"align","center"),s(X,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py"),s(X,"rel","nofollow"),s(ce,"align","center"),s(U,"id","examples"),s(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"),s(U,"href","#examples"),s(S,"class","relative group"),s(B,"id","diffusers.LDMTextToImagePipeline"),s(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"),s(B,"href","#diffusers.LDMTextToImagePipeline"),s(I,"class","relative group"),s(he,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),s(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(G,"id","diffusers.LDMSuperResolutionPipeline"),s(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"),s(G,"href","#diffusers.LDMSuperResolutionPipeline"),s(k,"class","relative group"),s(ge,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),s(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(c,"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,d){t(document.head,D),p(e,je,d),p(e,M,d),t(M,A),t(A,Me),_(V,Me,null),t(M,$t),t(M,Pe),t(Pe,Et),p(e,Je,d),p(e,P,d),t(P,N),t(N,Te),_(Q,Te,null),t(P,Lt),t(P,xe),t(xe,St),p(e,Ke,d),p(e,O,d),t(O,It),t(O,W),t(W,kt),t(O,At),p(e,Ye,d),p(e,de,d),t(de,Nt),p(e,Xe,d),p(e,ue,d),t(ue,$e),t($e,Ot),p(e,Ze,d),p(e,q,d),t(q,qt),t(q,F),t(F,Rt),t(q,Ct),p(e,et,d),p(e,T,d),t(T,R),t(R,Ee),_(j,Ee,null),t(T,zt),t(T,Le),t(Le,Ut),p(e,tt,d),p(e,w,d),t(w,it),t(w,Bt),t(w,nt),t(w,Gt),t(w,rt),p(e,ot,d),p(e,x,d),t(x,C),t(C,Se),_(J,Se,null),t(x,Ht),t(x,Ie),t(Ie,Vt),p(e,st,d),p(e,z,d),t(z,ke),t(ke,$),t($,Ae),t(Ae,Qt),t($,Wt),t($,Ne),t(Ne,Ft),t($,jt),t($,fe),t(fe,Jt),t(z,Kt),t(z,K),t(K,E),t(E,Oe),t(Oe,Y),t(Y,Yt),t(E,Xt),t(E,qe),t(qe,Re),t(Re,Zt),t(E,ei),t(E,pe),t(pe,ti),t(K,ii),t(K,L),t(L,Ce),t(Ce,X),t(X,ni),t(L,ri),t(L,ze),t(ze,Ue),t(Ue,oi),t(L,si),t(L,ce),t(ce,ai),p(e,at,d),p(e,S,d),t(S,U),t(U,Be),_(Z,Be,null),t(S,li),t(S,Ge),t(Ge,di),p(e,lt,d),p(e,I,d),t(I,B),t(B,He),_(ee,He,null),t(I,ui),t(I,Ve),t(Ve,fi),p(e,dt,d),p(e,h,d),_(te,h,null),t(h,pi),t(h,ie),t(ie,ci),t(ie,he),t(he,hi),t(ie,mi),t(h,gi),t(h,me),_(ne,me,null),p(e,ut,d),p(e,k,d),t(k,G),t(G,Qe),_(re,Qe,null),t(k,_i),t(k,We),t(We,vi),p(e,ft,d),p(e,c,d),_(oe,c,null),t(c,bi),t(c,Fe),t(Fe,yi),t(c,wi),t(c,se),t(se,Di),t(se,ge),t(ge,Mi),t(se,Pi),t(c,Ti),t(c,_e),_(ae,_e,null),pt=!0},p:Mn,i(e){pt||(v(V.$$.fragment,e),v(Q.$$.fragment,e),v(j.$$.fragment,e),v(J.$$.fragment,e),v(Z.$$.fragment,e),v(ee.$$.fragment,e),v(te.$$.fragment,e),v(ne.$$.fragment,e),v(re.$$.fragment,e),v(oe.$$.fragment,e),v(ae.$$.fragment,e),pt=!0)},o(e){b(V.$$.fragment,e),b(Q.$$.fragment,e),b(j.$$.fragment,e),b(J.$$.fragment,e),b(Z.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(ne.$$.fragment,e),b(re.$$.fragment,e),b(oe.$$.fragment,e),b(ae.$$.fragment,e),pt=!1},d(e){i(D),e&&i(je),e&&i(M),y(V),e&&i(Je),e&&i(P),y(Q),e&&i(Ke),e&&i(O),e&&i(Ye),e&&i(de),e&&i(Xe),e&&i(ue),e&&i(Ze),e&&i(q),e&&i(et),e&&i(T),y(j),e&&i(tt),e&&i(w),e&&i(ot),e&&i(x),y(J),e&&i(st),e&&i(z),e&&i(at),e&&i(S),y(Z),e&&i(lt),e&&i(I),y(ee),e&&i(dt),e&&i(h),y(te),y(ne),e&&i(ut),e&&i(k),y(re),e&&i(ft),e&&i(c),y(oe),y(ae)}}}const xn={local:"latent-diffusion",sections:[{local:"overview",title:"Overview"},{local:"tips",title:"Tips:"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"examples",title:"Examples:"},{local:"diffusers.LDMTextToImagePipeline",title:"LDMTextToImagePipeline"},{local:"diffusers.LDMSuperResolutionPipeline",title:"LDMSuperResolutionPipeline"}],title:"Latent Diffusion"};function $n(xi){return Pn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class In extends bn{constructor(D){super();yn(this,D,$n,Tn,wn,{})}}export{In as default,xn as metadata};
