import{s as Ne,o as Ee,n as je}from"../chunks/scheduler.182ea377.js";import{S as qe,i as Oe,g as d,s as o,r as g,A as Ye,h as p,f as n,c as r,j as O,u as h,x as T,k as Y,y as u,a,v as _,d as M,t as y,w as b}from"../chunks/index.abf12888.js";import{T as Qe}from"../chunks/Tip.230e2334.js";import{D as se}from"../chunks/Docstring.93f6f462.js";import{C as Re}from"../chunks/CodeBlock.57fe6e13.js";import{E as ze}from"../chunks/ExampleCodeBlock.658f5cd6.js";import{H as _e}from"../chunks/Heading.16916d63.js";function Xe(U){let i,w='Make sure to check out the Schedulers <a href="../../using-diffusers/schedulers">guide</a> to learn how to explore the tradeoff between scheduler speed and quality, and see the <a href="../../using-diffusers/loading#reuse-components-across-pipelines">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.';return{c(){i=d("p"),i.innerHTML=w},l(c){i=p(c,"P",{"data-svelte-h":!0}),T(i)!=="svelte-1wmc0l4"&&(i.innerHTML=w)},m(c,l){a(c,i,l)},p:je,d(c){c&&n(i)}}}function He(U){let i,w="Example:",c,l,m;return l=new Re({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwbG9hZCUyMG1vZGVsJTIwYW5kJTIwc2NoZWR1bGVyJTBBbGRtJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMkNvbXBWaXMlMkZsZG0tdGV4dDJpbS1sYXJnZS0yNTYlMjIpJTBBJTBBJTIzJTIwcnVuJTIwcGlwZWxpbmUlMjBpbiUyMGluZmVyZW5jZSUyMChzYW1wbGUlMjByYW5kb20lMjBub2lzZSUyMGFuZCUyMGRlbm9pc2UpJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMHBhaW50aW5nJTIwb2YlMjBhJTIwc3F1aXJyZWwlMjBlYXRpbmclMjBhJTIwYnVyZ2VyJTIyJTBBaW1hZ2VzJTIwJTNEJTIwbGRtKCU1QnByb21wdCU1RCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUyMGV0YSUzRDAuMyUyQyUyMGd1aWRhbmNlX3NjYWxlJTNENikuaW1hZ2VzJTBBJTBBJTIzJTIwc2F2ZSUyMGltYWdlcyUwQWZvciUyMGlkeCUyQyUyMGltYWdlJTIwaW4lMjBlbnVtZXJhdGUoaW1hZ2VzKSUzQSUwQSUyMCUyMCUyMCUyMGltYWdlLnNhdmUoZiUyMnNxdWlycmVsLSU3QmlkeCU3RC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load model and scheduler</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>ldm = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># run pipeline in inference (sample random noise and denoise)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A painting of a squirrel eating a burger&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>images = ldm([prompt], num_inference_steps=<span class="hljs-number">50</span>, eta=<span class="hljs-number">0.3</span>, guidance_scale=<span class="hljs-number">6</span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save images</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> idx, image <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(images):
<span class="hljs-meta">... </span>    image.save(<span class="hljs-string">f&quot;squirrel-<span class="hljs-subst">{idx}</span>.png&quot;</span>)`,wrap:!1}}),{c(){i=d("p"),i.textContent=w,c=o(),g(l.$$.fragment)},l(s){i=p(s,"P",{"data-svelte-h":!0}),T(i)!=="svelte-11lpom8"&&(i.textContent=w),c=r(s),h(l.$$.fragment,s)},m(s,f){a(s,i,f),a(s,c,f),_(l,s,f),m=!0},p:je,i(s){m||(M(l.$$.fragment,s),m=!0)},o(s){y(l.$$.fragment,s),m=!1},d(s){s&&(n(i),n(c)),b(l,s)}}}function Ae(U){let i,w="Example:",c,l,m;return l=new Re({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFmcm9tJTIwaW8lMjBpbXBvcnQlMjBCeXRlc0lPJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMExETVN1cGVyUmVzb2x1dGlvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMjBhbmQlMjBzY2hlZHVsZXIlMEFwaXBlbGluZSUyMCUzRCUyMExETVN1cGVyUmVzb2x1dGlvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJDb21wVmlzJTJGbGRtLXN1cGVyLXJlc29sdXRpb24tNHgtb3BlbmltYWdlcyUyMiklMEFwaXBlbGluZSUyMCUzRCUyMHBpcGVsaW5lLnRvKCUyMmN1ZGElMjIpJTBBJTBBJTIzJTIwbGV0J3MlMjBkb3dubG9hZCUyMGFuJTIwJTIwaW1hZ2UlMEF1cmwlMjAlM0QlMjAoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZ1c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20lMkYzODA2MTY1OSUyRjE5OTcwNTg5Ni1iNDhlMTdiOC1iMjMxLTQ3Y2QtYTI3MC00ZmZhNWE5M2ZhM2UucG5nJTIyJTBBKSUwQXJlc3BvbnNlJTIwJTNEJTIwcmVxdWVzdHMuZ2V0KHVybCklMEFsb3dfcmVzX2ltZyUyMCUzRCUyMEltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBbG93X3Jlc19pbWclMjAlM0QlMjBsb3dfcmVzX2ltZy5yZXNpemUoKDEyOCUyQyUyMDEyOCkpJTBBJTBBJTIzJTIwcnVuJTIwcGlwZWxpbmUlMjBpbiUyMGluZmVyZW5jZSUyMChzYW1wbGUlMjByYW5kb20lMjBub2lzZSUyMGFuZCUyMGRlbm9pc2UpJTBBdXBzY2FsZWRfaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShsb3dfcmVzX2ltZyUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QxMDAlMkMlMjBldGElM0QxKS5pbWFnZXMlNUIwJTVEJTBBJTIzJTIwc2F2ZSUyMGltYWdlJTBBdXBzY2FsZWRfaW1hZ2Uuc2F2ZSglMjJsZG1fZ2VuZXJhdGVkX2ltYWdlLnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LDMSuperResolutionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load model and scheduler</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = LDMSuperResolutionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/ldm-super-resolution-4x-openimages&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># let&#x27;s download an  image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url = (
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://user-images.githubusercontent.com/38061659/199705896-b48e17b8-b231-47cd-a270-4ffa5a93fa3e.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>low_res_img = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>low_res_img = low_res_img.resize((<span class="hljs-number">128</span>, <span class="hljs-number">128</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># run pipeline in inference (sample random noise and denoise)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>upscaled_image = pipeline(low_res_img, num_inference_steps=<span class="hljs-number">100</span>, eta=<span class="hljs-number">1</span>).images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>upscaled_image.save(<span class="hljs-string">&quot;ldm_generated_image.png&quot;</span>)`,wrap:!1}}),{c(){i=d("p"),i.textContent=w,c=o(),g(l.$$.fragment)},l(s){i=p(s,"P",{"data-svelte-h":!0}),T(i)!=="svelte-11lpom8"&&(i.textContent=w),c=r(s),h(l.$$.fragment,s)},m(s,f){a(s,i,f),a(s,c,f),_(l,s,f),m=!0},p:je,i(s){m||(M(l.$$.fragment,s),m=!0)},o(s){y(l.$$.fragment,s),m=!1},d(s){s&&(n(i),n(c)),b(l,s)}}}function Fe(U){let i,w,c,l,m,s,f,Le='Latent Diffusion was proposed in <a href="https://huggingface.co/papers/2112.10752" rel="nofollow">High-Resolution Image Synthesis with Latent Diffusion Models</a> by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer.',ie,C,Ue="The abstract from the paper is:",ae,Z,Je="<em>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.</em>",oe,G,Se='The original codebase can be found at <a href="https://github.com/CompVis/latent-diffusion" rel="nofollow">CompVis/latent-diffusion</a>.',re,J,le,V,de,v,k,Me,Q,Be="Pipeline for text-to-image generation using latent diffusion.",ye,X,Ce=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,be,D,W,Te,H,Ze="The call function to the pipeline for generation.",we,S,pe,z,ce,x,R,ve,A,Ge="A pipeline for image super-resolution using latent diffusion.",xe,F,Ve=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,Ie,P,N,$e,K,ke="The call function to the pipeline for generation.",De,B,ue,E,me,j,q,Pe,ee,We="Output class for image pipelines.",fe,ne,ge;return m=new _e({props:{title:"Latent Diffusion",local:"latent-diffusion",headingTag:"h1"}}),J=new Qe({props:{$$slots:{default:[Xe]},$$scope:{ctx:U}}}),V=new _e({props:{title:"LDMTextToImagePipeline",local:"diffusers.LDMTextToImagePipeline",headingTag:"h2"}}),k=new se({props:{name:"class diffusers.LDMTextToImagePipeline",anchor:"diffusers.LDMTextToImagePipeline",parameters:[{name:"vqvae",val:": typing.Union[diffusers.models.vq_model.VQModel, diffusers.models.autoencoders.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/main/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 <code>BERT</code>.`,name:"bert"},{anchor:"diffusers.LDMTextToImagePipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer" rel="nofollow">BertTokenizer</a>) &#x2014;
A <code>BertTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.LDMTextToImagePipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.LDMTextToImagePipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/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/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L32"}}),W=new se({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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.LDMTextToImagePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></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 is 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 generated image. Choose between <code>PIL.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>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/dit#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L67",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/dit#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> is returned, otherwise a <code>tuple</code> is
returned where the first element is a list with the generated images.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/pipelines/dit#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),S=new ze({props:{anchor:"diffusers.LDMTextToImagePipeline.__call__.example",$$slots:{default:[He]},$$scope:{ctx:U}}}),z=new _e({props:{title:"LDMSuperResolutionPipeline",local:"diffusers.LDMSuperResolutionPipeline",headingTag:"h2"}}),R=new se({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/main/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.LDMSuperResolutionPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d#diffusers.UNet2DModel">UNet2DModel</a>) &#x2014;
A <code>UNet2DModel</code> to denoise the encoded image.`,name:"unet"},{anchor:"diffusers.LDMSuperResolutionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/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/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler">EulerDiscreteScheduler</a>,
<a href="/docs/diffusers/main/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler">EulerAncestralDiscreteScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py#L33"}}),N=new se({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 to 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;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></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 generated image. Choose between <code>PIL.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>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/dit#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py#L67",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/dit#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> is returned, otherwise a <code>tuple</code> is
returned where the first element is a list with the generated images</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/pipelines/dit#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),B=new ze({props:{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.example",$$slots:{default:[Ae]},$$scope:{ctx:U}}}),E=new _e({props:{title:"ImagePipelineOutput",local:"diffusers.ImagePipelineOutput",headingTag:"h2"}}),q=new se({props:{name:"class diffusers.ImagePipelineOutput",anchor:"diffusers.ImagePipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"}],parametersDescription:[{anchor:"diffusers.ImagePipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L116"}}),{c(){i=d("meta"),w=o(),c=d("p"),l=o(),g(m.$$.fragment),s=o(),f=d("p"),f.innerHTML=Le,ie=o(),C=d("p"),C.textContent=Ue,ae=o(),Z=d("p"),Z.innerHTML=Je,oe=o(),G=d("p"),G.innerHTML=Se,re=o(),g(J.$$.fragment),le=o(),g(V.$$.fragment),de=o(),v=d("div"),g(k.$$.fragment),Me=o(),Q=d("p"),Q.textContent=Be,ye=o(),X=d("p"),X.innerHTML=Ce,be=o(),D=d("div"),g(W.$$.fragment),Te=o(),H=d("p"),H.textContent=Ze,we=o(),g(S.$$.fragment),pe=o(),g(z.$$.fragment),ce=o(),x=d("div"),g(R.$$.fragment),ve=o(),A=d("p"),A.textContent=Ge,xe=o(),F=d("p"),F.innerHTML=Ve,Ie=o(),P=d("div"),g(N.$$.fragment),$e=o(),K=d("p"),K.textContent=ke,De=o(),g(B.$$.fragment),ue=o(),g(E.$$.fragment),me=o(),j=d("div"),g(q.$$.fragment),Pe=o(),ee=d("p"),ee.textContent=We,fe=o(),ne=d("p"),this.h()},l(e){const t=Ye("svelte-u9bgzb",document.head);i=p(t,"META",{name:!0,content:!0}),t.forEach(n),w=r(e),c=p(e,"P",{}),O(c).forEach(n),l=r(e),h(m.$$.fragment,e),s=r(e),f=p(e,"P",{"data-svelte-h":!0}),T(f)!=="svelte-1dm5g0h"&&(f.innerHTML=Le),ie=r(e),C=p(e,"P",{"data-svelte-h":!0}),T(C)!=="svelte-1cwsb16"&&(C.textContent=Ue),ae=r(e),Z=p(e,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-mfilaa"&&(Z.innerHTML=Je),oe=r(e),G=p(e,"P",{"data-svelte-h":!0}),T(G)!=="svelte-13wc5yz"&&(G.innerHTML=Se),re=r(e),h(J.$$.fragment,e),le=r(e),h(V.$$.fragment,e),de=r(e),v=p(e,"DIV",{class:!0});var I=O(v);h(k.$$.fragment,I),Me=r(I),Q=p(I,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-v0jro5"&&(Q.textContent=Be),ye=r(I),X=p(I,"P",{"data-svelte-h":!0}),T(X)!=="svelte-496sm0"&&(X.innerHTML=Ce),be=r(I),D=p(I,"DIV",{class:!0});var L=O(D);h(W.$$.fragment,L),Te=r(L),H=p(L,"P",{"data-svelte-h":!0}),T(H)!=="svelte-50j04k"&&(H.textContent=Ze),we=r(L),h(S.$$.fragment,L),L.forEach(n),I.forEach(n),pe=r(e),h(z.$$.fragment,e),ce=r(e),x=p(e,"DIV",{class:!0});var $=O(x);h(R.$$.fragment,$),ve=r($),A=p($,"P",{"data-svelte-h":!0}),T(A)!=="svelte-gocjs6"&&(A.textContent=Ge),xe=r($),F=p($,"P",{"data-svelte-h":!0}),T(F)!=="svelte-496sm0"&&(F.innerHTML=Ve),Ie=r($),P=p($,"DIV",{class:!0});var te=O(P);h(N.$$.fragment,te),$e=r(te),K=p(te,"P",{"data-svelte-h":!0}),T(K)!=="svelte-50j04k"&&(K.textContent=ke),De=r(te),h(B.$$.fragment,te),te.forEach(n),$.forEach(n),ue=r(e),h(E.$$.fragment,e),me=r(e),j=p(e,"DIV",{class:!0});var he=O(j);h(q.$$.fragment,he),Pe=r(he),ee=p(he,"P",{"data-svelte-h":!0}),T(ee)!=="svelte-19wetgi"&&(ee.textContent=We),he.forEach(n),fe=r(e),ne=p(e,"P",{}),O(ne).forEach(n),this.h()},h(){Y(i,"name","hf:doc:metadata"),Y(i,"content",Ke),Y(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(j,"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){u(document.head,i),a(e,w,t),a(e,c,t),a(e,l,t),_(m,e,t),a(e,s,t),a(e,f,t),a(e,ie,t),a(e,C,t),a(e,ae,t),a(e,Z,t),a(e,oe,t),a(e,G,t),a(e,re,t),_(J,e,t),a(e,le,t),_(V,e,t),a(e,de,t),a(e,v,t),_(k,v,null),u(v,Me),u(v,Q),u(v,ye),u(v,X),u(v,be),u(v,D),_(W,D,null),u(D,Te),u(D,H),u(D,we),_(S,D,null),a(e,pe,t),_(z,e,t),a(e,ce,t),a(e,x,t),_(R,x,null),u(x,ve),u(x,A),u(x,xe),u(x,F),u(x,Ie),u(x,P),_(N,P,null),u(P,$e),u(P,K),u(P,De),_(B,P,null),a(e,ue,t),_(E,e,t),a(e,me,t),a(e,j,t),_(q,j,null),u(j,Pe),u(j,ee),a(e,fe,t),a(e,ne,t),ge=!0},p(e,[t]){const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),J.$set(I);const L={};t&2&&(L.$$scope={dirty:t,ctx:e}),S.$set(L);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),B.$set($)},i(e){ge||(M(m.$$.fragment,e),M(J.$$.fragment,e),M(V.$$.fragment,e),M(k.$$.fragment,e),M(W.$$.fragment,e),M(S.$$.fragment,e),M(z.$$.fragment,e),M(R.$$.fragment,e),M(N.$$.fragment,e),M(B.$$.fragment,e),M(E.$$.fragment,e),M(q.$$.fragment,e),ge=!0)},o(e){y(m.$$.fragment,e),y(J.$$.fragment,e),y(V.$$.fragment,e),y(k.$$.fragment,e),y(W.$$.fragment,e),y(S.$$.fragment,e),y(z.$$.fragment,e),y(R.$$.fragment,e),y(N.$$.fragment,e),y(B.$$.fragment,e),y(E.$$.fragment,e),y(q.$$.fragment,e),ge=!1},d(e){e&&(n(w),n(c),n(l),n(s),n(f),n(ie),n(C),n(ae),n(Z),n(oe),n(G),n(re),n(le),n(de),n(v),n(pe),n(ce),n(x),n(ue),n(me),n(j),n(fe),n(ne)),n(i),b(m,e),b(J,e),b(V,e),b(k),b(W),b(S),b(z,e),b(R),b(N),b(B),b(E,e),b(q)}}}const Ke='{"title":"Latent Diffusion","local":"latent-diffusion","sections":[{"title":"LDMTextToImagePipeline","local":"diffusers.LDMTextToImagePipeline","sections":[],"depth":2},{"title":"LDMSuperResolutionPipeline","local":"diffusers.LDMSuperResolutionPipeline","sections":[],"depth":2},{"title":"ImagePipelineOutput","local":"diffusers.ImagePipelineOutput","sections":[],"depth":2}],"depth":1}';function et(U){return Ee(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class lt extends qe{constructor(i){super(),Oe(this,i,et,Fe,Ne,{})}}export{lt as component};
