import{s as Ee,o as Ne,n as Pe}from"../chunks/scheduler.182ea377.js";import{S as qe,i as Oe,g as p,s as o,r as g,A as Ye,h as d,f as n,c as l,j as O,u as h,x as v,k as Y,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 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(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,r){i(c,a,r)},p:Pe,d(c){c&&n(a)}}}function He(J){let a,y="Example:",c,r,m;return r=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(){a=p("p"),a.textContent=y,c=o(),g(r.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),v(a)!=="svelte-11lpom8"&&(a.textContent=y),c=l(s),h(r.$$.fragment,s)},m(s,f){i(s,a,f),i(s,c,f),_(r,s,f),m=!0},p:Pe,i(s){m||(M(r.$$.fragment,s),m=!0)},o(s){b(r.$$.fragment,s),m=!1},d(s){s&&(n(a),n(c)),T(r,s)}}}function Ae(J){let a,y="Example:",c,r,m;return r=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(){a=p("p"),a.textContent=y,c=o(),g(r.$$.fragment)},l(s){a=d(s,"P",{"data-svelte-h":!0}),v(a)!=="svelte-11lpom8"&&(a.textContent=y),c=l(s),h(r.$$.fragment,s)},m(s,f){i(s,a,f),i(s,c,f),_(r,s,f),m=!0},p:Pe,i(s){m||(M(r.$$.fragment,s),m=!0)},o(s){b(r.$$.fragment,s),m=!1},d(s){s&&(n(a),n(c)),T(r,s)}}}function Fe(J){let a,y,c,r,m,s,f,Ue='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.',ae,S,Je="The abstract from the paper is:",ie,Z,Be="<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,V,Le='The original codebase can be found at <a href="https://github.com/CompVis/latent-diffusion" rel="nofollow">CompVis/latent-diffusion</a>.',le,B,re,G,pe,w,k,Me,Q,Ce="Pipeline for text-to-image generation using latent diffusion.",be,X,Se=`This model inherits from <a href="/docs/diffusers/v0.26.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.).`,Te,D,W,ve,H,Ze="The call function to the pipeline for generation.",ye,L,de,z,ce,x,R,we,A,Ve="A pipeline for image super-resolution using latent diffusion.",xe,F,Ge=`This model inherits from <a href="/docs/diffusers/v0.26.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.).`,$e,j,E,Ie,K,ke="The call function to the pipeline for generation.",De,C,ue,N,me,P,q,je,ee,We="Output class for image pipelines.",fe,ne,ge;return m=new _e({props:{title:"Latent Diffusion",local:"latent-diffusion",headingTag:"h1"}}),B=new Qe({props:{$$slots:{default:[Xe]},$$scope:{ctx:J}}}),G=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:": 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.26.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.38.1/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.26.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.26.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.26.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.26.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.26.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L32"}}),W=new se({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.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/v0.26.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.26.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.26.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.26.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),L=new ze({props:{anchor:"diffusers.LDMTextToImagePipeline.__call__.example",$$slots:{default:[He]},$$scope:{ctx:J}}}),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:": Union"}],parametersDescription:[{anchor:"diffusers.LDMSuperResolutionPipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.26.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.26.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.26.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.26.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.26.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, <a href="/docs/diffusers/v0.26.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler">EulerDiscreteScheduler</a>,
<a href="/docs/diffusers/v0.26.0/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler">EulerAncestralDiscreteScheduler</a>, <a href="/docs/diffusers/v0.26.0/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a>, or <a href="/docs/diffusers/v0.26.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py#L33"}}),E=new se({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.26.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.26.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.26.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.26.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.26.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),C=new ze({props:{anchor:"diffusers.LDMSuperResolutionPipeline.__call__.example",$$slots:{default:[Ae]},$$scope:{ctx:J}}}),N=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:": 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.26.0/src/diffusers/pipelines/pipeline_utils.py#L116"}}),{c(){a=p("meta"),y=o(),c=p("p"),r=o(),g(m.$$.fragment),s=o(),f=p("p"),f.innerHTML=Ue,ae=o(),S=p("p"),S.textContent=Je,ie=o(),Z=p("p"),Z.innerHTML=Be,oe=o(),V=p("p"),V.innerHTML=Le,le=o(),g(B.$$.fragment),re=o(),g(G.$$.fragment),pe=o(),w=p("div"),g(k.$$.fragment),Me=o(),Q=p("p"),Q.textContent=Ce,be=o(),X=p("p"),X.innerHTML=Se,Te=o(),D=p("div"),g(W.$$.fragment),ve=o(),H=p("p"),H.textContent=Ze,ye=o(),g(L.$$.fragment),de=o(),g(z.$$.fragment),ce=o(),x=p("div"),g(R.$$.fragment),we=o(),A=p("p"),A.textContent=Ve,xe=o(),F=p("p"),F.innerHTML=Ge,$e=o(),j=p("div"),g(E.$$.fragment),Ie=o(),K=p("p"),K.textContent=ke,De=o(),g(C.$$.fragment),ue=o(),g(N.$$.fragment),me=o(),P=p("div"),g(q.$$.fragment),je=o(),ee=p("p"),ee.textContent=We,fe=o(),ne=p("p"),this.h()},l(e){const t=Ye("svelte-u9bgzb",document.head);a=d(t,"META",{name:!0,content:!0}),t.forEach(n),y=l(e),c=d(e,"P",{}),O(c).forEach(n),r=l(e),h(m.$$.fragment,e),s=l(e),f=d(e,"P",{"data-svelte-h":!0}),v(f)!=="svelte-1dm5g0h"&&(f.innerHTML=Ue),ae=l(e),S=d(e,"P",{"data-svelte-h":!0}),v(S)!=="svelte-1cwsb16"&&(S.textContent=Je),ie=l(e),Z=d(e,"P",{"data-svelte-h":!0}),v(Z)!=="svelte-mfilaa"&&(Z.innerHTML=Be),oe=l(e),V=d(e,"P",{"data-svelte-h":!0}),v(V)!=="svelte-13wc5yz"&&(V.innerHTML=Le),le=l(e),h(B.$$.fragment,e),re=l(e),h(G.$$.fragment,e),pe=l(e),w=d(e,"DIV",{class:!0});var $=O(w);h(k.$$.fragment,$),Me=l($),Q=d($,"P",{"data-svelte-h":!0}),v(Q)!=="svelte-v0jro5"&&(Q.textContent=Ce),be=l($),X=d($,"P",{"data-svelte-h":!0}),v(X)!=="svelte-13tknt9"&&(X.innerHTML=Se),Te=l($),D=d($,"DIV",{class:!0});var U=O(D);h(W.$$.fragment,U),ve=l(U),H=d(U,"P",{"data-svelte-h":!0}),v(H)!=="svelte-50j04k"&&(H.textContent=Ze),ye=l(U),h(L.$$.fragment,U),U.forEach(n),$.forEach(n),de=l(e),h(z.$$.fragment,e),ce=l(e),x=d(e,"DIV",{class:!0});var I=O(x);h(R.$$.fragment,I),we=l(I),A=d(I,"P",{"data-svelte-h":!0}),v(A)!=="svelte-gocjs6"&&(A.textContent=Ve),xe=l(I),F=d(I,"P",{"data-svelte-h":!0}),v(F)!=="svelte-13tknt9"&&(F.innerHTML=Ge),$e=l(I),j=d(I,"DIV",{class:!0});var te=O(j);h(E.$$.fragment,te),Ie=l(te),K=d(te,"P",{"data-svelte-h":!0}),v(K)!=="svelte-50j04k"&&(K.textContent=ke),De=l(te),h(C.$$.fragment,te),te.forEach(n),I.forEach(n),ue=l(e),h(N.$$.fragment,e),me=l(e),P=d(e,"DIV",{class:!0});var he=O(P);h(q.$$.fragment,he),je=l(he),ee=d(he,"P",{"data-svelte-h":!0}),v(ee)!=="svelte-19wetgi"&&(ee.textContent=We),he.forEach(n),fe=l(e),ne=d(e,"P",{}),O(ne).forEach(n),this.h()},h(){Y(a,"name","hf:doc:metadata"),Y(a,"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(w,"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"),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(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,r,t),_(m,e,t),i(e,s,t),i(e,f,t),i(e,ae,t),i(e,S,t),i(e,ie,t),i(e,Z,t),i(e,oe,t),i(e,V,t),i(e,le,t),_(B,e,t),i(e,re,t),_(G,e,t),i(e,pe,t),i(e,w,t),_(k,w,null),u(w,Me),u(w,Q),u(w,be),u(w,X),u(w,Te),u(w,D),_(W,D,null),u(D,ve),u(D,H),u(D,ye),_(L,D,null),i(e,de,t),_(z,e,t),i(e,ce,t),i(e,x,t),_(R,x,null),u(x,we),u(x,A),u(x,xe),u(x,F),u(x,$e),u(x,j),_(E,j,null),u(j,Ie),u(j,K),u(j,De),_(C,j,null),i(e,ue,t),_(N,e,t),i(e,me,t),i(e,P,t),_(q,P,null),u(P,je),u(P,ee),i(e,fe,t),i(e,ne,t),ge=!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){ge||(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),ge=!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),ge=!1},d(e){e&&(n(y),n(c),n(r),n(s),n(f),n(ae),n(S),n(ie),n(Z),n(oe),n(V),n(le),n(re),n(pe),n(w),n(de),n(ce),n(x),n(ue),n(me),n(P),n(fe),n(ne)),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)}}}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(J){return Ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rt extends qe{constructor(a){super(),Oe(this,a,et,Fe,Ee,{})}}export{rt as component};
