import{s as qe,o as Oe,n as Je}from"../chunks/scheduler.182ea377.js";import{S as Ye,i as Qe,g as p,s as o,r as g,A as Xe,h as d,f as n,c as r,j as Y,u as h,x as v,k as Q,y as u,a as i,v as _,d as M,t as b,w as T}from"../chunks/index.abf12888.js";import{T as He}from"../chunks/Tip.230e2334.js";import{D as ae}from"../chunks/Docstring.81ce6c10.js";import{C as Ne}from"../chunks/CodeBlock.57fe6e13.js";import{E as Ee}from"../chunks/ExampleCodeBlock.6db7157e.js";import{H as be,E as Ae}from"../chunks/EditOnGithub.9b8e78e4.js";function Fe(J){let a,y='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(){a=p("p"),a.innerHTML=y},l(c){a=d(c,"P",{"data-svelte-h":!0}),v(a)!=="svelte-1wmc0l4"&&(a.innerHTML=y)},m(c,l){i(c,a,l)},p:Je,d(c){c&&n(a)}}}function Ke(J){let a,y="Example:",c,l,m;return l=new Ne({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(){a=p("p"),a.textContent=y,c=o(),g(l.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),v(a)!=="svelte-11lpom8"&&(a.textContent=y),c=r(s),h(l.$$.fragment,s)},m(s,f){i(s,a,f),i(s,c,f),_(l,s,f),m=!0},p:Je,i(s){m||(M(l.$$.fragment,s),m=!0)},o(s){b(l.$$.fragment,s),m=!1},d(s){s&&(n(a),n(c)),T(l,s)}}}function et(J){let a,y="Example:",c,l,m;return l=new Ne({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(){a=p("p"),a.textContent=y,c=o(),g(l.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),v(a)!=="svelte-11lpom8"&&(a.textContent=y),c=r(s),h(l.$$.fragment,s)},m(s,f){i(s,a,f),i(s,c,f),_(l,s,f),m=!0},p:Je,i(s){m||(M(l.$$.fragment,s),m=!0)},o(s){b(l.$$.fragment,s),m=!1},d(s){s&&(n(a),n(c)),T(l,s)}}}function tt(J){let a,y,c,l,m,s,f,Be='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,S,Le="The abstract from the paper is:",oe,Z,Ce="<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>",re,V,Se='The original codebase can be found at <a href="https://github.com/CompVis/latent-diffusion" rel="nofollow">CompVis/latent-diffusion</a>.',le,B,pe,G,de,w,k,Te,X,Ze="Pipeline for text-to-image generation using latent diffusion.",ve,H,Ve=`This model inherits from <a href="/docs/diffusers/v0.28.0/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.).`,ye,D,W,we,A,Ge="The call function to the pipeline for generation.",xe,L,ce,z,ue,x,R,$e,F,ke="A pipeline for image super-resolution using latent diffusion.",Ie,K,We=`This model inherits from <a href="/docs/diffusers/v0.28.0/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.).`,De,j,E,je,ee,ze="The call function to the pipeline for generation.",Pe,C,me,N,fe,P,q,Ue,te,Re="Output class for image pipelines.",ge,O,he,se,_e;return m=new be({props:{title:"Latent Diffusion",local:"latent-diffusion",headingTag:"h1"}}),B=new He({props:{$$slots:{default:[Fe]},$$scope:{ctx:J}}}),G=new be({props:{title:"LDMTextToImagePipeline",local:"diffusers.LDMTextToImagePipeline",headingTag:"h2"}}),k=new ae({props:{name:"class diffusers.LDMTextToImagePipeline",anchor:"diffusers.LDMTextToImagePipeline",parameters:[{name:"vqvae",val:": Union"},{name:"bert",val:": PreTrainedModel"},{name:"tokenizer",val:": PreTrainedTokenizer"},{name:"unet",val:": Union"},{name:"scheduler",val:": Union"}],parametersDescription:[{anchor:"diffusers.LDMTextToImagePipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.28.0/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/v4.41.2/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/v0.28.0/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/v0.28.0/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.28.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.28.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.28.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L32"}}),W=new ae({props:{name:"__call__",anchor:"diffusers.LDMTextToImagePipeline.__call__",parameters:[{name:"prompt",val:": Union"},{name:"height",val:": Optional = None"},{name:"width",val:": Optional = None"},{name:"num_inference_steps",val:": Optional = 50"},{name:"guidance_scale",val:": Optional = 1.0"},{name:"eta",val:": Optional = 0.0"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"output_type",val:": Optional = '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.Tensor</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/v0.28.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/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/v0.28.0/en/api/pipelines/ddim#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/v0.28.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),L=new Ee({props:{anchor:"diffusers.LDMTextToImagePipeline.__call__.example",$$slots:{default:[Ke]},$$scope:{ctx:J}}}),z=new be({props:{title:"LDMSuperResolutionPipeline",local:"diffusers.LDMSuperResolutionPipeline",headingTag:"h2"}}),R=new ae({props:{name:"class diffusers.LDMSuperResolutionPipeline",anchor:"diffusers.LDMSuperResolutionPipeline",parameters:[{name:"vqvae",val:": VQModel"},{name:"unet",val:": UNet2DModel"},{name:"scheduler",val:": Union"}],parametersDescription:[{anchor:"diffusers.LDMSuperResolutionPipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.28.0/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/v0.28.0/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/v0.28.0/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.28.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.28.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, <a href="/docs/diffusers/v0.28.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler">EulerDiscreteScheduler</a>,
<a href="/docs/diffusers/v0.28.0/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler">EulerAncestralDiscreteScheduler</a>, <a href="/docs/diffusers/v0.28.0/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a>, or <a href="/docs/diffusers/v0.28.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py#L33"}}),E=new ae({props:{name:"__call__",anchor:"diffusers.LDMSuperResolutionPipeline.__call__",parameters:[{name:"image",val:": Union = None"},{name:"batch_size",val:": Optional = 1"},{name:"num_inference_steps",val:": Optional = 100"},{name:"eta",val:": Optional = 0.0"},{name:"generator",val:": Union = None"},{name:"output_type",val:": Optional = '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/v0.28.0/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/v0.28.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/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/v0.28.0/en/api/pipelines/ddim#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/v0.28.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),C=new Ee({props:{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.example",$$slots:{default:[et]},$$scope:{ctx:J}}}),N=new be({props:{title:"ImagePipelineOutput",local:"diffusers.ImagePipelineOutput",headingTag:"h2"}}),q=new ae({props:{name:"class diffusers.ImagePipelineOutput",anchor:"diffusers.ImagePipelineOutput",parameters:[{name:"images",val:": Union"}],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/v0.28.0/src/diffusers/pipelines/pipeline_utils.py#L100"}}),O=new Ae({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/latent_diffusion.md"}}),{c(){a=p("meta"),y=o(),c=p("p"),l=o(),g(m.$$.fragment),s=o(),f=p("p"),f.innerHTML=Be,ie=o(),S=p("p"),S.textContent=Le,oe=o(),Z=p("p"),Z.innerHTML=Ce,re=o(),V=p("p"),V.innerHTML=Se,le=o(),g(B.$$.fragment),pe=o(),g(G.$$.fragment),de=o(),w=p("div"),g(k.$$.fragment),Te=o(),X=p("p"),X.textContent=Ze,ve=o(),H=p("p"),H.innerHTML=Ve,ye=o(),D=p("div"),g(W.$$.fragment),we=o(),A=p("p"),A.textContent=Ge,xe=o(),g(L.$$.fragment),ce=o(),g(z.$$.fragment),ue=o(),x=p("div"),g(R.$$.fragment),$e=o(),F=p("p"),F.textContent=ke,Ie=o(),K=p("p"),K.innerHTML=We,De=o(),j=p("div"),g(E.$$.fragment),je=o(),ee=p("p"),ee.textContent=ze,Pe=o(),g(C.$$.fragment),me=o(),g(N.$$.fragment),fe=o(),P=p("div"),g(q.$$.fragment),Ue=o(),te=p("p"),te.textContent=Re,ge=o(),g(O.$$.fragment),he=o(),se=p("p"),this.h()},l(e){const t=Xe("svelte-u9bgzb",document.head);a=d(t,"META",{name:!0,content:!0}),t.forEach(n),y=r(e),c=d(e,"P",{}),Y(c).forEach(n),l=r(e),h(m.$$.fragment,e),s=r(e),f=d(e,"P",{"data-svelte-h":!0}),v(f)!=="svelte-1dm5g0h"&&(f.innerHTML=Be),ie=r(e),S=d(e,"P",{"data-svelte-h":!0}),v(S)!=="svelte-1cwsb16"&&(S.textContent=Le),oe=r(e),Z=d(e,"P",{"data-svelte-h":!0}),v(Z)!=="svelte-mfilaa"&&(Z.innerHTML=Ce),re=r(e),V=d(e,"P",{"data-svelte-h":!0}),v(V)!=="svelte-13wc5yz"&&(V.innerHTML=Se),le=r(e),h(B.$$.fragment,e),pe=r(e),h(G.$$.fragment,e),de=r(e),w=d(e,"DIV",{class:!0});var $=Y(w);h(k.$$.fragment,$),Te=r($),X=d($,"P",{"data-svelte-h":!0}),v(X)!=="svelte-v0jro5"&&(X.textContent=Ze),ve=r($),H=d($,"P",{"data-svelte-h":!0}),v(H)!=="svelte-1r65y4f"&&(H.innerHTML=Ve),ye=r($),D=d($,"DIV",{class:!0});var U=Y(D);h(W.$$.fragment,U),we=r(U),A=d(U,"P",{"data-svelte-h":!0}),v(A)!=="svelte-50j04k"&&(A.textContent=Ge),xe=r(U),h(L.$$.fragment,U),U.forEach(n),$.forEach(n),ce=r(e),h(z.$$.fragment,e),ue=r(e),x=d(e,"DIV",{class:!0});var I=Y(x);h(R.$$.fragment,I),$e=r(I),F=d(I,"P",{"data-svelte-h":!0}),v(F)!=="svelte-gocjs6"&&(F.textContent=ke),Ie=r(I),K=d(I,"P",{"data-svelte-h":!0}),v(K)!=="svelte-1r65y4f"&&(K.innerHTML=We),De=r(I),j=d(I,"DIV",{class:!0});var ne=Y(j);h(E.$$.fragment,ne),je=r(ne),ee=d(ne,"P",{"data-svelte-h":!0}),v(ee)!=="svelte-50j04k"&&(ee.textContent=ze),Pe=r(ne),h(C.$$.fragment,ne),ne.forEach(n),I.forEach(n),me=r(e),h(N.$$.fragment,e),fe=r(e),P=d(e,"DIV",{class:!0});var Me=Y(P);h(q.$$.fragment,Me),Ue=r(Me),te=d(Me,"P",{"data-svelte-h":!0}),v(te)!=="svelte-19wetgi"&&(te.textContent=Re),Me.forEach(n),ge=r(e),h(O.$$.fragment,e),he=r(e),se=d(e,"P",{}),Y(se).forEach(n),this.h()},h(){Q(a,"name","hf:doc:metadata"),Q(a,"content",nt),Q(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(P,"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,a),i(e,y,t),i(e,c,t),i(e,l,t),_(m,e,t),i(e,s,t),i(e,f,t),i(e,ie,t),i(e,S,t),i(e,oe,t),i(e,Z,t),i(e,re,t),i(e,V,t),i(e,le,t),_(B,e,t),i(e,pe,t),_(G,e,t),i(e,de,t),i(e,w,t),_(k,w,null),u(w,Te),u(w,X),u(w,ve),u(w,H),u(w,ye),u(w,D),_(W,D,null),u(D,we),u(D,A),u(D,xe),_(L,D,null),i(e,ce,t),_(z,e,t),i(e,ue,t),i(e,x,t),_(R,x,null),u(x,$e),u(x,F),u(x,Ie),u(x,K),u(x,De),u(x,j),_(E,j,null),u(j,je),u(j,ee),u(j,Pe),_(C,j,null),i(e,me,t),_(N,e,t),i(e,fe,t),i(e,P,t),_(q,P,null),u(P,Ue),u(P,te),i(e,ge,t),_(O,e,t),i(e,he,t),i(e,se,t),_e=!0},p(e,[t]){const $={};t&2&&($.$$scope={dirty:t,ctx:e}),B.$set($);const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),L.$set(U);const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),C.$set(I)},i(e){_e||(M(m.$$.fragment,e),M(B.$$.fragment,e),M(G.$$.fragment,e),M(k.$$.fragment,e),M(W.$$.fragment,e),M(L.$$.fragment,e),M(z.$$.fragment,e),M(R.$$.fragment,e),M(E.$$.fragment,e),M(C.$$.fragment,e),M(N.$$.fragment,e),M(q.$$.fragment,e),M(O.$$.fragment,e),_e=!0)},o(e){b(m.$$.fragment,e),b(B.$$.fragment,e),b(G.$$.fragment,e),b(k.$$.fragment,e),b(W.$$.fragment,e),b(L.$$.fragment,e),b(z.$$.fragment,e),b(R.$$.fragment,e),b(E.$$.fragment,e),b(C.$$.fragment,e),b(N.$$.fragment,e),b(q.$$.fragment,e),b(O.$$.fragment,e),_e=!1},d(e){e&&(n(y),n(c),n(l),n(s),n(f),n(ie),n(S),n(oe),n(Z),n(re),n(V),n(le),n(pe),n(de),n(w),n(ce),n(ue),n(x),n(me),n(fe),n(P),n(ge),n(he),n(se)),n(a),T(m,e),T(B,e),T(G,e),T(k),T(W),T(L),T(z,e),T(R),T(E),T(C),T(N,e),T(q),T(O,e)}}}const nt='{"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 st(J){return Oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ct extends Ye{constructor(a){super(),Qe(this,a,st,tt,qe,{})}}export{ct as component};
