import{S as Wr,i as kr,s as Gr,e as o,k as d,w as v,t as r,M as Vr,c as a,d as n,m as c,a as s,x as y,h as l,b as u,G as e,g as _,y as I,q as w,o as P,B as $,v as Br,L as Rt}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Dn}from"../../../chunks/Tip-hf-doc-builder.js";import{D as E}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as ne}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Lt}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as zt}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Nr(J){let p,b,g,m,U,i,h,j;return{c(){p=o("p"),b=r("For text-to-image we use "),g=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(A){p=a(A,"P",{});var Z=s(p);b=l(Z,"For text-to-image we use "),g=a(Z,"CODE",{});var X=s(g);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 jt=s(i);h=l(jt,"stabilityai/stable-diffusion-2-1-unclip"),jt.forEach(n),j=l(Z," was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),Z.forEach(n),this.h()},h(){u(i,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip"),u(i,"rel","nofollow")},m(A,Z){_(A,p,Z),e(p,b),e(p,g),e(g,m),e(p,U),e(p,i),e(i,h),e(p,j)},d(A){A&&n(p)}}}function Fr(J){let p,b,g,m,U;return m=new ne({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(){p=o("p"),b=r("Examples:"),g=d(),v(m.$$.fragment)},l(i){p=a(i,"P",{});var h=s(p);b=l(h,"Examples:"),h.forEach(n),g=c(i),y(m.$$.fragment,i)},m(i,h){_(i,p,h),e(p,b),_(i,g,h),I(m,i,h),U=!0},p:Rt,i(i){U||(w(m.$$.fragment,i),U=!0)},o(i){P(m.$$.fragment,i),U=!1},d(i){i&&n(p),i&&n(g),$(m,i)}}}function Xr(J){let p,b,g,m,U;return{c(){p=o("p"),b=r("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),g=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){p=a(i,"P",{});var h=s(p);b=l(h,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),g=a(h,"CODE",{});var j=s(g);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,p,h),e(p,b),e(p,g),e(g,m),e(p,U)},d(i){i&&n(p)}}}function zr(J){let p,b,g,m,U;return m=new ne({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(){p=o("p"),b=r("Examples:"),g=d(),v(m.$$.fragment)},l(i){p=a(i,"P",{});var h=s(p);b=l(h,"Examples:"),h.forEach(n),g=c(i),y(m.$$.fragment,i)},m(i,h){_(i,p,h),e(p,b),_(i,g,h),I(m,i,h),U=!0},p:Rt,i(i){U||(w(m.$$.fragment,i),U=!0)},o(i){P(m.$$.fragment,i),U=!1},d(i){i&&n(p),i&&n(g),$(m,i)}}}function Rr(J){let p,b;return{c(){p=o("p"),b=r(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(g){p=a(g,"P",{});var m=s(p);b=l(m,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),m.forEach(n)},m(g,m){_(g,p,m),e(p,b)},d(g){g&&n(p)}}}function Ar(J){let p,b,g,m,U;return m=new ne({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(){p=o("p"),b=r("Examples:"),g=d(),v(m.$$.fragment)},l(i){p=a(i,"P",{});var h=s(p);b=l(h,"Examples:"),h.forEach(n),g=c(i),y(m.$$.fragment,i)},m(i,h){_(i,p,h),e(p,b),_(i,g,h),I(m,i,h),U=!0},p:Rt,i(i){U||(w(m.$$.fragment,i),U=!0)},o(i){P(m.$$.fragment,i),U=!1},d(i){i&&n(p),i&&n(g),$(m,i)}}}function Dr(J){let p,b,g,m,U;return m=new ne({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(){p=o("p"),b=r("Examples:"),g=d(),v(m.$$.fragment)},l(i){p=a(i,"P",{});var h=s(p);b=l(h,"Examples:"),h.forEach(n),g=c(i),y(m.$$.fragment,i)},m(i,h){_(i,p,h),e(p,b),_(i,g,h),I(m,i,h),U=!0},p:Rt,i(i){U||(w(m.$$.fragment,i),U=!0)},o(i){P(m.$$.fragment,i),U=!1},d(i){i&&n(p),i&&n(g),$(m,i)}}}function Yr(J){let p,b,g,m,U;return{c(){p=o("p"),b=r("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),g=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){p=a(i,"P",{});var h=s(p);b=l(h,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),g=a(h,"CODE",{});var j=s(g);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,p,h),e(p,b),e(p,g),e(g,m),e(p,U)},d(i){i&&n(p)}}}function Qr(J){let p,b,g,m,U;return m=new ne({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(){p=o("p"),b=r("Examples:"),g=d(),v(m.$$.fragment)},l(i){p=a(i,"P",{});var h=s(p);b=l(h,"Examples:"),h.forEach(n),g=c(i),y(m.$$.fragment,i)},m(i,h){_(i,p,h),e(p,b),_(i,g,h),I(m,i,h),U=!0},p:Rt,i(i){U||(w(m.$$.fragment,i),U=!0)},o(i){P(m.$$.fragment,i),U=!1},d(i){i&&n(p),i&&n(g),$(m,i)}}}function qr(J){let p,b;return{c(){p=o("p"),b=r(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(g){p=a(g,"P",{});var m=s(p);b=l(m,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),m.forEach(n)},m(g,m){_(g,p,m),e(p,b)},d(g){g&&n(p)}}}function Or(J){let p,b,g,m,U;return m=new ne({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(){p=o("p"),b=r("Examples:"),g=d(),v(m.$$.fragment)},l(i){p=a(i,"P",{});var h=s(p);b=l(h,"Examples:"),h.forEach(n),g=c(i),y(m.$$.fragment,i)},m(i,h){_(i,p,h),e(p,b),_(i,g,h),I(m,i,h),U=!0},p:Rt,i(i){U||(w(m.$$.fragment,i),U=!0)},o(i){P(m.$$.fragment,i),U=!1},d(i){i&&n(p),i&&n(g),$(m,i)}}}function Hr(J){let p,b,g,m,U,i,h,j,A,Z,X,jt,Zt,zo,Ro,Yn,Wt,Ao,Qn,kt,At,Do,qn,D,oe,Dt,We,Yo,Yt,Qo,On,W,qo,Qt,Oo,Ho,qt,Ko,ea,Ot,ta,na,Hn,Y,ae,Ht,ke,oa,Kt,aa,Kn,Ge,eo,se,to,Q,ie,en,Ve,sa,tn,ia,no,Be,oo,re,ra,nn,la,pa,ao,Ne,so,q,le,on,Fe,da,an,ca,io,T,Xe,ma,sn,ga,fa,ze,ua,Gt,ha,_a,ba,z,Re,va,rn,ya,Ia,pe,wa,k,Ae,Pa,ln,$a,Ua,de,Ta,ce,Ma,me,De,Ja,Ye,xa,pn,Ca,Ea,Sa,ge,Qe,La,dn,ja,Za,fe,qe,Wa,Oe,ka,cn,Ga,Va,Ba,G,He,Na,Ke,Fa,et,Xa,za,Ra,ue,Aa,he,Da,_e,tt,Ya,nt,Qa,ot,qa,Oa,Ha,be,at,Ka,mn,es,ts,S,st,ns,O,os,gn,as,ss,fn,is,rs,ls,un,ps,ds,it,hn,cs,ms,_n,gs,fs,rt,us,bn,hs,_s,bs,vn,vs,ro,H,ve,yn,lt,ys,In,Is,lo,M,pt,ws,wn,Ps,$s,dt,Us,Vt,Ts,Ms,Js,R,ct,xs,Pn,Cs,Es,ye,Ss,V,mt,Ls,$n,js,Zs,Ie,Ws,we,ks,Pe,gt,Gs,ft,Vs,Un,Bs,Ns,Fs,$e,ut,Xs,Tn,zs,Rs,Ue,ht,As,_t,Ds,Mn,Ys,Qs,qs,B,bt,Os,vt,Hs,yt,Ks,ei,ti,Te,ni,Me,oi,Je,It,ai,wt,si,Pt,ii,ri,li,xe,$t,pi,Jn,di,ci,L,Ut,mi,K,gi,xn,fi,ui,Cn,hi,_i,bi,En,vi,yi,Tt,Sn,Ii,wi,Ln,Pi,$i,Mt,Ui,jn,Ti,Mi,Ji,Zn,xi,po,ee,Ce,Wn,Jt,Ci,kn,Ei,co,te,xt,Si,Gn,Li,mo;return i=new Lt({}),We=new Lt({}),ke=new Lt({}),Ge=new ne({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>)`}}),se=new Dn({props:{warning:!0,$$slots:{default:[Nr]},$$scope:{ctx:J}}}),Ve=new Lt({}),Be=new ne({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>)`}}),Ne=new ne({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>)`}}),Fe=new Lt({}),Xe=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/v0.21.0/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/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/v0.21.0/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/v0.21.0/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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L58"}}),Re=new E({props:{name:"__call__",anchor:"diffusers.StableUnCLIPPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[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[str, typing.List[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/v0.21.0/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/v0.21.0/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/v0.21.0/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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L625",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/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),pe=new zt({props:{anchor:"diffusers.StableUnCLIPPipeline.__call__.example",$$slots:{default:[Fr]},$$scope:{ctx:J}}}),Ae=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1780"}}),de=new Dn({props:{warning:!0,$$slots:{default:[Xr]},$$scope:{ctx:J}}}),ce=new zt({props:{anchor:"diffusers.StableUnCLIPPipeline.enable_attention_slicing.example",$$slots:{default:[zr]},$$scope:{ctx:J}}}),De=new E({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1820"}}),Qe=new E({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L151"}}),qe=new E({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L159"}}),He=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1719"}}),ue=new Dn({props:{warning:!0,$$slots:{default:[Rr]},$$scope:{ctx:J}}}),he=new zt({props:{anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Ar]},$$scope:{ctx:J}}}),tt=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1754"}}),at=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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L300"}}),st=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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L579"}}),lt=new Lt({}),pt=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> (<code>CLIPTextModel</code>) &#x2014;
Frozen <code>CLIPTextModel</code> text-encoder.`,name:"text_encoder"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/v0.21.0/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/v0.21.0/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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L65"}}),ct=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[str, typing.List[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/v0.21.0/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/v0.21.0/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/v0.21.0/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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L587",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/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),ye=new zt({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.example",$$slots:{default:[Dr]},$$scope:{ctx:J}}}),mt=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1780"}}),Ie=new Dn({props:{warning:!0,$$slots:{default:[Yr]},$$scope:{ctx:J}}}),we=new zt({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[Qr]},$$scope:{ctx:J}}}),gt=new E({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1820"}}),ut=new E({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L148"}}),ht=new E({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L156"}}),bt=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1719"}}),Te=new Dn({props:{warning:!0,$$slots:{default:[qr]},$$scope:{ctx:J}}}),Me=new zt({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Or]},$$scope:{ctx:J}}}),It=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1754"}}),$t=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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L250"}}),Ut=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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L541"}}),Jt=new Lt({}),xt=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L112"}}),{c(){p=o("meta"),b=d(),g=o("h1"),m=o("a"),U=o("span"),v(i.$$.fragment),h=d(),j=o("span"),A=r("Stable unCLIP"),Z=d(),X=o("p"),jt=r("Stable unCLIP checkpoints are finetuned from "),Zt=o("a"),zo=r("Stable Diffusion 2.1"),Ro=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.`),Yn=d(),Wt=o("p"),Ao=r("The abstract from the paper is:"),Qn=d(),kt=o("p"),At=o("em"),Do=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."),qn=d(),D=o("h2"),oe=o("a"),Dt=o("span"),v(We.$$.fragment),Yo=d(),Yt=o("span"),Qo=r("Tips"),On=d(),W=o("p"),qo=r("Stable unCLIP takes  "),Qt=o("code"),Oo=r("noise_level"),Ho=r(` as input during inference which determines how much noise is added
to the image embeddings. A higher `),qt=o("code"),Ko=r("noise_level"),ea=r(` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings (`),Ot=o("code"),ta=r("noise_level = 0"),na=r(")."),Hn=d(),Y=o("h3"),ae=o("a"),Ht=o("span"),v(ke.$$.fragment),oa=d(),Kt=o("span"),aa=r("Text-to-Image Generation"),Kn=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)

	`),v(Ge.$$.fragment),eo=d(),v(se.$$.fragment),to=d(),Q=o("h3"),ie=o("a"),en=o("span"),v(Ve.$$.fragment),sa=d(),tn=o("span"),ia=r("Text guided Image-to-Image Variation"),no=d(),v(Be.$$.fragment),oo=d(),re=o("p"),ra=r("Optionally, you can also pass a prompt to "),nn=o("code"),la=r("pipe"),pa=r(" such as:"),ao=d(),v(Ne.$$.fragment),so=d(),q=o("h2"),le=o("a"),on=o("span"),v(Fe.$$.fragment),da=d(),an=o("span"),ca=r("StableUnCLIPPipeline"),io=d(),T=o("div"),v(Xe.$$.fragment),ma=d(),sn=o("p"),ga=r("Pipeline for text-to-image generation using stable unCLIP."),fa=d(),ze=o("p"),ua=r("This model inherits from "),Gt=o("a"),ha=r("DiffusionPipeline"),_a=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ba=d(),z=o("div"),v(Re.$$.fragment),va=d(),rn=o("p"),ya=r("The call function to the pipeline for generation."),Ia=d(),v(pe.$$.fragment),wa=d(),k=o("div"),v(Ae.$$.fragment),Pa=d(),ln=o("p"),$a=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.`),Ua=d(),v(de.$$.fragment),Ta=d(),v(ce.$$.fragment),Ma=d(),me=o("div"),v(De.$$.fragment),Ja=d(),Ye=o("p"),xa=r("Disable sliced attention computation. If "),pn=o("code"),Ca=r("enable_attention_slicing"),Ea=r(` was previously called, attention is
computed in one step.`),Sa=d(),ge=o("div"),v(Qe.$$.fragment),La=d(),dn=o("p"),ja=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.`),Za=d(),fe=o("div"),v(qe.$$.fragment),Wa=d(),Oe=o("p"),ka=r("Disable sliced VAE decoding. If "),cn=o("code"),Ga=r("enable_vae_slicing"),Va=r(` was previously enabled, this method will go back to
computing decoding in one step.`),Ba=d(),G=o("div"),v(He.$$.fragment),Na=d(),Ke=o("p"),Fa=r("Enable memory efficient attention from "),et=o("a"),Xa=r("xFormers"),za=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.`),Ra=d(),v(ue.$$.fragment),Aa=d(),v(he.$$.fragment),Da=d(),_e=o("div"),v(tt.$$.fragment),Ya=d(),nt=o("p"),Qa=r("Disable memory efficient attention from "),ot=o("a"),qa=r("xFormers"),Oa=r("."),Ha=d(),be=o("div"),v(at.$$.fragment),Ka=d(),mn=o("p"),es=r("Encodes the prompt into text encoder hidden states."),ts=d(),S=o("div"),v(st.$$.fragment),ns=d(),O=o("p"),os=r("Add noise to the image embeddings. The amount of noise is controlled by a "),gn=o("code"),as=r("noise_level"),ss=r(` input. A higher
`),fn=o("code"),is=r("noise_level"),rs=r(" increases the variance in the final un-noised images."),ls=d(),un=o("p"),ps=r("The noise is applied in two ways:"),ds=d(),it=o("ol"),hn=o("li"),cs=r("A noise schedule is applied directly to the embeddings."),ms=d(),_n=o("li"),gs=r("A vector of sinusoidal time embeddings are appended to the output."),fs=d(),rt=o("p"),us=r("In both cases, the amount of noise is controlled by the same "),bn=o("code"),hs=r("noise_level"),_s=r("."),bs=d(),vn=o("p"),vs=r("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),ro=d(),H=o("h2"),ve=o("a"),yn=o("span"),v(lt.$$.fragment),ys=d(),In=o("span"),Is=r("StableUnCLIPImg2ImgPipeline"),lo=d(),M=o("div"),v(pt.$$.fragment),ws=d(),wn=o("p"),Ps=r("Pipeline for text-guided image-to-image generation using stable unCLIP."),$s=d(),dt=o("p"),Us=r("This model inherits from "),Vt=o("a"),Ts=r("DiffusionPipeline"),Ms=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Js=d(),R=o("div"),v(ct.$$.fragment),xs=d(),Pn=o("p"),Cs=r("The call function to the pipeline for generation."),Es=d(),v(ye.$$.fragment),Ss=d(),V=o("div"),v(mt.$$.fragment),Ls=d(),$n=o("p"),js=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.`),Zs=d(),v(Ie.$$.fragment),Ws=d(),v(we.$$.fragment),ks=d(),Pe=o("div"),v(gt.$$.fragment),Gs=d(),ft=o("p"),Vs=r("Disable sliced attention computation. If "),Un=o("code"),Bs=r("enable_attention_slicing"),Ns=r(` was previously called, attention is
computed in one step.`),Fs=d(),$e=o("div"),v(ut.$$.fragment),Xs=d(),Tn=o("p"),zs=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.`),Rs=d(),Ue=o("div"),v(ht.$$.fragment),As=d(),_t=o("p"),Ds=r("Disable sliced VAE decoding. If "),Mn=o("code"),Ys=r("enable_vae_slicing"),Qs=r(` was previously enabled, this method will go back to
computing decoding in one step.`),qs=d(),B=o("div"),v(bt.$$.fragment),Os=d(),vt=o("p"),Hs=r("Enable memory efficient attention from "),yt=o("a"),Ks=r("xFormers"),ei=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(),v(Te.$$.fragment),ni=d(),v(Me.$$.fragment),oi=d(),Je=o("div"),v(It.$$.fragment),ai=d(),wt=o("p"),si=r("Disable memory efficient attention from "),Pt=o("a"),ii=r("xFormers"),ri=r("."),li=d(),xe=o("div"),v($t.$$.fragment),pi=d(),Jn=o("p"),di=r("Encodes the prompt into text encoder hidden states."),ci=d(),L=o("div"),v(Ut.$$.fragment),mi=d(),K=o("p"),gi=r("Add noise to the image embeddings. The amount of noise is controlled by a "),xn=o("code"),fi=r("noise_level"),ui=r(` input. A higher
`),Cn=o("code"),hi=r("noise_level"),_i=r(" increases the variance in the final un-noised images."),bi=d(),En=o("p"),vi=r("The noise is applied in two ways:"),yi=d(),Tt=o("ol"),Sn=o("li"),Ii=r("A noise schedule is applied directly to the embeddings."),wi=d(),Ln=o("li"),Pi=r("A vector of sinusoidal time embeddings are appended to the output."),$i=d(),Mt=o("p"),Ui=r("In both cases, the amount of noise is controlled by the same "),jn=o("code"),Ti=r("noise_level"),Mi=r("."),Ji=d(),Zn=o("p"),xi=r("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),po=d(),ee=o("h2"),Ce=o("a"),Wn=o("span"),v(Jt.$$.fragment),Ci=d(),kn=o("span"),Ei=r("ImagePipelineOutput"),co=d(),te=o("div"),v(xt.$$.fragment),Si=d(),Gn=o("p"),Li=r("Output class for image pipelines."),this.h()},l(t){const f=Vr('[data-svelte="svelte-1phssyn"]',document.head);p=a(f,"META",{name:!0,content:!0}),f.forEach(n),b=c(t),g=a(t,"H1",{class:!0});var Ct=s(g);m=a(Ct,"A",{id:!0,class:!0,href:!0});var Vn=s(m);U=a(Vn,"SPAN",{});var Bn=s(U);y(i.$$.fragment,Bn),Bn.forEach(n),Vn.forEach(n),h=c(Ct),j=a(Ct,"SPAN",{});var Nn=s(j);A=l(Nn,"Stable unCLIP"),Nn.forEach(n),Ct.forEach(n),Z=c(t),X=a(t,"P",{});var Et=s(X);jt=l(Et,"Stable unCLIP checkpoints are finetuned from "),Zt=a(Et,"A",{href:!0});var Fn=s(Zt);zo=l(Fn,"Stable Diffusion 2.1"),Fn.forEach(n),Ro=l(Et,` 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.`),Et.forEach(n),Yn=c(t),Wt=a(t,"P",{});var Xn=s(Wt);Ao=l(Xn,"The abstract from the paper is:"),Xn.forEach(n),Qn=c(t),kt=a(t,"P",{});var zn=s(kt);At=a(zn,"EM",{});var Rn=s(At);Do=l(Rn,"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."),Rn.forEach(n),zn.forEach(n),qn=c(t),D=a(t,"H2",{class:!0});var St=s(D);oe=a(St,"A",{id:!0,class:!0,href:!0});var An=s(oe);Dt=a(An,"SPAN",{});var ji=s(Dt);y(We.$$.fragment,ji),ji.forEach(n),An.forEach(n),Yo=c(St),Yt=a(St,"SPAN",{});var Zi=s(Yt);Qo=l(Zi,"Tips"),Zi.forEach(n),St.forEach(n),On=c(t),W=a(t,"P",{});var Ee=s(W);qo=l(Ee,"Stable unCLIP takes  "),Qt=a(Ee,"CODE",{});var Wi=s(Qt);Oo=l(Wi,"noise_level"),Wi.forEach(n),Ho=l(Ee,` as input during inference which determines how much noise is added
to the image embeddings. A higher `),qt=a(Ee,"CODE",{});var ki=s(qt);Ko=l(ki,"noise_level"),ki.forEach(n),ea=l(Ee,` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings (`),Ot=a(Ee,"CODE",{});var Gi=s(Ot);ta=l(Gi,"noise_level = 0"),Gi.forEach(n),na=l(Ee,")."),Ee.forEach(n),Hn=c(t),Y=a(t,"H3",{class:!0});var go=s(Y);ae=a(go,"A",{id:!0,class:!0,href:!0});var Vi=s(ae);Ht=a(Vi,"SPAN",{});var Bi=s(Ht);y(ke.$$.fragment,Bi),Bi.forEach(n),Vi.forEach(n),oa=c(go),Kt=a(go,"SPAN",{});var Ni=s(Kt);aa=l(Ni,"Text-to-Image Generation"),Ni.forEach(n),go.forEach(n),Kn=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)

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