import{S as wl,i as Pl,s as $l,e as o,k as d,w as b,t as r,M as Ul,c as a,d as n,m as p,a as s,x as v,h as l,b as g,G as e,g as _,y,q as I,o as w,B as P,v as Tl,L as Kt}from"../../../chunks/vendor-hf-doc-builder.js";import{T as ro}from"../../../chunks/Tip-hf-doc-builder.js";import{D as E}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as ae}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Nt}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ht}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ml(x){let c,$,f,m,U,i,h,j;return{c(){c=o("p"),$=r("For text-to-image we use "),f=o("code"),m=r("stabilityai/stable-diffusion-2-1-unclip-small"),U=r(" as it was trained on CLIP ViT-L/14 embedding, the same as the Karlo model prior. "),i=o("a"),h=r("stabilityai/stable-diffusion-2-1-unclip"),j=r(" was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),this.h()},l(Y){c=a(Y,"P",{});var Z=s(c);$=l(Z,"For text-to-image we use "),f=a(Z,"CODE",{});var X=s(f);m=l(X,"stabilityai/stable-diffusion-2-1-unclip-small"),X.forEach(n),U=l(Z," as it was trained on CLIP ViT-L/14 embedding, the same as the Karlo model prior. "),i=a(Z,"A",{href:!0,rel:!0});var Ft=s(i);h=l(Ft,"stabilityai/stable-diffusion-2-1-unclip"),Ft.forEach(n),j=l(Z," was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),Z.forEach(n),this.h()},h(){g(i,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip"),g(i,"rel","nofollow")},m(Y,Z){_(Y,c,Z),e(c,$),e(c,f),e(f,m),e(c,U),e(c,i),e(i,h),e(c,j)},d(Y){Y&&n(c)}}}function Jl(x){let c,$,f,m,U;return m=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlVW5DTElQUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlVW5DTElQUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmZ1c2luZyUyRnN0YWJsZS11bmNsaXAtMi0xLWwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTIwJTIwJTIzJTIwVE9ETyUyMHVwZGF0ZSUyMG1vZGVsJTIwcGF0aCUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMG9uJTIwbWFycyUyMiUwQWltYWdlcyUyMCUzRCUyMHBpcGUocHJvbXB0KS5pbWFnZXMlMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIyYXN0cm9uYXV0X2hvcnNlLnBuZyUyMik=",highlighted:`<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-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableUnCLIPPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;fusing/stable-unclip-2-1-l&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># TODO update model path</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;astronaut_horse.png&quot;</span>)`}}),{c(){c=o("p"),$=r("Examples:"),f=d(),b(m.$$.fragment)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"Examples:"),h.forEach(n),f=p(i),v(m.$$.fragment,i)},m(i,h){_(i,c,h),e(c,$),_(i,f,h),y(m,i,h),U=!0},p:Kt,i(i){U||(I(m.$$.fragment,i),U=!0)},o(i){w(m.$$.fragment,i),U=!1},d(i){i&&n(c),i&&n(f),P(m,i)}}}function Cl(x){let c,$,f,m,U;return{c(){c=o("p"),$=r("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),f=o("code"),m=r("scaled_dot_product_attention"),U=r(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),f=a(h,"CODE",{});var j=s(f);m=l(j,"scaled_dot_product_attention"),j.forEach(n),U=l(h,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),h.forEach(n)},m(i,h){_(i,c,h),e(c,$),e(c,f),e(f,m),e(c,U)},d(i){i&&n(c)}}}function xl(x){let c,$,f,m,U;return m=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<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-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){c=o("p"),$=r("Examples:"),f=d(),b(m.$$.fragment)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"Examples:"),h.forEach(n),f=p(i),v(m.$$.fragment,i)},m(i,h){_(i,c,h),e(c,$),_(i,f,h),y(m,i,h),U=!0},p:Kt,i(i){U||(I(m.$$.fragment,i),U=!0)},o(i){w(m.$$.fragment,i),U=!1},d(i){i&&n(c),i&&n(f),P(m,i)}}}function El(x){let c,$;return{c(){c=o("p"),$=r(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(f){c=a(f,"P",{});var m=s(c);$=l(m,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),m.forEach(n)},m(f,m){_(f,c,m),e(c,$)},d(f){f&&n(c)}}}function Ll(x){let c,$,f,m,U;return m=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<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-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){c=o("p"),$=r("Examples:"),f=d(),b(m.$$.fragment)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"Examples:"),h.forEach(n),f=p(i),v(m.$$.fragment,i)},m(i,h){_(i,c,h),e(c,$),_(i,f,h),y(m,i,h),U=!0},p:Kt,i(i){U||(I(m.$$.fragment,i),U=!0)},o(i){w(m.$$.fragment,i),U=!1},d(i){i&&n(c),i&&n(f),P(m,i)}}}function Sl(x){let c,$,f,m,U;return m=new ae({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlVW5DTElQSW1nMkltZ1BpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMFN0YWJsZVVuQ0xJUEltZzJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyZnVzaW5nJTJGc3RhYmxlLXVuY2xpcC0yLTEtbC1pbWcyaW1nJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUyMCUyMCUyMyUyMFRPRE8lMjB1cGRhdGUlMjBtb2RlbCUyMHBhdGglMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBpbml0X2ltYWdlLnJlc2l6ZSgoNzY4JTJDJTIwNTEyKSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwZmFudGFzeSUyMGxhbmRzY2FwZSUyQyUyMHRyZW5kaW5nJTIwb24lMjBhcnRzdGF0aW9uJTIyJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBpbml0X2ltYWdlKS5pbWFnZXMlMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIyZmFudGFzeV9sYW5kc2NhcGUucG5nJTIyKQ==",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">import</span> torch
<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> StableUnCLIPImg2ImgPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;fusing/stable-unclip-2-1-l-img2img&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># TODO update model path</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = 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>init_image = init_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt, init_image).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_landscape.png&quot;</span>)`}}),{c(){c=o("p"),$=r("Examples:"),f=d(),b(m.$$.fragment)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"Examples:"),h.forEach(n),f=p(i),v(m.$$.fragment,i)},m(i,h){_(i,c,h),e(c,$),_(i,f,h),y(m,i,h),U=!0},p:Kt,i(i){U||(I(m.$$.fragment,i),U=!0)},o(i){w(m.$$.fragment,i),U=!1},d(i){i&&n(c),i&&n(f),P(m,i)}}}function jl(x){let c,$,f,m,U;return{c(){c=o("p"),$=r("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),f=o("code"),m=r("scaled_dot_product_attention"),U=r(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),f=a(h,"CODE",{});var j=s(f);m=l(j,"scaled_dot_product_attention"),j.forEach(n),U=l(h,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),h.forEach(n)},m(i,h){_(i,c,h),e(c,$),e(c,f),e(f,m),e(c,U)},d(i){i&&n(c)}}}function Zl(x){let c,$,f,m,U;return m=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<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-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){c=o("p"),$=r("Examples:"),f=d(),b(m.$$.fragment)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"Examples:"),h.forEach(n),f=p(i),v(m.$$.fragment,i)},m(i,h){_(i,c,h),e(c,$),_(i,f,h),y(m,i,h),U=!0},p:Kt,i(i){U||(I(m.$$.fragment,i),U=!0)},o(i){w(m.$$.fragment,i),U=!1},d(i){i&&n(c),i&&n(f),P(m,i)}}}function Wl(x){let c,$;return{c(){c=o("p"),$=r(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(f){c=a(f,"P",{});var m=s(c);$=l(m,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),m.forEach(n)},m(f,m){_(f,c,m),e(c,$)},d(f){f&&n(c)}}}function kl(x){let c,$,f,m,U;return m=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<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-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){c=o("p"),$=r("Examples:"),f=d(),b(m.$$.fragment)},l(i){c=a(i,"P",{});var h=s(c);$=l(h,"Examples:"),h.forEach(n),f=p(i),v(m.$$.fragment,i)},m(i,h){_(i,c,h),e(c,$),_(i,f,h),y(m,i,h),U=!0},p:Kt,i(i){U||(I(m.$$.fragment,i),U=!0)},o(i){w(m.$$.fragment,i),U=!1},d(i){i&&n(c),i&&n(f),P(m,i)}}}function Gl(x){let c,$,f,m,U,i,h,j,Y,Z,X,Ft,Xt,ia,ra,lo,zt,la,po,Dt,en,da,co,Q,se,tn,Fe,pa,nn,ca,mo,W,ma,on,fa,ga,an,ua,ha,sn,_a,ba,fo,q,ie,rn,Xe,va,ln,ya,go,ze,uo,re,ho,O,le,dn,De,Ia,pn,wa,_o,Re,bo,de,Pa,cn,$a,Ua,vo,Ae,yo,H,pe,mn,Ye,Ta,fn,Ma,Io,T,Qe,Ja,gn,Ca,xa,qe,Ea,Rt,La,Sa,ja,R,Oe,Za,un,Wa,ka,ce,Ga,k,He,Va,hn,Ba,Na,me,Fa,fe,Xa,ge,Ke,za,et,Da,_n,Ra,Aa,Ya,ue,tt,Qa,bn,qa,Oa,he,nt,Ha,ot,Ka,vn,es,ts,ns,G,at,os,st,as,it,ss,is,rs,_e,ls,be,ds,ve,rt,ps,lt,cs,dt,ms,fs,gs,ye,pt,us,z,hs,yn,_s,bs,In,vs,ys,wn,Is,ws,Ps,Ie,ct,$s,Pn,Us,Ts,L,mt,Ms,K,Js,$n,Cs,xs,Un,Es,Ls,Ss,Tn,js,Zs,ft,Mn,Ws,ks,Jn,Gs,Vs,gt,Bs,Cn,Ns,Fs,Xs,xn,zs,wo,ee,we,En,ut,Ds,Ln,Rs,Po,M,ht,As,Sn,Ys,Qs,_t,qs,At,Os,Hs,Ks,A,bt,ei,jn,ti,ni,Pe,oi,V,vt,ai,Zn,si,ii,$e,ri,Ue,li,Te,yt,di,It,pi,Wn,ci,mi,fi,Me,wt,gi,kn,ui,hi,Je,Pt,_i,$t,bi,Gn,vi,yi,Ii,B,Ut,wi,Tt,Pi,Mt,$i,Ui,Ti,Ce,Mi,xe,Ji,Ee,Jt,Ci,Ct,xi,xt,Ei,Li,Si,Le,Et,ji,D,Zi,Vn,Wi,ki,Bn,Gi,Vi,Nn,Bi,Ni,Fi,Se,Lt,Xi,Fn,zi,Di,S,St,Ri,te,Ai,Xn,Yi,Qi,zn,qi,Oi,Hi,Dn,Ki,er,jt,Rn,tr,nr,An,or,ar,Zt,sr,Yn,ir,rr,lr,Qn,dr,$o,ne,je,qn,Wt,pr,On,cr,Uo,oe,kt,mr,Hn,fr,To;return i=new Nt({}),Fe=new Nt({}),Xe=new Nt({}),ze=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwVW5DTElQU2NoZWR1bGVyJTJDJTIwRERQTVNjaGVkdWxlciUyQyUyMFN0YWJsZVVuQ0xJUFBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5tb2RlbHMlMjBpbXBvcnQlMjBQcmlvclRyYW5zZm9ybWVyJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUb2tlbml6ZXIlMkMlMjBDTElQVGV4dE1vZGVsV2l0aFByb2plY3Rpb24lMEElMEFwcmlvcl9tb2RlbF9pZCUyMCUzRCUyMCUyMmtha2FvYnJhaW4lMkZrYXJsby12MS1hbHBoYSUyMiUwQWRhdGFfdHlwZSUyMCUzRCUyMHRvcmNoLmZsb2F0MTYlMEFwcmlvciUyMCUzRCUyMFByaW9yVHJhbnNmb3JtZXIuZnJvbV9wcmV0cmFpbmVkKHByaW9yX21vZGVsX2lkJTJDJTIwc3ViZm9sZGVyJTNEJTIycHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRGRhdGFfdHlwZSklMEElMEFwcmlvcl90ZXh0X21vZGVsX2lkJTIwJTNEJTIwJTIyb3BlbmFpJTJGY2xpcC12aXQtbGFyZ2UtcGF0Y2gxNCUyMiUwQXByaW9yX3Rva2VuaXplciUyMCUzRCUyMENMSVBUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKHByaW9yX3RleHRfbW9kZWxfaWQpJTBBcHJpb3JfdGV4dF9tb2RlbCUyMCUzRCUyMENMSVBUZXh0TW9kZWxXaXRoUHJvamVjdGlvbi5mcm9tX3ByZXRyYWluZWQocHJpb3JfdGV4dF9tb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEZGF0YV90eXBlKSUwQXByaW9yX3NjaGVkdWxlciUyMCUzRCUyMFVuQ0xJUFNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQocHJpb3JfbW9kZWxfaWQlMkMlMjBzdWJmb2xkZXIlM0QlMjJwcmlvcl9zY2hlZHVsZXIlMjIpJTBBcHJpb3Jfc2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwcmlvcl9zY2hlZHVsZXIuY29uZmlnKSUwQSUwQXN0YWJsZV91bmNsaXBfbW9kZWxfaWQlMjAlM0QlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMi0xLXVuY2xpcC1zbWFsbCUyMiUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVVbkNMSVBQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwc3RhYmxlX3VuY2xpcF9tb2RlbF9pZCUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEZGF0YV90eXBlJTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEElMjAlMjAlMjAlMjBwcmlvcl90b2tlbml6ZXIlM0Rwcmlvcl90b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBwcmlvcl90ZXh0X2VuY29kZXIlM0Rwcmlvcl90ZXh0X21vZGVsJTJDJTBBJTIwJTIwJTIwJTIwcHJpb3IlM0RwcmlvciUyQyUwQSUyMCUyMCUyMCUyMHByaW9yX3NjaGVkdWxlciUzRHByaW9yX3NjaGVkdWxlciUyQyUwQSklMEElMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXdhdmVfcHJvbXB0JTIwJTNEJTIwJTIyZHJhbWF0aWMlMjB3YXZlJTJDJTIwdGhlJTIwT2NlYW5zJTIwcm9hciUyQyUyMFN0cm9uZyUyMHdhdmUlMjBzcGlyYWwlMjBhY3Jvc3MlMjB0aGUlMjBvY2VhbnMlMjBhcyUyMHRoZSUyMHdhdmVzJTIwdW5mdXJsJTIwaW50byUyMHJvYXJpbmclMjBjcmVzdHMlM0IlMjBwZXJmZWN0JTIwd2F2ZSUyMGZvcm0lM0IlMjBwZXJmZWN0JTIwd2F2ZSUyMHNoYXBlJTNCJTIwZHJhbWF0aWMlMjB3YXZlJTIwc2hhcGUlM0IlMjB3YXZlJTIwc2hhcGUlMjB1bmJlbGlldmFibGUlM0IlMjB3YXZlJTNCJTIwd2F2ZSUyMHNoYXBlJTIwc3BlY3RhY3VsYXIlMjIlMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKHByb21wdCUzRHdhdmVfcHJvbXB0KS5pbWFnZXMlMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIyd2F2ZXMucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UnCLIPScheduler, DDPMScheduler, StableUnCLIPPipeline
<span class="hljs-keyword">from</span> diffusers.models <span class="hljs-keyword">import</span> PriorTransformer
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTokenizer, CLIPTextModelWithProjection

prior_model_id = <span class="hljs-string">&quot;kakaobrain/karlo-v1-alpha&quot;</span>
data_type = torch.float16
prior = PriorTransformer.from_pretrained(prior_model_id, subfolder=<span class="hljs-string">&quot;prior&quot;</span>, torch_dtype=data_type)

prior_text_model_id = <span class="hljs-string">&quot;openai/clip-vit-large-patch14&quot;</span>
prior_tokenizer = CLIPTokenizer.from_pretrained(prior_text_model_id)
prior_text_model = CLIPTextModelWithProjection.from_pretrained(prior_text_model_id, torch_dtype=data_type)
prior_scheduler = UnCLIPScheduler.from_pretrained(prior_model_id, subfolder=<span class="hljs-string">&quot;prior_scheduler&quot;</span>)
prior_scheduler = DDPMScheduler.from_config(prior_scheduler.config)

stable_unclip_model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip-small&quot;</span>

pipe = StableUnCLIPPipeline.from_pretrained(
    stable_unclip_model_id,
    torch_dtype=data_type,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    prior_tokenizer=prior_tokenizer,
    prior_text_encoder=prior_text_model,
    prior=prior,
    prior_scheduler=prior_scheduler,
)

pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
wave_prompt = <span class="hljs-string">&quot;dramatic wave, the Oceans roar, Strong wave spiral across the oceans as the waves unfurl into roaring crests; perfect wave form; perfect wave shape; dramatic wave shape; wave shape unbelievable; wave; wave shape spectacular&quot;</span>

images = pipe(prompt=wave_prompt).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;waves.png&quot;</span>)`}}),re=new ro({props:{warning:!0,$$slots:{default:[Ml]},$$scope:{ctx:x}}}),De=new Nt({}),Re=new ae({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZVVuQ0xJUEltZzJJbWdQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlVW5DTElQSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMi0xLXVuY2xpcCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhdGlvbiUzRCUyMmZwMTYlMjIlMEEpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGc3RhYmxlX3VuY2xpcCUyRnRhcnNpbGFfZG9fYW1hcmFsLnBuZyUyMiUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKHVybCklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKGluaXRfaW1hZ2UpLmltYWdlcyUwQWltYWdlcyU1QjAlNUQuc2F2ZSglMjJ2YXJpYXRpb25faW1hZ2UucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip&quot;</span>, torch_dtype=torch.float16, variation=<span class="hljs-string">&quot;fp16&quot;</span>
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png&quot;</span>
init_image = load_image(url)

images = pipe(init_image).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;variation_image.png&quot;</span>)`}}),Ae=new ae({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjB0cmVuZGluZyUyMG9uJTIwYXJ0c3RhdGlvbiUyMiUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGUoaW5pdF9pbWFnZSUyQyUyMHByb21wdCUzRHByb21wdCkuaW1hZ2VzJTBBaW1hZ2VzJTVCMCU1RC5zYXZlKCUyMnZhcmlhdGlvbl9pbWFnZV90d28ucG5nJTIyKQ==",highlighted:`prompt = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

images = pipe(init_image, prompt=prompt).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;variation_image_two.png&quot;</span>)`}}),Ye=new Nt({}),Qe=new E({props:{name:"class diffusers.StableUnCLIPPipeline",anchor:"diffusers.StableUnCLIPPipeline",parameters:[{name:"prior_tokenizer",val:": CLIPTokenizer"},{name:"prior_text_encoder",val:": CLIPTextModelWithProjection"},{name:"prior",val:": PriorTransformer"},{name:"prior_scheduler",val:": KarrasDiffusionSchedulers"},{name:"image_normalizer",val:": StableUnCLIPImageNormalizer"},{name:"image_noising_scheduler",val:": KarrasDiffusionSchedulers"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"vae",val:": AutoencoderKL"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.prior_tokenizer",description:`<strong>prior_tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code>.`,name:"prior_tokenizer"},{anchor:"diffusers.StableUnCLIPPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen <code>CLIPTextModelWithProjection</code> text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.StableUnCLIPPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/main/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.StableUnCLIPPipeline.prior_scheduler",description:`<strong>prior_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Scheduler used in the prior denoising process.`,name:"prior_scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.image_normalizer",description:`<strong>image_normalizer</strong> (<code>StableUnCLIPImageNormalizer</code>) &#x2014;
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
embeddings after the noise has been applied.`,name:"image_normalizer"},{anchor:"diffusers.StableUnCLIPPipeline.image_noising_scheduler",description:`<strong>image_noising_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
by the <code>noise_level</code>.`,name:"image_noising_scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code>.`,name:"tokenizer"},{anchor:"diffusers.StableUnCLIPPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen <code>CLIPTextModel</code> text-encoder.`,name:"text_encoder"},{anchor:"diffusers.StableUnCLIPPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableUnCLIPPipeline.scheduler",description:`<strong>scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L60"}}),Oe=new E({props:{name:"__call__",anchor:"diffusers.StableUnCLIPPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 20"},{name:"guidance_scale",val:": float = 10.0"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"noise_level",val:": int = 0"},{name:"prior_num_inference_steps",val:": int = 25"},{name:"prior_guidance_scale",val:": float = 4.0"},{name:"prior_latents",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 20) &#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.StableUnCLIPPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 10.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.StableUnCLIPPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to <code>0</code>) &#x2014;
The amount of noise to add to the image embeddings. A higher <code>noise_level</code> increases the variance in
the final un-noised images. See <a href="/docs/diffusers/main/en/api/pipelines/stable_unclip#diffusers.StableUnCLIPPipeline.noise_image_embeddings">StableUnCLIPPipeline.noise_image_embeddings()</a> for more details.`,name:"noise_level"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_num_inference_steps",description:`<strong>prior_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
The number of denoising steps in the prior denoising process. More denoising steps usually lead to a
higher quality image at the expense of slower inference.`,name:"prior_num_inference_steps"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_guidance_scale",description:`<strong>prior_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.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:"prior_guidance_scale"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_latents",description:`<strong>prior_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
embedding generation in the prior denoising process. 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:"prior_latents"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L650",returnDescription:`
<p><code>~ pipeline_utils.ImagePipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple</code>. When returning
a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),ce=new Ht({props:{anchor:"diffusers.StableUnCLIPPipeline.__call__.example",$$slots:{default:[Jl]},$$scope:{ctx:x}}}),He=new E({props:{name:"enable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),me=new ro({props:{warning:!0,$$slots:{default:[Cl]},$$scope:{ctx:x}}}),fe=new Ht({props:{anchor:"diffusers.StableUnCLIPPipeline.enable_attention_slicing.example",$$slots:{default:[xl]},$$scope:{ctx:x}}}),Ke=new E({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),tt=new E({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L152"}}),nt=new E({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L160"}}),at=new E({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),_e=new ro({props:{warning:!0,$$slots:{default:[El]},$$scope:{ctx:x}}}),be=new Ht({props:{anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Ll]},$$scope:{ctx:x}}}),rt=new E({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),pt=new E({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableUnCLIPPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L167"}}),ct=new E({props:{name:"encode_prompt",anchor:"diffusers.StableUnCLIPPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableUnCLIPPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableUnCLIPPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableUnCLIPPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableUnCLIPPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableUnCLIPPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableUnCLIPPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L326"}}),mt=new E({props:{name:"noise_image_embeddings",anchor:"diffusers.StableUnCLIPPipeline.noise_image_embeddings",parameters:[{name:"image_embeds",val:": Tensor"},{name:"noise_level",val:": int"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L604"}}),ut=new Nt({}),ht=new E({props:{name:"class diffusers.StableUnCLIPImg2ImgPipeline",anchor:"diffusers.StableUnCLIPImg2ImgPipeline",parameters:[{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"image_normalizer",val:": StableUnCLIPImageNormalizer"},{name:"image_noising_scheduler",val:": KarrasDiffusionSchedulers"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder",val:": CLIPTextModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"vae",val:": AutoencoderKL"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Feature extractor for image pre-processing before being encoded.`,name:"feature_extractor"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
CLIP vision model for encoding images.`,name:"image_encoder"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_normalizer",description:`<strong>image_normalizer</strong> (<code>StableUnCLIPImageNormalizer</code>) &#x2014;
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
embeddings after the noise has been applied.`,name:"image_normalizer"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_noising_scheduler",description:`<strong>image_noising_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
by the <code>noise_level</code>.`,name:"image_noising_scheduler"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>~transformers.CLIPTokenizer</code>) &#x2014;
A [<code>~transformers.CLIPTokenizer</code>)].`,name:"tokenizer"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#x2014;
Frozen <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a> text-encoder.`,name:"text_encoder"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L66"}}),bt=new E({props:{name:"__call__",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__",parameters:[{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 20"},{name:"guidance_scale",val:": float = 10"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"noise_level",val:": int = 0"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, either <code>prompt_embeds</code> will be
used or prompt is initialized to <code>&quot;&quot;</code>.`,name:"prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code> or tensor representing an image batch. The image is encoded to its CLIP embedding which the
<code>unet</code> is conditioned on. The image is <em>not</em> encoded by the <code>vae</code> and then used as the latents in the
denoising process like it is in the standard Stable Diffusion text-guided image variation process.`,name:"image"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 20) &#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.StableUnCLIPImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 10.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.StableUnCLIPImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to <code>0</code>) &#x2014;
The amount of noise to add to the image embeddings. A higher <code>noise_level</code> increases the variance in
the final un-noised images. See <a href="/docs/diffusers/main/en/api/pipelines/stable_unclip#diffusers.StableUnCLIPPipeline.noise_image_embeddings">StableUnCLIPPipeline.noise_image_embeddings()</a> for more details.`,name:"noise_level"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated CLIP embeddings to condition the <code>unet</code> on. These latents are not used in the denoising
process. If you want to provide pre-generated latents, pass them to <code>__call__</code> as <code>latents</code>.`,name:"image_embeds"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L611",returnDescription:`
<p><code>~ pipeline_utils.ImagePipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple</code>. When returning
a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Pe=new Ht({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.example",$$slots:{default:[Sl]},$$scope:{ctx:x}}}),vt=new E({props:{name:"enable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),$e=new ro({props:{warning:!0,$$slots:{default:[jl]},$$scope:{ctx:x}}}),Ue=new Ht({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[Zl]},$$scope:{ctx:x}}}),yt=new E({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),wt=new E({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L148"}}),Pt=new E({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L156"}}),Ut=new E({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),Ce=new ro({props:{warning:!0,$$slots:{default:[Wl]},$$scope:{ctx:x}}}),xe=new Ht({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[kl]},$$scope:{ctx:x}}}),Jt=new E({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),Et=new E({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L163"}}),Lt=new E({props:{name:"encode_prompt",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L275"}}),St=new E({props:{name:"noise_image_embeddings",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.noise_image_embeddings",parameters:[{name:"image_embeds",val:": Tensor"},{name:"noise_level",val:": int"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L565"}}),Wt=new Nt({}),kt=new E({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#L112"}}),{c(){c=o("meta"),$=d(),f=o("h1"),m=o("a"),U=o("span"),b(i.$$.fragment),h=d(),j=o("span"),Y=r("Stable unCLIP"),Z=d(),X=o("p"),Ft=r("Stable unCLIP checkpoints are finetuned from "),Xt=o("a"),ia=r("Stable Diffusion 2.1"),ra=r(` checkpoints to condition on CLIP image embeddings.
Stable unCLIP still conditions on text embeddings. Given the two separate conditionings, stable unCLIP can be used
for text guided image variation. When combined with an unCLIP prior, it can also be used for full text to image generation.`),lo=d(),zt=o("p"),la=r("The abstract from the paper is:"),po=d(),Dt=o("p"),en=o("em"),da=r("Contrastive models like CLIP have been shown to learn robust representations of images that capture both semantics and style. To leverage these representations for image generation, we propose a two-stage model: a prior that generates a CLIP image embedding given a text caption, and a decoder that generates an image conditioned on the image embedding. We show that explicitly generating image representations improves image diversity with minimal loss in photorealism and caption similarity. Our decoders conditioned on image representations can also produce variations of an image that preserve both its semantics and style, while varying the non-essential details absent from the image representation. Moreover, the joint embedding space of CLIP enables language-guided image manipulations in a zero-shot fashion. We use diffusion models for the decoder and experiment with both autoregressive and diffusion models for the prior, finding that the latter are computationally more efficient and produce higher-quality samples."),co=d(),Q=o("h2"),se=o("a"),tn=o("span"),b(Fe.$$.fragment),pa=d(),nn=o("span"),ca=r("Tips"),mo=d(),W=o("p"),ma=r("Stable unCLIP takes  "),on=o("code"),fa=r("noise_level"),ga=r(` as input during inference which determines how much noise is added
to the image embeddings. A higher `),an=o("code"),ua=r("noise_level"),ha=r(` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings (`),sn=o("code"),_a=r("noise_level = 0"),ba=r(")."),fo=d(),q=o("h3"),ie=o("a"),rn=o("span"),b(Xe.$$.fragment),va=d(),ln=o("span"),ya=r("Text-to-Image Generation"),go=r(`

Stable unCLIP can be leveraged for text-to-image generation by pipelining it with the prior model of KakaoBrain's open source DALL-E 2 replication [Karlo](https://huggingface.co/kakaobrain/karlo-v1-alpha)

	`),b(ze.$$.fragment),uo=d(),b(re.$$.fragment),ho=d(),O=o("h3"),le=o("a"),dn=o("span"),b(De.$$.fragment),Ia=d(),pn=o("span"),wa=r("Text guided Image-to-Image Variation"),_o=d(),b(Re.$$.fragment),bo=d(),de=o("p"),Pa=r("Optionally, you can also pass a prompt to "),cn=o("code"),$a=r("pipe"),Ua=r(" such as:"),vo=d(),b(Ae.$$.fragment),yo=d(),H=o("h2"),pe=o("a"),mn=o("span"),b(Ye.$$.fragment),Ta=d(),fn=o("span"),Ma=r("StableUnCLIPPipeline"),Io=d(),T=o("div"),b(Qe.$$.fragment),Ja=d(),gn=o("p"),Ca=r("Pipeline for text-to-image generation using stable unCLIP."),xa=d(),qe=o("p"),Ea=r("This model inherits from "),Rt=o("a"),La=r("DiffusionPipeline"),Sa=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ja=d(),R=o("div"),b(Oe.$$.fragment),Za=d(),un=o("p"),Wa=r("The call function to the pipeline for generation."),ka=d(),b(ce.$$.fragment),Ga=d(),k=o("div"),b(He.$$.fragment),Va=d(),hn=o("p"),Ba=r(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Na=d(),b(me.$$.fragment),Fa=d(),b(fe.$$.fragment),Xa=d(),ge=o("div"),b(Ke.$$.fragment),za=d(),et=o("p"),Da=r("Disable sliced attention computation. If "),_n=o("code"),Ra=r("enable_attention_slicing"),Aa=r(` was previously called, attention is
computed in one step.`),Ya=d(),ue=o("div"),b(tt.$$.fragment),Qa=d(),bn=o("p"),qa=r(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Oa=d(),he=o("div"),b(nt.$$.fragment),Ha=d(),ot=o("p"),Ka=r("Disable sliced VAE decoding. If "),vn=o("code"),es=r("enable_vae_slicing"),ts=r(` was previously enabled, this method will go back to
computing decoding in one step.`),ns=d(),G=o("div"),b(at.$$.fragment),os=d(),st=o("p"),as=r("Enable memory efficient attention from "),it=o("a"),ss=r("xFormers"),is=r(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),rs=d(),b(_e.$$.fragment),ls=d(),b(be.$$.fragment),ds=d(),ve=o("div"),b(rt.$$.fragment),ps=d(),lt=o("p"),cs=r("Disable memory efficient attention from "),dt=o("a"),ms=r("xFormers"),fs=r("."),gs=d(),ye=o("div"),b(pt.$$.fragment),us=d(),z=o("p"),hs=r(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),yn=o("code"),_s=r("forward"),bs=r(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),In=o("code"),vs=r("enable_sequential_cpu_offload"),ys=r(`, but performance is much better due to the
iterative execution of the `),wn=o("code"),Is=r("unet"),ws=r("."),Ps=d(),Ie=o("div"),b(ct.$$.fragment),$s=d(),Pn=o("p"),Us=r("Encodes the prompt into text encoder hidden states."),Ts=d(),L=o("div"),b(mt.$$.fragment),Ms=d(),K=o("p"),Js=r("Add noise to the image embeddings. The amount of noise is controlled by a "),$n=o("code"),Cs=r("noise_level"),xs=r(` input. A higher
`),Un=o("code"),Es=r("noise_level"),Ls=r(" increases the variance in the final un-noised images."),Ss=d(),Tn=o("p"),js=r("The noise is applied in two ways:"),Zs=d(),ft=o("ol"),Mn=o("li"),Ws=r("A noise schedule is applied directly to the embeddings."),ks=d(),Jn=o("li"),Gs=r("A vector of sinusoidal time embeddings are appended to the output."),Vs=d(),gt=o("p"),Bs=r("In both cases, the amount of noise is controlled by the same "),Cn=o("code"),Ns=r("noise_level"),Fs=r("."),Xs=d(),xn=o("p"),zs=r("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),wo=d(),ee=o("h2"),we=o("a"),En=o("span"),b(ut.$$.fragment),Ds=d(),Ln=o("span"),Rs=r("StableUnCLIPImg2ImgPipeline"),Po=d(),M=o("div"),b(ht.$$.fragment),As=d(),Sn=o("p"),Ys=r("Pipeline for text-guided image-to-image generation using stable unCLIP."),Qs=d(),_t=o("p"),qs=r("This model inherits from "),At=o("a"),Os=r("DiffusionPipeline"),Hs=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ks=d(),A=o("div"),b(bt.$$.fragment),ei=d(),jn=o("p"),ti=r("The call function to the pipeline for generation."),ni=d(),b(Pe.$$.fragment),oi=d(),V=o("div"),b(vt.$$.fragment),ai=d(),Zn=o("p"),si=r(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),ii=d(),b($e.$$.fragment),ri=d(),b(Ue.$$.fragment),li=d(),Te=o("div"),b(yt.$$.fragment),di=d(),It=o("p"),pi=r("Disable sliced attention computation. If "),Wn=o("code"),ci=r("enable_attention_slicing"),mi=r(` was previously called, attention is
computed in one step.`),fi=d(),Me=o("div"),b(wt.$$.fragment),gi=d(),kn=o("p"),ui=r(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),hi=d(),Je=o("div"),b(Pt.$$.fragment),_i=d(),$t=o("p"),bi=r("Disable sliced VAE decoding. If "),Gn=o("code"),vi=r("enable_vae_slicing"),yi=r(` was previously enabled, this method will go back to
computing decoding in one step.`),Ii=d(),B=o("div"),b(Ut.$$.fragment),wi=d(),Tt=o("p"),Pi=r("Enable memory efficient attention from "),Mt=o("a"),$i=r("xFormers"),Ui=r(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Ti=d(),b(Ce.$$.fragment),Mi=d(),b(xe.$$.fragment),Ji=d(),Ee=o("div"),b(Jt.$$.fragment),Ci=d(),Ct=o("p"),xi=r("Disable memory efficient attention from "),xt=o("a"),Ei=r("xFormers"),Li=r("."),Si=d(),Le=o("div"),b(Et.$$.fragment),ji=d(),D=o("p"),Zi=r(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Vn=o("code"),Wi=r("forward"),ki=r(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Bn=o("code"),Gi=r("enable_sequential_cpu_offload"),Vi=r(`, but performance is much better due to the
iterative execution of the `),Nn=o("code"),Bi=r("unet"),Ni=r("."),Fi=d(),Se=o("div"),b(Lt.$$.fragment),Xi=d(),Fn=o("p"),zi=r("Encodes the prompt into text encoder hidden states."),Di=d(),S=o("div"),b(St.$$.fragment),Ri=d(),te=o("p"),Ai=r("Add noise to the image embeddings. The amount of noise is controlled by a "),Xn=o("code"),Yi=r("noise_level"),Qi=r(` input. A higher
`),zn=o("code"),qi=r("noise_level"),Oi=r(" increases the variance in the final un-noised images."),Hi=d(),Dn=o("p"),Ki=r("The noise is applied in two ways:"),er=d(),jt=o("ol"),Rn=o("li"),tr=r("A noise schedule is applied directly to the embeddings."),nr=d(),An=o("li"),or=r("A vector of sinusoidal time embeddings are appended to the output."),ar=d(),Zt=o("p"),sr=r("In both cases, the amount of noise is controlled by the same "),Yn=o("code"),ir=r("noise_level"),rr=r("."),lr=d(),Qn=o("p"),dr=r("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),$o=d(),ne=o("h2"),je=o("a"),qn=o("span"),b(Wt.$$.fragment),pr=d(),On=o("span"),cr=r("ImagePipelineOutput"),Uo=d(),oe=o("div"),b(kt.$$.fragment),mr=d(),Hn=o("p"),fr=r("Output class for image pipelines."),this.h()},l(t){const u=Ul('[data-svelte="svelte-1phssyn"]',document.head);c=a(u,"META",{name:!0,content:!0}),u.forEach(n),$=p(t),f=a(t,"H1",{class:!0});var Gt=s(f);m=a(Gt,"A",{id:!0,class:!0,href:!0});var Kn=s(m);U=a(Kn,"SPAN",{});var eo=s(U);v(i.$$.fragment,eo),eo.forEach(n),Kn.forEach(n),h=p(Gt),j=a(Gt,"SPAN",{});var to=s(j);Y=l(to,"Stable unCLIP"),to.forEach(n),Gt.forEach(n),Z=p(t),X=a(t,"P",{});var Vt=s(X);Ft=l(Vt,"Stable unCLIP checkpoints are finetuned from "),Xt=a(Vt,"A",{href:!0});var no=s(Xt);ia=l(no,"Stable Diffusion 2.1"),no.forEach(n),ra=l(Vt,` checkpoints to condition on CLIP image embeddings.
Stable unCLIP still conditions on text embeddings. Given the two separate conditionings, stable unCLIP can be used
for text guided image variation. When combined with an unCLIP prior, it can also be used for full text to image generation.`),Vt.forEach(n),lo=p(t),zt=a(t,"P",{});var oo=s(zt);la=l(oo,"The abstract from the paper is:"),oo.forEach(n),po=p(t),Dt=a(t,"P",{});var ao=s(Dt);en=a(ao,"EM",{});var so=s(en);da=l(so,"Contrastive models like CLIP have been shown to learn robust representations of images that capture both semantics and style. To leverage these representations for image generation, we propose a two-stage model: a prior that generates a CLIP image embedding given a text caption, and a decoder that generates an image conditioned on the image embedding. We show that explicitly generating image representations improves image diversity with minimal loss in photorealism and caption similarity. Our decoders conditioned on image representations can also produce variations of an image that preserve both its semantics and style, while varying the non-essential details absent from the image representation. Moreover, the joint embedding space of CLIP enables language-guided image manipulations in a zero-shot fashion. We use diffusion models for the decoder and experiment with both autoregressive and diffusion models for the prior, finding that the latter are computationally more efficient and produce higher-quality samples."),so.forEach(n),ao.forEach(n),co=p(t),Q=a(t,"H2",{class:!0});var Bt=s(Q);se=a(Bt,"A",{id:!0,class:!0,href:!0});var io=s(se);tn=a(io,"SPAN",{});var gr=s(tn);v(Fe.$$.fragment,gr),gr.forEach(n),io.forEach(n),pa=p(Bt),nn=a(Bt,"SPAN",{});var ur=s(nn);ca=l(ur,"Tips"),ur.forEach(n),Bt.forEach(n),mo=p(t),W=a(t,"P",{});var Ze=s(W);ma=l(Ze,"Stable unCLIP takes  "),on=a(Ze,"CODE",{});var hr=s(on);fa=l(hr,"noise_level"),hr.forEach(n),ga=l(Ze,` as input during inference which determines how much noise is added
to the image embeddings. A higher `),an=a(Ze,"CODE",{});var _r=s(an);ua=l(_r,"noise_level"),_r.forEach(n),ha=l(Ze,` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings (`),sn=a(Ze,"CODE",{});var br=s(sn);_a=l(br,"noise_level = 0"),br.forEach(n),ba=l(Ze,")."),Ze.forEach(n),fo=p(t),q=a(t,"H3",{class:!0});var Mo=s(q);ie=a(Mo,"A",{id:!0,class:!0,href:!0});var vr=s(ie);rn=a(vr,"SPAN",{});var yr=s(rn);v(Xe.$$.fragment,yr),yr.forEach(n),vr.forEach(n),va=p(Mo),ln=a(Mo,"SPAN",{});var Ir=s(ln);ya=l(Ir,"Text-to-Image Generation"),Ir.forEach(n),Mo.forEach(n),go=l(t,`

Stable unCLIP can be leveraged for text-to-image generation by pipelining it with the prior model of KakaoBrain's open source DALL-E 2 replication [Karlo](https://huggingface.co/kakaobrain/karlo-v1-alpha)

	`),v(ze.$$.fragment,t),uo=p(t),v(re.$$.fragment,t),ho=p(t),O=a(t,"H3",{class:!0});var Jo=s(O);le=a(Jo,"A",{id:!0,class:!0,href:!0});var wr=s(le);dn=a(wr,"SPAN",{});var Pr=s(dn);v(De.$$.fragment,Pr),Pr.forEach(n),wr.forEach(n),Ia=p(Jo),pn=a(Jo,"SPAN",{});var $r=s(pn);wa=l($r,"Text guided Image-to-Image Variation"),$r.forEach(n),Jo.forEach(n),_o=p(t),v(Re.$$.fragment,t),bo=p(t),de=a(t,"P",{});var Co=s(de);Pa=l(Co,"Optionally, you can also pass a prompt to "),cn=a(Co,"CODE",{});var Ur=s(cn);$a=l(Ur,"pipe"),Ur.forEach(n),Ua=l(Co," such as:"),Co.forEach(n),vo=p(t),v(Ae.$$.fragment,t),yo=p(t),H=a(t,"H2",{class:!0});var xo=s(H);pe=a(xo,"A",{id:!0,class:!0,href:!0});var Tr=s(pe);mn=a(Tr,"SPAN",{});var Mr=s(mn);v(Ye.$$.fragment,Mr),Mr.forEach(n),Tr.forEach(n),Ta=p(xo),fn=a(xo,"SPAN",{});var Jr=s(fn);Ma=l(Jr,"StableUnCLIPPipeline"),Jr.forEach(n),xo.forEach(n),Io=p(t),T=a(t,"DIV",{class:!0});var J=s(T);v(Qe.$$.fragment,J),Ja=p(J),gn=a(J,"P",{});var Cr=s(gn);Ca=l(Cr,"Pipeline for text-to-image generation using stable unCLIP."),Cr.forEach(n),xa=p(J),qe=a(J,"P",{});var Eo=s(qe);Ea=l(Eo,"This model inherits from "),Rt=a(Eo,"A",{href:!0});var xr=s(Rt);La=l(xr,"DiffusionPipeline"),xr.forEach(n),Sa=l(Eo,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Eo.forEach(n),ja=p(J),R=a(J,"DIV",{class:!0});var Yt=s(R);v(Oe.$$.fragment,Yt),Za=p(Yt),un=a(Yt,"P",{});var Er=s(un);Wa=l(Er,"The call function to the pipeline for generation."),Er.forEach(n),ka=p(Yt),v(ce.$$.fragment,Yt),Yt.forEach(n),Ga=p(J),k=a(J,"DIV",{class:!0});var We=s(k);v(He.$$.fragment,We),Va=p(We),hn=a(We,"P",{});var Lr=s(hn);Ba=l(Lr,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Lr.forEach(n),Na=p(We),v(me.$$.fragment,We),Fa=p(We),v(fe.$$.fragment,We),We.forEach(n),Xa=p(J),ge=a(J,"DIV",{class:!0});var Lo=s(ge);v(Ke.$$.fragment,Lo),za=p(Lo),et=a(Lo,"P",{});var So=s(et);Da=l(So,"Disable sliced attention computation. If "),_n=a(So,"CODE",{});var Sr=s(_n);Ra=l(Sr,"enable_attention_slicing"),Sr.forEach(n),Aa=l(So,` was previously called, attention is
computed in one step.`),So.forEach(n),Lo.forEach(n),Ya=p(J),ue=a(J,"DIV",{class:!0});var jo=s(ue);v(tt.$$.fragment,jo),Qa=p(jo),bn=a(jo,"P",{});var jr=s(bn);qa=l(jr,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),jr.forEach(n),jo.forEach(n),Oa=p(J),he=a(J,"DIV",{class:!0});var Zo=s(he);v(nt.$$.fragment,Zo),Ha=p(Zo),ot=a(Zo,"P",{});var Wo=s(ot);Ka=l(Wo,"Disable sliced VAE decoding. If "),vn=a(Wo,"CODE",{});var Zr=s(vn);es=l(Zr,"enable_vae_slicing"),Zr.forEach(n),ts=l(Wo,` was previously enabled, this method will go back to
computing decoding in one step.`),Wo.forEach(n),Zo.forEach(n),ns=p(J),G=a(J,"DIV",{class:!0});var ke=s(G);v(at.$$.fragment,ke),os=p(ke),st=a(ke,"P",{});var ko=s(st);as=l(ko,"Enable memory efficient attention from "),it=a(ko,"A",{href:!0,rel:!0});var Wr=s(it);ss=l(Wr,"xFormers"),Wr.forEach(n),is=l(ko,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),ko.forEach(n),rs=p(ke),v(_e.$$.fragment,ke),ls=p(ke),v(be.$$.fragment,ke),ke.forEach(n),ds=p(J),ve=a(J,"DIV",{class:!0});var Go=s(ve);v(rt.$$.fragment,Go),ps=p(Go),lt=a(Go,"P",{});var Vo=s(lt);cs=l(Vo,"Disable memory efficient attention from "),dt=a(Vo,"A",{href:!0,rel:!0});var kr=s(dt);ms=l(kr,"xFormers"),kr.forEach(n),fs=l(Vo,"."),Vo.forEach(n),Go.forEach(n),gs=p(J),ye=a(J,"DIV",{class:!0});var Bo=s(ye);v(pt.$$.fragment,Bo),us=p(Bo),z=a(Bo,"P",{});var Ge=s(z);hs=l(Ge,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),yn=a(Ge,"CODE",{});var Gr=s(yn);_s=l(Gr,"forward"),Gr.forEach(n),bs=l(Ge,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),In=a(Ge,"CODE",{});var Vr=s(In);vs=l(Vr,"enable_sequential_cpu_offload"),Vr.forEach(n),ys=l(Ge,`, but performance is much better due to the
iterative execution of the `),wn=a(Ge,"CODE",{});var Br=s(wn);Is=l(Br,"unet"),Br.forEach(n),ws=l(Ge,"."),Ge.forEach(n),Bo.forEach(n),Ps=p(J),Ie=a(J,"DIV",{class:!0});var No=s(Ie);v(ct.$$.fragment,No),$s=p(No),Pn=a(No,"P",{});var Nr=s(Pn);Us=l(Nr,"Encodes the prompt into text encoder hidden states."),Nr.forEach(n),No.forEach(n),Ts=p(J),L=a(J,"DIV",{class:!0});var N=s(L);v(mt.$$.fragment,N),Ms=p(N),K=a(N,"P",{});var Qt=s(K);Js=l(Qt,"Add noise to the image embeddings. The amount of noise is controlled by a "),$n=a(Qt,"CODE",{});var Fr=s($n);Cs=l(Fr,"noise_level"),Fr.forEach(n),xs=l(Qt,` input. A higher
`),Un=a(Qt,"CODE",{});var Xr=s(Un);Es=l(Xr,"noise_level"),Xr.forEach(n),Ls=l(Qt," increases the variance in the final un-noised images."),Qt.forEach(n),Ss=p(N),Tn=a(N,"P",{});var zr=s(Tn);js=l(zr,"The noise is applied in two ways:"),zr.forEach(n),Zs=p(N),ft=a(N,"OL",{});var Fo=s(ft);Mn=a(Fo,"LI",{});var Dr=s(Mn);Ws=l(Dr,"A noise schedule is applied directly to the embeddings."),Dr.forEach(n),ks=p(Fo),Jn=a(Fo,"LI",{});var Rr=s(Jn);Gs=l(Rr,"A vector of sinusoidal time embeddings are appended to the output."),Rr.forEach(n),Fo.forEach(n),Vs=p(N),gt=a(N,"P",{});var Xo=s(gt);Bs=l(Xo,"In both cases, the amount of noise is controlled by the same "),Cn=a(Xo,"CODE",{});var Ar=s(Cn);Ns=l(Ar,"noise_level"),Ar.forEach(n),Fs=l(Xo,"."),Xo.forEach(n),Xs=p(N),xn=a(N,"P",{});var Yr=s(xn);zs=l(Yr,"The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),Yr.forEach(n),N.forEach(n),J.forEach(n),wo=p(t),ee=a(t,"H2",{class:!0});var zo=s(ee);we=a(zo,"A",{id:!0,class:!0,href:!0});var Qr=s(we);En=a(Qr,"SPAN",{});var qr=s(En);v(ut.$$.fragment,qr),qr.forEach(n),Qr.forEach(n),Ds=p(zo),Ln=a(zo,"SPAN",{});var Or=s(Ln);Rs=l(Or,"StableUnCLIPImg2ImgPipeline"),Or.forEach(n),zo.forEach(n),Po=p(t),M=a(t,"DIV",{class:!0});var C=s(M);v(ht.$$.fragment,C),As=p(C),Sn=a(C,"P",{});var Hr=s(Sn);Ys=l(Hr,"Pipeline for text-guided image-to-image generation using stable unCLIP."),Hr.forEach(n),Qs=p(C),_t=a(C,"P",{});var Do=s(_t);qs=l(Do,"This model inherits from "),At=a(Do,"A",{href:!0});var Kr=s(At);Os=l(Kr,"DiffusionPipeline"),Kr.forEach(n),Hs=l(Do,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Do.forEach(n),Ks=p(C),A=a(C,"DIV",{class:!0});var qt=s(A);v(bt.$$.fragment,qt),ei=p(qt),jn=a(qt,"P",{});var el=s(jn);ti=l(el,"The call function to the pipeline for generation."),el.forEach(n),ni=p(qt),v(Pe.$$.fragment,qt),qt.forEach(n),oi=p(C),V=a(C,"DIV",{class:!0});var Ve=s(V);v(vt.$$.fragment,Ve),ai=p(Ve),Zn=a(Ve,"P",{});var tl=s(Zn);si=l(tl,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),tl.forEach(n),ii=p(Ve),v($e.$$.fragment,Ve),ri=p(Ve),v(Ue.$$.fragment,Ve),Ve.forEach(n),li=p(C),Te=a(C,"DIV",{class:!0});var Ro=s(Te);v(yt.$$.fragment,Ro),di=p(Ro),It=a(Ro,"P",{});var Ao=s(It);pi=l(Ao,"Disable sliced attention computation. If "),Wn=a(Ao,"CODE",{});var nl=s(Wn);ci=l(nl,"enable_attention_slicing"),nl.forEach(n),mi=l(Ao,` was previously called, attention is
computed in one step.`),Ao.forEach(n),Ro.forEach(n),fi=p(C),Me=a(C,"DIV",{class:!0});var Yo=s(Me);v(wt.$$.fragment,Yo),gi=p(Yo),kn=a(Yo,"P",{});var ol=s(kn);ui=l(ol,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),ol.forEach(n),Yo.forEach(n),hi=p(C),Je=a(C,"DIV",{class:!0});var Qo=s(Je);v(Pt.$$.fragment,Qo),_i=p(Qo),$t=a(Qo,"P",{});var qo=s($t);bi=l(qo,"Disable sliced VAE decoding. If "),Gn=a(qo,"CODE",{});var al=s(Gn);vi=l(al,"enable_vae_slicing"),al.forEach(n),yi=l(qo,` was previously enabled, this method will go back to
computing decoding in one step.`),qo.forEach(n),Qo.forEach(n),Ii=p(C),B=a(C,"DIV",{class:!0});var Be=s(B);v(Ut.$$.fragment,Be),wi=p(Be),Tt=a(Be,"P",{});var Oo=s(Tt);Pi=l(Oo,"Enable memory efficient attention from "),Mt=a(Oo,"A",{href:!0,rel:!0});var sl=s(Mt);$i=l(sl,"xFormers"),sl.forEach(n),Ui=l(Oo,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Oo.forEach(n),Ti=p(Be),v(Ce.$$.fragment,Be),Mi=p(Be),v(xe.$$.fragment,Be),Be.forEach(n),Ji=p(C),Ee=a(C,"DIV",{class:!0});var Ho=s(Ee);v(Jt.$$.fragment,Ho),Ci=p(Ho),Ct=a(Ho,"P",{});var Ko=s(Ct);xi=l(Ko,"Disable memory efficient attention from "),xt=a(Ko,"A",{href:!0,rel:!0});var il=s(xt);Ei=l(il,"xFormers"),il.forEach(n),Li=l(Ko,"."),Ko.forEach(n),Ho.forEach(n),Si=p(C),Le=a(C,"DIV",{class:!0});var ea=s(Le);v(Et.$$.fragment,ea),ji=p(ea),D=a(ea,"P",{});var Ne=s(D);Zi=l(Ne,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Vn=a(Ne,"CODE",{});var rl=s(Vn);Wi=l(rl,"forward"),rl.forEach(n),ki=l(Ne,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Bn=a(Ne,"CODE",{});var ll=s(Bn);Gi=l(ll,"enable_sequential_cpu_offload"),ll.forEach(n),Vi=l(Ne,`, but performance is much better due to the
iterative execution of the `),Nn=a(Ne,"CODE",{});var dl=s(Nn);Bi=l(dl,"unet"),dl.forEach(n),Ni=l(Ne,"."),Ne.forEach(n),ea.forEach(n),Fi=p(C),Se=a(C,"DIV",{class:!0});var ta=s(Se);v(Lt.$$.fragment,ta),Xi=p(ta),Fn=a(ta,"P",{});var pl=s(Fn);zi=l(pl,"Encodes the prompt into text encoder hidden states."),pl.forEach(n),ta.forEach(n),Di=p(C),S=a(C,"DIV",{class:!0});var F=s(S);v(St.$$.fragment,F),Ri=p(F),te=a(F,"P",{});var Ot=s(te);Ai=l(Ot,"Add noise to the image embeddings. The amount of noise is controlled by a "),Xn=a(Ot,"CODE",{});var cl=s(Xn);Yi=l(cl,"noise_level"),cl.forEach(n),Qi=l(Ot,` input. A higher
`),zn=a(Ot,"CODE",{});var ml=s(zn);qi=l(ml,"noise_level"),ml.forEach(n),Oi=l(Ot," increases the variance in the final un-noised images."),Ot.forEach(n),Hi=p(F),Dn=a(F,"P",{});var fl=s(Dn);Ki=l(fl,"The noise is applied in two ways:"),fl.forEach(n),er=p(F),jt=a(F,"OL",{});var na=s(jt);Rn=a(na,"LI",{});var gl=s(Rn);tr=l(gl,"A noise schedule is applied directly to the embeddings."),gl.forEach(n),nr=p(na),An=a(na,"LI",{});var ul=s(An);or=l(ul,"A vector of sinusoidal time embeddings are appended to the output."),ul.forEach(n),na.forEach(n),ar=p(F),Zt=a(F,"P",{});var oa=s(Zt);sr=l(oa,"In both cases, the amount of noise is controlled by the same "),Yn=a(oa,"CODE",{});var hl=s(Yn);ir=l(hl,"noise_level"),hl.forEach(n),rr=l(oa,"."),oa.forEach(n),lr=p(F),Qn=a(F,"P",{});var _l=s(Qn);dr=l(_l,"The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),_l.forEach(n),F.forEach(n),C.forEach(n),$o=p(t),ne=a(t,"H2",{class:!0});var aa=s(ne);je=a(aa,"A",{id:!0,class:!0,href:!0});var bl=s(je);qn=a(bl,"SPAN",{});var vl=s(qn);v(Wt.$$.fragment,vl),vl.forEach(n),bl.forEach(n),pr=p(aa),On=a(aa,"SPAN",{});var yl=s(On);cr=l(yl,"ImagePipelineOutput"),yl.forEach(n),aa.forEach(n),Uo=p(t),oe=a(t,"DIV",{class:!0});var sa=s(oe);v(kt.$$.fragment,sa),mr=p(sa),Hn=a(sa,"P",{});var Il=s(Hn);fr=l(Il,"Output class for image pipelines."),Il.forEach(n),sa.forEach(n),this.h()},h(){g(c,"name","hf:doc:metadata"),g(c,"content",JSON.stringify(Vl)),g(m,"id","stable-unclip"),g(m,"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"),g(m,"href","#stable-unclip"),g(f,"class","relative group"),g(Xt,"href","./stable_diffusion/stable_diffusion_2"),g(se,"id","tips"),g(se,"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"),g(se,"href","#tips"),g(Q,"class","relative group"),g(ie,"id","texttoimage-generation"),g(ie,"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"),g(ie,"href","#texttoimage-generation"),g(q,"class","relative group"),g(le,"id","text-guided-imagetoimage-variation"),g(le,"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"),g(le,"href","#text-guided-imagetoimage-variation"),g(O,"class","relative group"),g(pe,"id","diffusers.StableUnCLIPPipeline"),g(pe,"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"),g(pe,"href","#diffusers.StableUnCLIPPipeline"),g(H,"class","relative group"),g(Rt,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(it,"href","https://facebookresearch.github.io/xformers/"),g(it,"rel","nofollow"),g(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(dt,"href","https://facebookresearch.github.io/xformers/"),g(dt,"rel","nofollow"),g(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(we,"id","diffusers.StableUnCLIPImg2ImgPipeline"),g(we,"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"),g(we,"href","#diffusers.StableUnCLIPImg2ImgPipeline"),g(ee,"class","relative group"),g(At,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Mt,"href","https://facebookresearch.github.io/xformers/"),g(Mt,"rel","nofollow"),g(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(xt,"href","https://facebookresearch.github.io/xformers/"),g(xt,"rel","nofollow"),g(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(je,"id","diffusers.ImagePipelineOutput"),g(je,"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"),g(je,"href","#diffusers.ImagePipelineOutput"),g(ne,"class","relative group"),g(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,c),_(t,$,u),_(t,f,u),e(f,m),e(m,U),y(i,U,null),e(f,h),e(f,j),e(j,Y),_(t,Z,u),_(t,X,u),e(X,Ft),e(X,Xt),e(Xt,ia),e(X,ra),_(t,lo,u),_(t,zt,u),e(zt,la),_(t,po,u),_(t,Dt,u),e(Dt,en),e(en,da),_(t,co,u),_(t,Q,u),e(Q,se),e(se,tn),y(Fe,tn,null),e(Q,pa),e(Q,nn),e(nn,ca),_(t,mo,u),_(t,W,u),e(W,ma),e(W,on),e(on,fa),e(W,ga),e(W,an),e(an,ua),e(W,ha),e(W,sn),e(sn,_a),e(W,ba),_(t,fo,u),_(t,q,u),e(q,ie),e(ie,rn),y(Xe,rn,null),e(q,va),e(q,ln),e(ln,ya),_(t,go,u),y(ze,t,u),_(t,uo,u),y(re,t,u),_(t,ho,u),_(t,O,u),e(O,le),e(le,dn),y(De,dn,null),e(O,Ia),e(O,pn),e(pn,wa),_(t,_o,u),y(Re,t,u),_(t,bo,u),_(t,de,u),e(de,Pa),e(de,cn),e(cn,$a),e(de,Ua),_(t,vo,u),y(Ae,t,u),_(t,yo,u),_(t,H,u),e(H,pe),e(pe,mn),y(Ye,mn,null),e(H,Ta),e(H,fn),e(fn,Ma),_(t,Io,u),_(t,T,u),y(Qe,T,null),e(T,Ja),e(T,gn),e(gn,Ca),e(T,xa),e(T,qe),e(qe,Ea),e(qe,Rt),e(Rt,La),e(qe,Sa),e(T,ja),e(T,R),y(Oe,R,null),e(R,Za),e(R,un),e(un,Wa),e(R,ka),y(ce,R,null),e(T,Ga),e(T,k),y(He,k,null),e(k,Va),e(k,hn),e(hn,Ba),e(k,Na),y(me,k,null),e(k,Fa),y(fe,k,null),e(T,Xa),e(T,ge),y(Ke,ge,null),e(ge,za),e(ge,et),e(et,Da),e(et,_n),e(_n,Ra),e(et,Aa),e(T,Ya),e(T,ue),y(tt,ue,null),e(ue,Qa),e(ue,bn),e(bn,qa),e(T,Oa),e(T,he),y(nt,he,null),e(he,Ha),e(he,ot),e(ot,Ka),e(ot,vn),e(vn,es),e(ot,ts),e(T,ns),e(T,G),y(at,G,null),e(G,os),e(G,st),e(st,as),e(st,it),e(it,ss),e(st,is),e(G,rs),y(_e,G,null),e(G,ls),y(be,G,null),e(T,ds),e(T,ve),y(rt,ve,null),e(ve,ps),e(ve,lt),e(lt,cs),e(lt,dt),e(dt,ms),e(lt,fs),e(T,gs),e(T,ye),y(pt,ye,null),e(ye,us),e(ye,z),e(z,hs),e(z,yn),e(yn,_s),e(z,bs),e(z,In),e(In,vs),e(z,ys),e(z,wn),e(wn,Is),e(z,ws),e(T,Ps),e(T,Ie),y(ct,Ie,null),e(Ie,$s),e(Ie,Pn),e(Pn,Us),e(T,Ts),e(T,L),y(mt,L,null),e(L,Ms),e(L,K),e(K,Js),e(K,$n),e($n,Cs),e(K,xs),e(K,Un),e(Un,Es),e(K,Ls),e(L,Ss),e(L,Tn),e(Tn,js),e(L,Zs),e(L,ft),e(ft,Mn),e(Mn,Ws),e(ft,ks),e(ft,Jn),e(Jn,Gs),e(L,Vs),e(L,gt),e(gt,Bs),e(gt,Cn),e(Cn,Ns),e(gt,Fs),e(L,Xs),e(L,xn),e(xn,zs),_(t,wo,u),_(t,ee,u),e(ee,we),e(we,En),y(ut,En,null),e(ee,Ds),e(ee,Ln),e(Ln,Rs),_(t,Po,u),_(t,M,u),y(ht,M,null),e(M,As),e(M,Sn),e(Sn,Ys),e(M,Qs),e(M,_t),e(_t,qs),e(_t,At),e(At,Os),e(_t,Hs),e(M,Ks),e(M,A),y(bt,A,null),e(A,ei),e(A,jn),e(jn,ti),e(A,ni),y(Pe,A,null),e(M,oi),e(M,V),y(vt,V,null),e(V,ai),e(V,Zn),e(Zn,si),e(V,ii),y($e,V,null),e(V,ri),y(Ue,V,null),e(M,li),e(M,Te),y(yt,Te,null),e(Te,di),e(Te,It),e(It,pi),e(It,Wn),e(Wn,ci),e(It,mi),e(M,fi),e(M,Me),y(wt,Me,null),e(Me,gi),e(Me,kn),e(kn,ui),e(M,hi),e(M,Je),y(Pt,Je,null),e(Je,_i),e(Je,$t),e($t,bi),e($t,Gn),e(Gn,vi),e($t,yi),e(M,Ii),e(M,B),y(Ut,B,null),e(B,wi),e(B,Tt),e(Tt,Pi),e(Tt,Mt),e(Mt,$i),e(Tt,Ui),e(B,Ti),y(Ce,B,null),e(B,Mi),y(xe,B,null),e(M,Ji),e(M,Ee),y(Jt,Ee,null),e(Ee,Ci),e(Ee,Ct),e(Ct,xi),e(Ct,xt),e(xt,Ei),e(Ct,Li),e(M,Si),e(M,Le),y(Et,Le,null),e(Le,ji),e(Le,D),e(D,Zi),e(D,Vn),e(Vn,Wi),e(D,ki),e(D,Bn),e(Bn,Gi),e(D,Vi),e(D,Nn),e(Nn,Bi),e(D,Ni),e(M,Fi),e(M,Se),y(Lt,Se,null),e(Se,Xi),e(Se,Fn),e(Fn,zi),e(M,Di),e(M,S),y(St,S,null),e(S,Ri),e(S,te),e(te,Ai),e(te,Xn),e(Xn,Yi),e(te,Qi),e(te,zn),e(zn,qi),e(te,Oi),e(S,Hi),e(S,Dn),e(Dn,Ki),e(S,er),e(S,jt),e(jt,Rn),e(Rn,tr),e(jt,nr),e(jt,An),e(An,or),e(S,ar),e(S,Zt),e(Zt,sr),e(Zt,Yn),e(Yn,ir),e(Zt,rr),e(S,lr),e(S,Qn),e(Qn,dr),_(t,$o,u),_(t,ne,u),e(ne,je),e(je,qn),y(Wt,qn,null),e(ne,pr),e(ne,On),e(On,cr),_(t,Uo,u),_(t,oe,u),y(kt,oe,null),e(oe,mr),e(oe,Hn),e(Hn,fr),To=!0},p(t,[u]){const Gt={};u&2&&(Gt.$$scope={dirty:u,ctx:t}),re.$set(Gt);const Kn={};u&2&&(Kn.$$scope={dirty:u,ctx:t}),ce.$set(Kn);const eo={};u&2&&(eo.$$scope={dirty:u,ctx:t}),me.$set(eo);const to={};u&2&&(to.$$scope={dirty:u,ctx:t}),fe.$set(to);const Vt={};u&2&&(Vt.$$scope={dirty:u,ctx:t}),_e.$set(Vt);const no={};u&2&&(no.$$scope={dirty:u,ctx:t}),be.$set(no);const oo={};u&2&&(oo.$$scope={dirty:u,ctx:t}),Pe.$set(oo);const ao={};u&2&&(ao.$$scope={dirty:u,ctx:t}),$e.$set(ao);const so={};u&2&&(so.$$scope={dirty:u,ctx:t}),Ue.$set(so);const Bt={};u&2&&(Bt.$$scope={dirty:u,ctx:t}),Ce.$set(Bt);const io={};u&2&&(io.$$scope={dirty:u,ctx:t}),xe.$set(io)},i(t){To||(I(i.$$.fragment,t),I(Fe.$$.fragment,t),I(Xe.$$.fragment,t),I(ze.$$.fragment,t),I(re.$$.fragment,t),I(De.$$.fragment,t),I(Re.$$.fragment,t),I(Ae.$$.fragment,t),I(Ye.$$.fragment,t),I(Qe.$$.fragment,t),I(Oe.$$.fragment,t),I(ce.$$.fragment,t),I(He.$$.fragment,t),I(me.$$.fragment,t),I(fe.$$.fragment,t),I(Ke.$$.fragment,t),I(tt.$$.fragment,t),I(nt.$$.fragment,t),I(at.$$.fragment,t),I(_e.$$.fragment,t),I(be.$$.fragment,t),I(rt.$$.fragment,t),I(pt.$$.fragment,t),I(ct.$$.fragment,t),I(mt.$$.fragment,t),I(ut.$$.fragment,t),I(ht.$$.fragment,t),I(bt.$$.fragment,t),I(Pe.$$.fragment,t),I(vt.$$.fragment,t),I($e.$$.fragment,t),I(Ue.$$.fragment,t),I(yt.$$.fragment,t),I(wt.$$.fragment,t),I(Pt.$$.fragment,t),I(Ut.$$.fragment,t),I(Ce.$$.fragment,t),I(xe.$$.fragment,t),I(Jt.$$.fragment,t),I(Et.$$.fragment,t),I(Lt.$$.fragment,t),I(St.$$.fragment,t),I(Wt.$$.fragment,t),I(kt.$$.fragment,t),To=!0)},o(t){w(i.$$.fragment,t),w(Fe.$$.fragment,t),w(Xe.$$.fragment,t),w(ze.$$.fragment,t),w(re.$$.fragment,t),w(De.$$.fragment,t),w(Re.$$.fragment,t),w(Ae.$$.fragment,t),w(Ye.$$.fragment,t),w(Qe.$$.fragment,t),w(Oe.$$.fragment,t),w(ce.$$.fragment,t),w(He.$$.fragment,t),w(me.$$.fragment,t),w(fe.$$.fragment,t),w(Ke.$$.fragment,t),w(tt.$$.fragment,t),w(nt.$$.fragment,t),w(at.$$.fragment,t),w(_e.$$.fragment,t),w(be.$$.fragment,t),w(rt.$$.fragment,t),w(pt.$$.fragment,t),w(ct.$$.fragment,t),w(mt.$$.fragment,t),w(ut.$$.fragment,t),w(ht.$$.fragment,t),w(bt.$$.fragment,t),w(Pe.$$.fragment,t),w(vt.$$.fragment,t),w($e.$$.fragment,t),w(Ue.$$.fragment,t),w(yt.$$.fragment,t),w(wt.$$.fragment,t),w(Pt.$$.fragment,t),w(Ut.$$.fragment,t),w(Ce.$$.fragment,t),w(xe.$$.fragment,t),w(Jt.$$.fragment,t),w(Et.$$.fragment,t),w(Lt.$$.fragment,t),w(St.$$.fragment,t),w(Wt.$$.fragment,t),w(kt.$$.fragment,t),To=!1},d(t){n(c),t&&n($),t&&n(f),P(i),t&&n(Z),t&&n(X),t&&n(lo),t&&n(zt),t&&n(po),t&&n(Dt),t&&n(co),t&&n(Q),P(Fe),t&&n(mo),t&&n(W),t&&n(fo),t&&n(q),P(Xe),t&&n(go),P(ze,t),t&&n(uo),P(re,t),t&&n(ho),t&&n(O),P(De),t&&n(_o),P(Re,t),t&&n(bo),t&&n(de),t&&n(vo),P(Ae,t),t&&n(yo),t&&n(H),P(Ye),t&&n(Io),t&&n(T),P(Qe),P(Oe),P(ce),P(He),P(me),P(fe),P(Ke),P(tt),P(nt),P(at),P(_e),P(be),P(rt),P(pt),P(ct),P(mt),t&&n(wo),t&&n(ee),P(ut),t&&n(Po),t&&n(M),P(ht),P(bt),P(Pe),P(vt),P($e),P(Ue),P(yt),P(wt),P(Pt),P(Ut),P(Ce),P(xe),P(Jt),P(Et),P(Lt),P(St),t&&n($o),t&&n(ne),P(Wt),t&&n(Uo),t&&n(oe),P(kt)}}}const Vl={local:"stable-unclip",sections:[{local:"tips",sections:[{local:"texttoimage-generation",title:"Text-to-Image Generation"},{local:"text-guided-imagetoimage-variation",title:"Text guided Image-to-Image Variation"}],title:"Tips"},{local:"diffusers.StableUnCLIPPipeline",title:"StableUnCLIPPipeline"},{local:"diffusers.StableUnCLIPImg2ImgPipeline",title:"StableUnCLIPImg2ImgPipeline"},{local:"diffusers.ImagePipelineOutput",title:"ImagePipelineOutput"}],title:"Stable unCLIP"};function Bl(x){return Tl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Al extends wl{constructor(c){super();Pl(this,c,Bl,Gl,$l,{})}}export{Al as default,Vl as metadata};
