import{S as Or,i as Hr,s as Qr,e as n,k as d,w as v,t as s,M as Kr,c as i,d as t,m as c,a as r,x,h as a,b as p,G as e,g as y,y as $,q as D,o as T,B as S,v as el,L as Ut}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Aa}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as jt}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as en}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as It}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function tl(P){let f,b,h,u,_,l,m,C,A,fe,J,R,z,Be,Y,q,Ve;return{c(){f=n("p"),b=s("Make sure to check out the Stable Diffusion "),h=n("a"),u=s("Tips"),_=s(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),l=d(),m=n("p"),C=s("If you\u2019re interested in using one of the official checkpoints for a task, explore the "),A=n("a"),fe=s("CompVis"),J=s(", "),R=n("a"),z=s("Runway"),Be=s(", and "),Y=n("a"),q=s("Stability AI"),Ve=s(" Hub organizations!"),this.h()},l(Z){f=i(Z,"P",{});var I=r(f);b=a(I,"Make sure to check out the Stable Diffusion "),h=i(I,"A",{href:!0});var Zt=r(h);u=a(Zt,"Tips"),Zt.forEach(t),_=a(I," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),I.forEach(t),l=c(Z),m=i(Z,"P",{});var F=r(m);C=a(F,"If you\u2019re interested in using one of the official checkpoints for a task, explore the "),A=i(F,"A",{href:!0,rel:!0});var K=r(A);fe=a(K,"CompVis"),K.forEach(t),J=a(F,", "),R=i(F,"A",{href:!0,rel:!0});var Wt=r(R);z=a(Wt,"Runway"),Wt.forEach(t),Be=a(F,", and "),Y=i(F,"A",{href:!0,rel:!0});var Gt=r(Y);q=a(Gt,"Stability AI"),Gt.forEach(t),Ve=a(F," Hub organizations!"),F.forEach(t),this.h()},h(){p(h,"href","overview#tips"),p(A,"href","https://huggingface.co/CompVis"),p(A,"rel","nofollow"),p(R,"href","https://huggingface.co/runwayml"),p(R,"rel","nofollow"),p(Y,"href","https://huggingface.co/stabilityai"),p(Y,"rel","nofollow")},m(Z,I){y(Z,f,I),e(f,b),e(f,h),e(h,u),e(f,_),y(Z,l,I),y(Z,m,I),e(m,C),e(m,A),e(A,fe),e(m,J),e(m,R),e(R,z),e(m,Be),e(m,Y),e(Y,q),e(m,Ve)},d(Z){Z&&t(f),Z&&t(l),Z&&t(m)}}}function ol(P){let f,b,h,u,_;return u=new jt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMG9uJTIwbWFycyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",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-string">&quot;runwayml/stable-diffusion-v1-5&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>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>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){f=n("p"),b=s("Examples:"),h=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var m=r(f);b=a(m,"Examples:"),m.forEach(t),h=c(l),x(u.$$.fragment,l)},m(l,m){y(l,f,m),e(f,b),y(l,h,m),$(u,l,m),_=!0},p:Ut,i(l){_||(D(u.$$.fragment,l),_=!0)},o(l){T(u.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),S(u,l)}}}function nl(P){let f,b,h,u,_;return{c(){f=n("p"),b=s("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),h=n("code"),u=s("scaled_dot_product_attention"),_=s(` (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(l){f=i(l,"P",{});var m=r(f);b=a(m,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),h=i(m,"CODE",{});var C=r(h);u=a(C,"scaled_dot_product_attention"),C.forEach(t),_=a(m,` (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!`),m.forEach(t)},m(l,m){y(l,f,m),e(f,b),e(f,h),e(h,u),e(f,_)},d(l){l&&t(f)}}}function il(P){let f,b,h,u,_;return u=new jt({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(){f=n("p"),b=s("Examples:"),h=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var m=r(f);b=a(m,"Examples:"),m.forEach(t),h=c(l),x(u.$$.fragment,l)},m(l,m){y(l,f,m),e(f,b),y(l,h,m),$(u,l,m),_=!0},p:Ut,i(l){_||(D(u.$$.fragment,l),_=!0)},o(l){T(u.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),S(u,l)}}}function sl(P){let f,b;return{c(){f=n("p"),b=s(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(h){f=i(h,"P",{});var u=r(f);b=a(u,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),u.forEach(t)},m(h,u){y(h,f,u),e(f,b)},d(h){h&&t(f)}}}function al(P){let f,b,h,u,_;return u=new jt({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(){f=n("p"),b=s("Examples:"),h=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var m=r(f);b=a(m,"Examples:"),m.forEach(t),h=c(l),x(u.$$.fragment,l)},m(l,m){y(l,f,m),e(f,b),y(l,h,m),$(u,l,m),_=!0},p:Ut,i(l){_||(D(u.$$.fragment,l),_=!0)},o(l){T(u.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),S(u,l)}}}function rl(P){let f,b,h,u,_;return u=new jt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){f=n("p"),b=s("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),h=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var m=r(f);b=a(m,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),m.forEach(t),h=c(l),x(u.$$.fragment,l)},m(l,m){y(l,f,m),e(f,b),y(l,h,m),$(u,l,m),_=!0},p:Ut,i(l){_||(D(u.$$.fragment,l),_=!0)},o(l){T(u.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),S(u,l)}}}function ll(P){let f,b,h,u,_;return u=new jt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyLiUyRmNoYXJ0dXJuZXJ2Mi5wdCUyMiUyQyUyMHRva2VuJTNEJTIyY2hhcnR1cm5lcnYyJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNoYXJ0dXJuZXJ2MiUyQyUyMG11bHRpcGxlJTIwdmlld3MlMjBvZiUyMHRoZSUyMHNhbWUlMjBjaGFyYWN0ZXIlMjBpbiUyMHRoZSUyMHNhbWUlMjBvdXRmaXQlMkMlMjBhJTIwY2hhcmFjdGVyJTIwdHVybmFyb3VuZCUyMG9mJTIwYSUyMHdvbWFuJTIwd2VhcmluZyUyMGElMjBibGFjayUyMGphY2tldCUyMGFuZCUyMHJlZCUyMHNoaXJ0JTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjBpbnRyaWNhdGUlMjBkZXRhaWxzLiUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNoYXJhY3Rlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>, token=<span class="hljs-string">&quot;charturnerv2&quot;</span>)

prompt = <span class="hljs-string">&quot;charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details.&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){f=n("p"),b=s("locally:"),h=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var m=r(f);b=a(m,"locally:"),m.forEach(t),h=c(l),x(u.$$.fragment,l)},m(l,m){y(l,f,m),e(f,b),y(l,h,m),$(u,l,m),_=!0},p:Ut,i(l){_||(D(u.$$.fragment,l),_=!0)},o(l){T(u.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),S(u,l)}}}function dl(P){let f,b,h,u,_;return u=new jt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGV2Fycmlvck1hbWE3NzclMkZPcmFuZ2VNaXhzJTJGYmxvYiUyRm1haW4lMkZNb2RlbHMlMkZBYnlzc09yYW5nZU1peCUyRkFieXNzT3JhbmdlTWl4LnNhZmV0ZW5zb3JzJTIyJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwbG9jYWwlMjBmaWxlJTBBJTIzJTIwZmlsZSUyMGlzJTIwZG93bmxvYWRlZCUyMHVuZGVyJTIwLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuY2twdCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMjIuJTJGdjEtNS1wcnVuZWQtZW1hb25seSUyMiklMEElMEElMjMlMjBFbmFibGUlMjBmbG9hdDE2JTIwYW5kJTIwbW92ZSUyMHRvJTIwR1BVJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",highlighted:`<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><span class="hljs-comment"># Download pipeline from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix.safetensors&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from local file</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># file is downloaded under ./v1-5-pruned-emaonly.ckpt</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(<span class="hljs-string">&quot;./v1-5-pruned-emaonly&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable float16 and move to GPU</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),{c(){f=n("p"),b=s("Examples:"),h=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var m=r(f);b=a(m,"Examples:"),m.forEach(t),h=c(l),x(u.$$.fragment,l)},m(l,m){y(l,f,m),e(f,b),y(l,h,m),$(u,l,m),_=!0},p:Ut,i(l){_||(D(u.$$.fragment,l),_=!0)},o(l){T(u.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),S(u,l)}}}function cl(P){let f,b,h,u,_;return u=new jt({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMGZsYXguamF4X3V0aWxzJTIwaW1wb3J0JTIwcmVwbGljYXRlJTBBZnJvbSUyMGZsYXgudHJhaW5pbmcuY29tbW9uX3V0aWxzJTIwaW1wb3J0JTIwc2hhcmQlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmxheFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4U3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwcmV2aXNpb24lM0QlMjJiZjE2JTIyJTJDJTIwZHR5cGUlM0RqYXgubnVtcHkuYmZsb2F0MTYlMEEpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMG9uJTIwbWFycyUyMiUwQSUwQXBybmdfc2VlZCUyMCUzRCUyMGpheC5yYW5kb20uUFJOR0tleSgwKSUwQW51bV9pbmZlcmVuY2Vfc3RlcHMlMjAlM0QlMjA1MCUwQSUwQW51bV9zYW1wbGVzJTIwJTNEJTIwamF4LmRldmljZV9jb3VudCgpJTBBcHJvbXB0JTIwJTNEJTIwbnVtX3NhbXBsZXMlMjAqJTIwJTVCcHJvbXB0JTVEJTBBcHJvbXB0X2lkcyUyMCUzRCUyMHBpcGVsaW5lLnByZXBhcmVfaW5wdXRzKHByb21wdCklMEElMEFwYXJhbXMlMjAlM0QlMjByZXBsaWNhdGUocGFyYW1zKSUwQXBybmdfc2VlZCUyMCUzRCUyMGpheC5yYW5kb20uc3BsaXQocHJuZ19zZWVkJTJDJTIwamF4LmRldmljZV9jb3VudCgpKSUwQXByb21wdF9pZHMlMjAlM0QlMjBzaGFyZChwcm9tcHRfaWRzKSUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGVsaW5lKHByb21wdF9pZHMlMkMlMjBwYXJhbXMlMkMlMjBwcm5nX3NlZWQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTJDJTIwaml0JTNEVHJ1ZSkuaW1hZ2VzJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZWxpbmUubnVtcHlfdG9fcGlsKG5wLmFzYXJyYXkoaW1hZ2VzLnJlc2hhcGUoKG51bV9zYW1wbGVzJTJDKSUyMCUyQiUyMGltYWdlcy5zaGFwZSU1Qi0zJTNBJTVEKSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline, params = FlaxStableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, revision=<span class="hljs-string">&quot;bf16&quot;</span>, dtype=jax.numpy.bfloat16
<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>prng_seed = jax.random.PRNGKey(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>num_inference_steps = <span class="hljs-number">50</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>num_samples = jax.device_count()
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = num_samples * [prompt]
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids = pipeline.prepare_inputs(prompt)
<span class="hljs-comment"># shard inputs and rng</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>params = replicate(params)
<span class="hljs-meta">&gt;&gt;&gt; </span>prng_seed = jax.random.split(prng_seed, jax.device_count())
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids = shard(prompt_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipeline(prompt_ids, params, prng_seed, num_inference_steps, jit=<span class="hljs-literal">True</span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipeline.numpy_to_pil(np.asarray(images.reshape((num_samples,) + images.shape[-<span class="hljs-number">3</span>:])))`}}),{c(){f=n("p"),b=s("Examples:"),h=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var m=r(f);b=a(m,"Examples:"),m.forEach(t),h=c(l),x(u.$$.fragment,l)},m(l,m){y(l,f,m),e(f,b),y(l,h,m),$(u,l,m),_=!0},p:Ut,i(l){_||(D(u.$$.fragment,l),_=!0)},o(l){T(u.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),S(u,l)}}}function fl(P){let f,b,h,u,_,l,m,C,A,fe,J,R,z,Be,Y,q,Ve,Z,I,Zt,F,K,Wt,Gt,Ct,Nn,Ln,Ae,Bn,Vn,tn,Ft,An,on,Nt,Re,Rn,ze,zn,Yn,nn,pe,sn,ie,ue,ro,Ye,qn,lo,Xn,an,w,qe,On,co,Hn,Qn,Xe,Kn,Lt,ei,ti,oi,fo,ni,ii,X,Bt,Vt,si,ai,ri,At,Rt,li,di,ci,zt,Yt,fi,pi,ui,me,qt,mi,hi,po,gi,_i,bi,ee,Oe,yi,uo,wi,vi,he,xi,N,He,$i,mo,Di,Ti,ge,Si,_e,Mi,be,Qe,Pi,Ke,Ji,ho,ki,Ei,Ii,ye,et,Ui,go,ji,Zi,we,tt,Wi,ot,Gi,_o,Ci,Fi,Ni,L,nt,Li,it,Bi,st,Vi,Ai,Ri,ve,zi,xe,Yi,$e,at,qi,rt,Xi,lt,Oi,Hi,Qi,De,dt,Ki,bo,es,ts,Te,ct,os,ft,ns,yo,is,ss,as,U,pt,rs,ut,ls,Xt,ds,cs,fs,wo,ps,us,Se,ms,mt,hs,ht,gs,_s,bs,Me,ys,te,gt,ws,W,vs,Ot,xs,$s,vo,Ds,Ts,xo,Ss,Ms,$o,Ps,Js,ks,Pe,Es,j,_t,Is,O,Us,Do,js,Zs,To,Ws,Gs,So,Cs,Fs,Ns,bt,Ls,Mo,Bs,Vs,As,yt,Rs,Ht,zs,Ys,qs,se,Xs,Qt,Os,Hs,Po,Qs,Ks,ea,ae,ta,Kt,oa,na,Jo,ia,sa,aa,Je,wt,ra,ko,la,da,ke,vt,ca,H,fa,Eo,pa,ua,Io,ma,ha,Uo,ga,_a,rn,re,Ee,jo,xt,ba,Zo,ya,ln,le,$t,wa,Wo,va,dn,de,Ie,Go,Dt,xa,Co,$a,cn,G,Tt,Da,Fo,Ta,Sa,St,Ma,eo,Pa,Ja,ka,oe,Mt,Ea,No,Ia,Ua,Ue,fn,ce,je,Lo,Pt,ja,Bo,Za,pn,Q,Jt,Wa,Vo,Ga,Ca,Ze,kt,Fa,Ao,Na,un;return l=new en({}),pe=new Aa({props:{$$slots:{default:[tl]},$$scope:{ctx:P}}}),Ye=new en({}),qe=new k({props:{name:"class diffusers.StableDiffusionPipeline",anchor:"diffusers.StableDiffusionPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L72"}}),Oe=new k({props:{name:"__call__",anchor:"diffusers.StableDiffusionPipeline.__call__",parameters:[{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 = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = 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:"guidance_rescale",val:": float = 0.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__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.StableDiffusionPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.7) &#x2014;
Guidance rescale factor from <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a>. Guidance rescale factor should fix overexposure when
using zero terminal SNR.`,name:"guidance_rescale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L522",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),he=new It({props:{anchor:"diffusers.StableDiffusionPipeline.__call__.example",$$slots:{default:[ol]},$$scope:{ctx:P}}}),He=new k({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),ge=new Aa({props:{warning:!0,$$slots:{default:[nl]},$$scope:{ctx:P}}}),_e=new It({props:{anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing.example",$$slots:{default:[il]},$$scope:{ctx:P}}}),Qe=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),et=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L196"}}),tt=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L203"}}),nt=new k({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),ve=new Aa({props:{warning:!0,$$slots:{default:[sl]},$$scope:{ctx:P}}}),xe=new It({props:{anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[al]},$$scope:{ctx:P}}}),at=new k({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),dt=new k({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L210"}}),ct=new k({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L218"}}),pt=new k({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L591"}}),Se=new It({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example",$$slots:{default:[rl]},$$scope:{ctx:P}}}),Me=new It({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example-2",$$slots:{default:[ll]},$$scope:{ctx:P}}}),gt=new k({props:{name:"from_single_file",anchor:"diffusers.StableDiffusionPipeline.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to extract the EMA weights or not. Pass <code>True</code> to extract the EMA weights which usually yield
higher quality images for inference. Non-EMA weights are usually better for continuing finetuning.`,name:"extract_ema"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type the model was trained on. Use <code>&apos;epsilon&apos;</code> for all Stable Diffusion v1 models and
the Stable Diffusion v2 base model. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of input channels. If <code>None</code>, it is automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pndm&quot;</code>) &#x2014;
Type of scheduler to use. Should be one of <code>[&quot;pndm&quot;, &quot;lms&quot;, &quot;heun&quot;, &quot;euler&quot;, &quot;euler-ancestral&quot;, &quot;dpm&quot;, &quot;ddim&quot;]</code>.`,name:"scheduler_type"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.load_safety_checker",description:`<strong>load_safety_checker</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to load the safety checker or not.`,name:"load_safety_checker"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTextModel</code> to use, specifically the
<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant. If this
parameter is <code>None</code>, the function loads a new instance of <code>CLIPTextModel</code> by itself if needed.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.vae",description:`<strong>vae</strong> (<code>AutoencoderKL</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations. If
this parameter is <code>None</code>, the function will load a new instance of [CLIP] by itself, if needed.`,name:"vae"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTokenizer</code> to use. If this parameter is <code>None</code>, the function loads a new instance
of <code>CLIPTokenizer</code> by itself if needed.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.original_config_file",description:`<strong>original_config_file</strong> (<code>str</code>) &#x2014;
Path to <code>.yaml</code> config file corresponding to the original architecture. If <code>None</code>, will be
automatically inferred by looking for a key that only exists in SD2.0 models.`,name:"original_config_file"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1727"}}),Pe=new It({props:{anchor:"diffusers.StableDiffusionPipeline.from_single_file.example",$$slots:{default:[dl]},$$scope:{ctx:P}}}),_t=new k({props:{name:"load_lora_weights",anchor:"diffusers.StableDiffusionPipeline.load_lora_weights",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
See <a href="/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
See <a href="/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L863"}}),wt=new k({props:{name:"save_lora_weights",anchor:"diffusers.StableDiffusionPipeline.save_lora_weights",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"unet_lora_layers",val:": typing.Dict[str, typing.Union[torch.nn.modules.module.Module, torch.Tensor]] = None"},{name:"text_encoder_lora_layers",val:": typing.Dict[str, torch.nn.modules.module.Module] = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.save_lora_weights.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save LoRA parameters to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.StableDiffusionPipeline.save_lora_weights.unet_lora_layers",description:`<strong>unet_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>unet</code>.`,name:"unet_lora_layers"},{anchor:"diffusers.StableDiffusionPipeline.save_lora_weights.text_encoder_lora_layers",description:`<strong>text_encoder_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder</code>. Must explicitly pass the text
encoder LoRA state dict because it comes from &#x1F917; Transformers.`,name:"text_encoder_lora_layers"},{anchor:"diffusers.StableDiffusionPipeline.save_lora_weights.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful during distributed training and you
need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on the main
process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.StableDiffusionPipeline.save_lora_weights.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful during distributed training when you need to
replace <code>torch.save</code> with another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"},{anchor:"diffusers.StableDiffusionPipeline.save_lora_weights.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way with <code>pickle</code>.`,name:"safe_serialization"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1439"}}),vt=new k({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L225"}}),xt=new en({}),$t=new k({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.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"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),Dt=new en({}),Tt=new k({props:{name:"class diffusers.FlaxStableDiffusionPipeline",anchor:"diffusers.FlaxStableDiffusionPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">FlaxCLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014;
A <code>FlaxUNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.FlaxStableDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py#L81"}}),Mt=new k({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"num_inference_steps",val:": int = 50"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"latents",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionPipeline.__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.`,name:"prompt"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__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.FlaxStableDiffusionPipeline.__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.FlaxStableDiffusionPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#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.FlaxStableDiffusionPipeline.__call__.latents",description:`<strong>latents</strong> (<code>jnp.array</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
array is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>This argument exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a
future release.</p>

					</div>`,name:"jit"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> instead of
a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py#L310",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated images
and the second element is a list of <code>bool</code>s indicating whether the corresponding generated image
contains \u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Ue=new It({props:{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.example",$$slots:{default:[cl]},$$scope:{ctx:P}}}),Pt=new en({}),Jt=new k({props:{name:"class diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",parameters:[{name:"images",val:": ndarray"},{name:"nsfw_content_detected",val:": typing.List[bool]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>np.ndarray</code>) &#x2014;
Denoised images of array shape of <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content
or <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/__init__.py#L118"}}),kt=new k({props:{name:"replace",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/flax/struct.py#L111"}}),{c(){f=n("meta"),b=d(),h=n("h1"),u=n("a"),_=n("span"),v(l.$$.fragment),m=d(),C=n("span"),A=s("Text-to-image"),fe=d(),J=n("p"),R=s("The Stable Diffusion model was created by researchers and engineers from "),z=n("a"),Be=s("CompVis"),Y=s(", "),q=n("a"),Ve=s("Stability AI"),Z=s(", "),I=n("a"),Zt=s("Runway"),F=s(", and "),K=n("a"),Wt=s("LAION"),Gt=s(". The "),Ct=n("a"),Nn=s("StableDiffusionPipeline"),Ln=s(" is capable of generating photorealistic images given any text input. It\u2019s trained on 512x512 images from a subset of the LAION-5B dataset. This model uses a frozen CLIP ViT-L/14 text encoder to condition the model on text prompts. With its 860M UNet and 123M text encoder, the model is relatively lightweight and can run on consumer GPUs. Latent diffusion is the research on top of which Stable Diffusion was built. It was proposed in "),Ae=n("a"),Bn=s("High-Resolution Image Synthesis with Latent Diffusion Models"),Vn=s(" by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),tn=d(),Ft=n("p"),An=s("The abstract from the paper is:"),on=d(),Nt=n("p"),Re=n("em"),Rn=s("By decomposing the image formation process into a sequential application of denoising autoencoders, diffusion models (DMs) achieve state-of-the-art synthesis results on image data and beyond. Additionally, their formulation allows for a guiding mechanism to control the image generation process without retraining. However, since these models typically operate directly in pixel space, optimization of powerful DMs often consumes hundreds of GPU days and inference is expensive due to sequential evaluations. To enable DM training on limited computational resources while retaining their quality and flexibility, we apply them in the latent space of powerful pretrained autoencoders. In contrast to previous work, training diffusion models on such a representation allows for the first time to reach a near-optimal point between complexity reduction and detail preservation, greatly boosting visual fidelity. By introducing cross-attention layers into the model architecture, we turn diffusion models into powerful and flexible generators for general conditioning inputs such as text or bounding boxes and high-resolution synthesis becomes possible in a convolutional manner. Our latent diffusion models (LDMs) achieve a new state of the art for image inpainting and highly competitive performance on various tasks, including unconditional image generation, semantic scene synthesis, and super-resolution, while significantly reducing computational requirements compared to pixel-based DMs. Code is available at "),ze=n("a"),zn=s("https://github.com/CompVis/latent-diffusion"),Yn=s("."),nn=d(),v(pe.$$.fragment),sn=d(),ie=n("h2"),ue=n("a"),ro=n("span"),v(Ye.$$.fragment),qn=d(),lo=n("span"),Xn=s("StableDiffusionPipeline"),an=d(),w=n("div"),v(qe.$$.fragment),On=d(),co=n("p"),Hn=s("Pipeline for text-to-image generation using Stable Diffusion."),Qn=d(),Xe=n("p"),Kn=s("This model inherits from "),Lt=n("a"),ei=s("DiffusionPipeline"),ti=s(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),oi=d(),fo=n("p"),ni=s("The pipeline also inherits the following loading methods:"),ii=d(),X=n("ul"),Bt=n("li"),Vt=n("a"),si=s("load_textual_inversion()"),ai=s(" for loading textual inversion embeddings"),ri=d(),At=n("li"),Rt=n("a"),li=s("load_lora_weights()"),di=s(" for loading LoRA weights"),ci=d(),zt=n("li"),Yt=n("a"),fi=s("save_lora_weights()"),pi=s(" for saving LoRA weights"),ui=d(),me=n("li"),qt=n("a"),mi=s("from_single_file()"),hi=s(" for loading "),po=n("code"),gi=s(".ckpt"),_i=s(" files"),bi=d(),ee=n("div"),v(Oe.$$.fragment),yi=d(),uo=n("p"),wi=s("The call function to the pipeline for generation."),vi=d(),v(he.$$.fragment),xi=d(),N=n("div"),v(He.$$.fragment),$i=d(),mo=n("p"),Di=s(`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.`),Ti=d(),v(ge.$$.fragment),Si=d(),v(_e.$$.fragment),Mi=d(),be=n("div"),v(Qe.$$.fragment),Pi=d(),Ke=n("p"),Ji=s("Disable sliced attention computation. If "),ho=n("code"),ki=s("enable_attention_slicing"),Ei=s(` was previously called, attention is
computed in one step.`),Ii=d(),ye=n("div"),v(et.$$.fragment),Ui=d(),go=n("p"),ji=s(`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.`),Zi=d(),we=n("div"),v(tt.$$.fragment),Wi=d(),ot=n("p"),Gi=s("Disable sliced VAE decoding. If "),_o=n("code"),Ci=s("enable_vae_slicing"),Fi=s(` was previously enabled, this method will go back to
computing decoding in one step.`),Ni=d(),L=n("div"),v(nt.$$.fragment),Li=d(),it=n("p"),Bi=s("Enable memory efficient attention from "),st=n("a"),Vi=s("xFormers"),Ai=s(`. 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.`),Ri=d(),v(ve.$$.fragment),zi=d(),v(xe.$$.fragment),Yi=d(),$e=n("div"),v(at.$$.fragment),qi=d(),rt=n("p"),Xi=s("Disable memory efficient attention from "),lt=n("a"),Oi=s("xFormers"),Hi=s("."),Qi=d(),De=n("div"),v(dt.$$.fragment),Ki=d(),bo=n("p"),es=s(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),ts=d(),Te=n("div"),v(ct.$$.fragment),os=d(),ft=n("p"),ns=s("Disable tiled VAE decoding. If "),yo=n("code"),is=s("enable_vae_tiling"),ss=s(` was previously enabled, this method will go back to
computing decoding in one step.`),as=d(),U=n("div"),v(pt.$$.fragment),rs=d(),ut=n("p"),ls=s("Load textual inversion embeddings into the text encoder of "),Xt=n("a"),ds=s("StableDiffusionPipeline"),cs=s(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),fs=d(),wo=n("p"),ps=s("Example:"),us=d(),v(Se.$$.fragment),ms=d(),mt=n("p"),hs=s(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),ht=n("a"),gs=s("civitAI"),_s=s(") and then load the vector"),bs=d(),v(Me.$$.fragment),ys=d(),te=n("div"),v(gt.$$.fragment),ws=d(),W=n("p"),vs=s("Instantiate a "),Ot=n("a"),xs=s("DiffusionPipeline"),$s=s(" from pretrained pipeline weights saved in the "),vo=n("code"),Ds=s(".ckpt"),Ts=s(" or "),xo=n("code"),Ss=s(".safetensors"),Ms=s(`
format. The pipeline is set in evaluation mode (`),$o=n("code"),Ps=s("model.eval()"),Js=s(") by default."),ks=d(),v(Pe.$$.fragment),Es=d(),j=n("div"),v(_t.$$.fragment),Is=d(),O=n("p"),Us=s("Load LoRA weights specified in "),Do=n("code"),js=s("pretrained_model_name_or_path_or_dict"),Zs=s(" into "),To=n("code"),Ws=s("self.unet"),Gs=s(` and
`),So=n("code"),Cs=s("self.text_encoder"),Fs=s("."),Ns=d(),bt=n("p"),Ls=s("All kwargs are forwarded to "),Mo=n("code"),Bs=s("self.lora_state_dict"),Vs=s("."),As=d(),yt=n("p"),Rs=s("See "),Ht=n("a"),zs=s("lora_state_dict()"),Ys=s(" for more details on how the state dict is loaded."),qs=d(),se=n("p"),Xs=s("See "),Qt=n("a"),Os=s("load_lora_into_unet()"),Hs=s(` for more details on how the state dict is loaded into
`),Po=n("code"),Qs=s("self.unet"),Ks=s("."),ea=d(),ae=n("p"),ta=s("See "),Kt=n("a"),oa=s("load_lora_into_text_encoder()"),na=s(` for more details on how the state dict is loaded
into `),Jo=n("code"),ia=s("self.text_encoder"),sa=s("."),aa=d(),Je=n("div"),v(wt.$$.fragment),ra=d(),ko=n("p"),la=s("Save the LoRA parameters corresponding to the UNet and text encoder."),da=d(),ke=n("div"),v(vt.$$.fragment),ca=d(),H=n("p"),fa=s(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Eo=n("code"),pa=s("forward"),ua=s(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Io=n("code"),ma=s("enable_sequential_cpu_offload"),ha=s(`, but performance is much better due to the
iterative execution of the `),Uo=n("code"),ga=s("unet"),_a=s("."),rn=d(),re=n("h2"),Ee=n("a"),jo=n("span"),v(xt.$$.fragment),ba=d(),Zo=n("span"),ya=s("StableDiffusionPipelineOutput"),ln=d(),le=n("div"),v($t.$$.fragment),wa=d(),Wo=n("p"),va=s("Output class for Stable Diffusion pipelines."),dn=d(),de=n("h2"),Ie=n("a"),Go=n("span"),v(Dt.$$.fragment),xa=d(),Co=n("span"),$a=s("FlaxStableDiffusionPipeline"),cn=d(),G=n("div"),v(Tt.$$.fragment),Da=d(),Fo=n("p"),Ta=s("Flax-based pipeline for text-to-image generation using Stable Diffusion."),Sa=d(),St=n("p"),Ma=s("This model inherits from "),eo=n("a"),Pa=s("FlaxDiffusionPipeline"),Ja=s(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ka=d(),oe=n("div"),v(Mt.$$.fragment),Ea=d(),No=n("p"),Ia=s("The call function to the pipeline for generation."),Ua=d(),v(Ue.$$.fragment),fn=d(),ce=n("h2"),je=n("a"),Lo=n("span"),v(Pt.$$.fragment),ja=d(),Bo=n("span"),Za=s("FlaxStableDiffusionPipelineOutput"),pn=d(),Q=n("div"),v(Jt.$$.fragment),Wa=d(),Vo=n("p"),Ga=s("Output class for Flax-based Stable Diffusion pipelines."),Ca=d(),Ze=n("div"),v(kt.$$.fragment),Fa=d(),Ao=n("p"),Na=s("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(o){const g=Kr('[data-svelte="svelte-1phssyn"]',document.head);f=i(g,"META",{name:!0,content:!0}),g.forEach(t),b=c(o),h=i(o,"H1",{class:!0});var Et=r(h);u=i(Et,"A",{id:!0,class:!0,href:!0});var Ro=r(u);_=i(Ro,"SPAN",{});var zo=r(_);x(l.$$.fragment,zo),zo.forEach(t),Ro.forEach(t),m=c(Et),C=i(Et,"SPAN",{});var Yo=r(C);A=a(Yo,"Text-to-image"),Yo.forEach(t),Et.forEach(t),fe=c(o),J=i(o,"P",{});var E=r(J);R=a(E,"The Stable Diffusion model was created by researchers and engineers from "),z=i(E,"A",{href:!0,rel:!0});var qo=r(z);Be=a(qo,"CompVis"),qo.forEach(t),Y=a(E,", "),q=i(E,"A",{href:!0,rel:!0});var Xo=r(q);Ve=a(Xo,"Stability AI"),Xo.forEach(t),Z=a(E,", "),I=i(E,"A",{href:!0,rel:!0});var Oo=r(I);Zt=a(Oo,"Runway"),Oo.forEach(t),F=a(E,", and "),K=i(E,"A",{href:!0,rel:!0});var Ho=r(K);Wt=a(Ho,"LAION"),Ho.forEach(t),Gt=a(E,". The "),Ct=i(E,"A",{href:!0});var Qo=r(Ct);Nn=a(Qo,"StableDiffusionPipeline"),Qo.forEach(t),Ln=a(E," is capable of generating photorealistic images given any text input. It\u2019s trained on 512x512 images from a subset of the LAION-5B dataset. This model uses a frozen CLIP ViT-L/14 text encoder to condition the model on text prompts. With its 860M UNet and 123M text encoder, the model is relatively lightweight and can run on consumer GPUs. Latent diffusion is the research on top of which Stable Diffusion was built. It was proposed in "),Ae=i(E,"A",{href:!0,rel:!0});var Ra=r(Ae);Bn=a(Ra,"High-Resolution Image Synthesis with Latent Diffusion Models"),Ra.forEach(t),Vn=a(E," by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),E.forEach(t),tn=c(o),Ft=i(o,"P",{});var za=r(Ft);An=a(za,"The abstract from the paper is:"),za.forEach(t),on=c(o),Nt=i(o,"P",{});var Ya=r(Nt);Re=i(Ya,"EM",{});var mn=r(Re);Rn=a(mn,"By decomposing the image formation process into a sequential application of denoising autoencoders, diffusion models (DMs) achieve state-of-the-art synthesis results on image data and beyond. Additionally, their formulation allows for a guiding mechanism to control the image generation process without retraining. However, since these models typically operate directly in pixel space, optimization of powerful DMs often consumes hundreds of GPU days and inference is expensive due to sequential evaluations. To enable DM training on limited computational resources while retaining their quality and flexibility, we apply them in the latent space of powerful pretrained autoencoders. In contrast to previous work, training diffusion models on such a representation allows for the first time to reach a near-optimal point between complexity reduction and detail preservation, greatly boosting visual fidelity. By introducing cross-attention layers into the model architecture, we turn diffusion models into powerful and flexible generators for general conditioning inputs such as text or bounding boxes and high-resolution synthesis becomes possible in a convolutional manner. Our latent diffusion models (LDMs) achieve a new state of the art for image inpainting and highly competitive performance on various tasks, including unconditional image generation, semantic scene synthesis, and super-resolution, while significantly reducing computational requirements compared to pixel-based DMs. Code is available at "),ze=i(mn,"A",{href:!0,rel:!0});var qa=r(ze);zn=a(qa,"https://github.com/CompVis/latent-diffusion"),qa.forEach(t),Yn=a(mn,"."),mn.forEach(t),Ya.forEach(t),nn=c(o),x(pe.$$.fragment,o),sn=c(o),ie=i(o,"H2",{class:!0});var hn=r(ie);ue=i(hn,"A",{id:!0,class:!0,href:!0});var Xa=r(ue);ro=i(Xa,"SPAN",{});var Oa=r(ro);x(Ye.$$.fragment,Oa),Oa.forEach(t),Xa.forEach(t),qn=c(hn),lo=i(hn,"SPAN",{});var Ha=r(lo);Xn=a(Ha,"StableDiffusionPipeline"),Ha.forEach(t),hn.forEach(t),an=c(o),w=i(o,"DIV",{class:!0});var M=r(w);x(qe.$$.fragment,M),On=c(M),co=i(M,"P",{});var Qa=r(co);Hn=a(Qa,"Pipeline for text-to-image generation using Stable Diffusion."),Qa.forEach(t),Qn=c(M),Xe=i(M,"P",{});var gn=r(Xe);Kn=a(gn,"This model inherits from "),Lt=i(gn,"A",{href:!0});var Ka=r(Lt);ei=a(Ka,"DiffusionPipeline"),Ka.forEach(t),ti=a(gn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),gn.forEach(t),oi=c(M),fo=i(M,"P",{});var er=r(fo);ni=a(er,"The pipeline also inherits the following loading methods:"),er.forEach(t),ii=c(M),X=i(M,"UL",{});var We=r(X);Bt=i(We,"LI",{});var La=r(Bt);Vt=i(La,"A",{href:!0});var tr=r(Vt);si=a(tr,"load_textual_inversion()"),tr.forEach(t),ai=a(La," for loading textual inversion embeddings"),La.forEach(t),ri=c(We),At=i(We,"LI",{});var Ba=r(At);Rt=i(Ba,"A",{href:!0});var or=r(Rt);li=a(or,"load_lora_weights()"),or.forEach(t),di=a(Ba," for loading LoRA weights"),Ba.forEach(t),ci=c(We),zt=i(We,"LI",{});var Va=r(zt);Yt=i(Va,"A",{href:!0});var nr=r(Yt);fi=a(nr,"save_lora_weights()"),nr.forEach(t),pi=a(Va," for saving LoRA weights"),Va.forEach(t),ui=c(We),me=i(We,"LI",{});var Ko=r(me);qt=i(Ko,"A",{href:!0});var ir=r(qt);mi=a(ir,"from_single_file()"),ir.forEach(t),hi=a(Ko," for loading "),po=i(Ko,"CODE",{});var sr=r(po);gi=a(sr,".ckpt"),sr.forEach(t),_i=a(Ko," files"),Ko.forEach(t),We.forEach(t),bi=c(M),ee=i(M,"DIV",{class:!0});var to=r(ee);x(Oe.$$.fragment,to),yi=c(to),uo=i(to,"P",{});var ar=r(uo);wi=a(ar,"The call function to the pipeline for generation."),ar.forEach(t),vi=c(to),x(he.$$.fragment,to),to.forEach(t),xi=c(M),N=i(M,"DIV",{class:!0});var Ge=r(N);x(He.$$.fragment,Ge),$i=c(Ge),mo=i(Ge,"P",{});var rr=r(mo);Di=a(rr,`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.`),rr.forEach(t),Ti=c(Ge),x(ge.$$.fragment,Ge),Si=c(Ge),x(_e.$$.fragment,Ge),Ge.forEach(t),Mi=c(M),be=i(M,"DIV",{class:!0});var _n=r(be);x(Qe.$$.fragment,_n),Pi=c(_n),Ke=i(_n,"P",{});var bn=r(Ke);Ji=a(bn,"Disable sliced attention computation. If "),ho=i(bn,"CODE",{});var lr=r(ho);ki=a(lr,"enable_attention_slicing"),lr.forEach(t),Ei=a(bn,` was previously called, attention is
computed in one step.`),bn.forEach(t),_n.forEach(t),Ii=c(M),ye=i(M,"DIV",{class:!0});var yn=r(ye);x(et.$$.fragment,yn),Ui=c(yn),go=i(yn,"P",{});var dr=r(go);ji=a(dr,`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.`),dr.forEach(t),yn.forEach(t),Zi=c(M),we=i(M,"DIV",{class:!0});var wn=r(we);x(tt.$$.fragment,wn),Wi=c(wn),ot=i(wn,"P",{});var vn=r(ot);Gi=a(vn,"Disable sliced VAE decoding. If "),_o=i(vn,"CODE",{});var cr=r(_o);Ci=a(cr,"enable_vae_slicing"),cr.forEach(t),Fi=a(vn,` was previously enabled, this method will go back to
computing decoding in one step.`),vn.forEach(t),wn.forEach(t),Ni=c(M),L=i(M,"DIV",{class:!0});var Ce=r(L);x(nt.$$.fragment,Ce),Li=c(Ce),it=i(Ce,"P",{});var xn=r(it);Bi=a(xn,"Enable memory efficient attention from "),st=i(xn,"A",{href:!0,rel:!0});var fr=r(st);Vi=a(fr,"xFormers"),fr.forEach(t),Ai=a(xn,`. 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.`),xn.forEach(t),Ri=c(Ce),x(ve.$$.fragment,Ce),zi=c(Ce),x(xe.$$.fragment,Ce),Ce.forEach(t),Yi=c(M),$e=i(M,"DIV",{class:!0});var $n=r($e);x(at.$$.fragment,$n),qi=c($n),rt=i($n,"P",{});var Dn=r(rt);Xi=a(Dn,"Disable memory efficient attention from "),lt=i(Dn,"A",{href:!0,rel:!0});var pr=r(lt);Oi=a(pr,"xFormers"),pr.forEach(t),Hi=a(Dn,"."),Dn.forEach(t),$n.forEach(t),Qi=c(M),De=i(M,"DIV",{class:!0});var Tn=r(De);x(dt.$$.fragment,Tn),Ki=c(Tn),bo=i(Tn,"P",{});var ur=r(bo);es=a(ur,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),ur.forEach(t),Tn.forEach(t),ts=c(M),Te=i(M,"DIV",{class:!0});var Sn=r(Te);x(ct.$$.fragment,Sn),os=c(Sn),ft=i(Sn,"P",{});var Mn=r(ft);ns=a(Mn,"Disable tiled VAE decoding. If "),yo=i(Mn,"CODE",{});var mr=r(yo);is=a(mr,"enable_vae_tiling"),mr.forEach(t),ss=a(Mn,` was previously enabled, this method will go back to
computing decoding in one step.`),Mn.forEach(t),Sn.forEach(t),as=c(M),U=i(M,"DIV",{class:!0});var B=r(U);x(pt.$$.fragment,B),rs=c(B),ut=i(B,"P",{});var Pn=r(ut);ls=a(Pn,"Load textual inversion embeddings into the text encoder of "),Xt=i(Pn,"A",{href:!0});var hr=r(Xt);ds=a(hr,"StableDiffusionPipeline"),hr.forEach(t),cs=a(Pn,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Pn.forEach(t),fs=c(B),wo=i(B,"P",{});var gr=r(wo);ps=a(gr,"Example:"),gr.forEach(t),us=c(B),x(Se.$$.fragment,B),ms=c(B),mt=i(B,"P",{});var Jn=r(mt);hs=a(Jn,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),ht=i(Jn,"A",{href:!0,rel:!0});var _r=r(ht);gs=a(_r,"civitAI"),_r.forEach(t),_s=a(Jn,") and then load the vector"),Jn.forEach(t),bs=c(B),x(Me.$$.fragment,B),B.forEach(t),ys=c(M),te=i(M,"DIV",{class:!0});var oo=r(te);x(gt.$$.fragment,oo),ws=c(oo),W=i(oo,"P",{});var ne=r(W);vs=a(ne,"Instantiate a "),Ot=i(ne,"A",{href:!0});var br=r(Ot);xs=a(br,"DiffusionPipeline"),br.forEach(t),$s=a(ne," from pretrained pipeline weights saved in the "),vo=i(ne,"CODE",{});var yr=r(vo);Ds=a(yr,".ckpt"),yr.forEach(t),Ts=a(ne," or "),xo=i(ne,"CODE",{});var wr=r(xo);Ss=a(wr,".safetensors"),wr.forEach(t),Ms=a(ne,`
format. The pipeline is set in evaluation mode (`),$o=i(ne,"CODE",{});var vr=r($o);Ps=a(vr,"model.eval()"),vr.forEach(t),Js=a(ne,") by default."),ne.forEach(t),ks=c(oo),x(Pe.$$.fragment,oo),oo.forEach(t),Es=c(M),j=i(M,"DIV",{class:!0});var V=r(j);x(_t.$$.fragment,V),Is=c(V),O=i(V,"P",{});var Fe=r(O);Us=a(Fe,"Load LoRA weights specified in "),Do=i(Fe,"CODE",{});var xr=r(Do);js=a(xr,"pretrained_model_name_or_path_or_dict"),xr.forEach(t),Zs=a(Fe," into "),To=i(Fe,"CODE",{});var $r=r(To);Ws=a($r,"self.unet"),$r.forEach(t),Gs=a(Fe,` and
`),So=i(Fe,"CODE",{});var Dr=r(So);Cs=a(Dr,"self.text_encoder"),Dr.forEach(t),Fs=a(Fe,"."),Fe.forEach(t),Ns=c(V),bt=i(V,"P",{});var kn=r(bt);Ls=a(kn,"All kwargs are forwarded to "),Mo=i(kn,"CODE",{});var Tr=r(Mo);Bs=a(Tr,"self.lora_state_dict"),Tr.forEach(t),Vs=a(kn,"."),kn.forEach(t),As=c(V),yt=i(V,"P",{});var En=r(yt);Rs=a(En,"See "),Ht=i(En,"A",{href:!0});var Sr=r(Ht);zs=a(Sr,"lora_state_dict()"),Sr.forEach(t),Ys=a(En," for more details on how the state dict is loaded."),En.forEach(t),qs=c(V),se=i(V,"P",{});var no=r(se);Xs=a(no,"See "),Qt=i(no,"A",{href:!0});var Mr=r(Qt);Os=a(Mr,"load_lora_into_unet()"),Mr.forEach(t),Hs=a(no,` for more details on how the state dict is loaded into
`),Po=i(no,"CODE",{});var Pr=r(Po);Qs=a(Pr,"self.unet"),Pr.forEach(t),Ks=a(no,"."),no.forEach(t),ea=c(V),ae=i(V,"P",{});var io=r(ae);ta=a(io,"See "),Kt=i(io,"A",{href:!0});var Jr=r(Kt);oa=a(Jr,"load_lora_into_text_encoder()"),Jr.forEach(t),na=a(io,` for more details on how the state dict is loaded
into `),Jo=i(io,"CODE",{});var kr=r(Jo);ia=a(kr,"self.text_encoder"),kr.forEach(t),sa=a(io,"."),io.forEach(t),V.forEach(t),aa=c(M),Je=i(M,"DIV",{class:!0});var In=r(Je);x(wt.$$.fragment,In),ra=c(In),ko=i(In,"P",{});var Er=r(ko);la=a(Er,"Save the LoRA parameters corresponding to the UNet and text encoder."),Er.forEach(t),In.forEach(t),da=c(M),ke=i(M,"DIV",{class:!0});var Un=r(ke);x(vt.$$.fragment,Un),ca=c(Un),H=i(Un,"P",{});var Ne=r(H);fa=a(Ne,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Eo=i(Ne,"CODE",{});var Ir=r(Eo);pa=a(Ir,"forward"),Ir.forEach(t),ua=a(Ne,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Io=i(Ne,"CODE",{});var Ur=r(Io);ma=a(Ur,"enable_sequential_cpu_offload"),Ur.forEach(t),ha=a(Ne,`, but performance is much better due to the
iterative execution of the `),Uo=i(Ne,"CODE",{});var jr=r(Uo);ga=a(jr,"unet"),jr.forEach(t),_a=a(Ne,"."),Ne.forEach(t),Un.forEach(t),M.forEach(t),rn=c(o),re=i(o,"H2",{class:!0});var jn=r(re);Ee=i(jn,"A",{id:!0,class:!0,href:!0});var Zr=r(Ee);jo=i(Zr,"SPAN",{});var Wr=r(jo);x(xt.$$.fragment,Wr),Wr.forEach(t),Zr.forEach(t),ba=c(jn),Zo=i(jn,"SPAN",{});var Gr=r(Zo);ya=a(Gr,"StableDiffusionPipelineOutput"),Gr.forEach(t),jn.forEach(t),ln=c(o),le=i(o,"DIV",{class:!0});var Zn=r(le);x($t.$$.fragment,Zn),wa=c(Zn),Wo=i(Zn,"P",{});var Cr=r(Wo);va=a(Cr,"Output class for Stable Diffusion pipelines."),Cr.forEach(t),Zn.forEach(t),dn=c(o),de=i(o,"H2",{class:!0});var Wn=r(de);Ie=i(Wn,"A",{id:!0,class:!0,href:!0});var Fr=r(Ie);Go=i(Fr,"SPAN",{});var Nr=r(Go);x(Dt.$$.fragment,Nr),Nr.forEach(t),Fr.forEach(t),xa=c(Wn),Co=i(Wn,"SPAN",{});var Lr=r(Co);$a=a(Lr,"FlaxStableDiffusionPipeline"),Lr.forEach(t),Wn.forEach(t),cn=c(o),G=i(o,"DIV",{class:!0});var Le=r(G);x(Tt.$$.fragment,Le),Da=c(Le),Fo=i(Le,"P",{});var Br=r(Fo);Ta=a(Br,"Flax-based pipeline for text-to-image generation using Stable Diffusion."),Br.forEach(t),Sa=c(Le),St=i(Le,"P",{});var Gn=r(St);Ma=a(Gn,"This model inherits from "),eo=i(Gn,"A",{href:!0});var Vr=r(eo);Pa=a(Vr,"FlaxDiffusionPipeline"),Vr.forEach(t),Ja=a(Gn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Gn.forEach(t),ka=c(Le),oe=i(Le,"DIV",{class:!0});var so=r(oe);x(Mt.$$.fragment,so),Ea=c(so),No=i(so,"P",{});var Ar=r(No);Ia=a(Ar,"The call function to the pipeline for generation."),Ar.forEach(t),Ua=c(so),x(Ue.$$.fragment,so),so.forEach(t),Le.forEach(t),fn=c(o),ce=i(o,"H2",{class:!0});var Cn=r(ce);je=i(Cn,"A",{id:!0,class:!0,href:!0});var Rr=r(je);Lo=i(Rr,"SPAN",{});var zr=r(Lo);x(Pt.$$.fragment,zr),zr.forEach(t),Rr.forEach(t),ja=c(Cn),Bo=i(Cn,"SPAN",{});var Yr=r(Bo);Za=a(Yr,"FlaxStableDiffusionPipelineOutput"),Yr.forEach(t),Cn.forEach(t),pn=c(o),Q=i(o,"DIV",{class:!0});var ao=r(Q);x(Jt.$$.fragment,ao),Wa=c(ao),Vo=i(ao,"P",{});var qr=r(Vo);Ga=a(qr,"Output class for Flax-based Stable Diffusion pipelines."),qr.forEach(t),Ca=c(ao),Ze=i(ao,"DIV",{class:!0});var Fn=r(Ze);x(kt.$$.fragment,Fn),Fa=c(Fn),Ao=i(Fn,"P",{});var Xr=r(Ao);Na=a(Xr,"\u201CReturns a new object replacing the specified fields with new values."),Xr.forEach(t),Fn.forEach(t),ao.forEach(t),this.h()},h(){p(f,"name","hf:doc:metadata"),p(f,"content",JSON.stringify(pl)),p(u,"id","texttoimage"),p(u,"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"),p(u,"href","#texttoimage"),p(h,"class","relative group"),p(z,"href","https://github.com/CompVis"),p(z,"rel","nofollow"),p(q,"href","https://stability.ai/"),p(q,"rel","nofollow"),p(I,"href","https://github.com/runwayml"),p(I,"rel","nofollow"),p(K,"href","https://laion.ai/"),p(K,"rel","nofollow"),p(Ct,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),p(Ae,"href","https://huggingface.co/papers/2112.10752"),p(Ae,"rel","nofollow"),p(ze,"href","https://github.com/CompVis/latent-diffusion"),p(ze,"rel","nofollow"),p(ue,"id","diffusers.StableDiffusionPipeline"),p(ue,"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"),p(ue,"href","#diffusers.StableDiffusionPipeline"),p(ie,"class","relative group"),p(Lt,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Vt,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),p(Rt,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),p(Yt,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),p(qt,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),p(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(st,"href","https://facebookresearch.github.io/xformers/"),p(st,"rel","nofollow"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(lt,"href","https://facebookresearch.github.io/xformers/"),p(lt,"rel","nofollow"),p($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Xt,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),p(ht,"href","https://civitai.com/models/3036?modelVersionId=9857"),p(ht,"rel","nofollow"),p(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ot,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ht,"href","/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),p(Qt,"href","/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),p(Kt,"href","/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder"),p(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ee,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(Ee,"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"),p(Ee,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(re,"class","relative group"),p(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ie,"id","diffusers.FlaxStableDiffusionPipeline"),p(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"),p(Ie,"href","#diffusers.FlaxStableDiffusionPipeline"),p(de,"class","relative group"),p(eo,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),p(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(je,"id","diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),p(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(je,"href","#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),p(ce,"class","relative group"),p(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,f),y(o,b,g),y(o,h,g),e(h,u),e(u,_),$(l,_,null),e(h,m),e(h,C),e(C,A),y(o,fe,g),y(o,J,g),e(J,R),e(J,z),e(z,Be),e(J,Y),e(J,q),e(q,Ve),e(J,Z),e(J,I),e(I,Zt),e(J,F),e(J,K),e(K,Wt),e(J,Gt),e(J,Ct),e(Ct,Nn),e(J,Ln),e(J,Ae),e(Ae,Bn),e(J,Vn),y(o,tn,g),y(o,Ft,g),e(Ft,An),y(o,on,g),y(o,Nt,g),e(Nt,Re),e(Re,Rn),e(Re,ze),e(ze,zn),e(Re,Yn),y(o,nn,g),$(pe,o,g),y(o,sn,g),y(o,ie,g),e(ie,ue),e(ue,ro),$(Ye,ro,null),e(ie,qn),e(ie,lo),e(lo,Xn),y(o,an,g),y(o,w,g),$(qe,w,null),e(w,On),e(w,co),e(co,Hn),e(w,Qn),e(w,Xe),e(Xe,Kn),e(Xe,Lt),e(Lt,ei),e(Xe,ti),e(w,oi),e(w,fo),e(fo,ni),e(w,ii),e(w,X),e(X,Bt),e(Bt,Vt),e(Vt,si),e(Bt,ai),e(X,ri),e(X,At),e(At,Rt),e(Rt,li),e(At,di),e(X,ci),e(X,zt),e(zt,Yt),e(Yt,fi),e(zt,pi),e(X,ui),e(X,me),e(me,qt),e(qt,mi),e(me,hi),e(me,po),e(po,gi),e(me,_i),e(w,bi),e(w,ee),$(Oe,ee,null),e(ee,yi),e(ee,uo),e(uo,wi),e(ee,vi),$(he,ee,null),e(w,xi),e(w,N),$(He,N,null),e(N,$i),e(N,mo),e(mo,Di),e(N,Ti),$(ge,N,null),e(N,Si),$(_e,N,null),e(w,Mi),e(w,be),$(Qe,be,null),e(be,Pi),e(be,Ke),e(Ke,Ji),e(Ke,ho),e(ho,ki),e(Ke,Ei),e(w,Ii),e(w,ye),$(et,ye,null),e(ye,Ui),e(ye,go),e(go,ji),e(w,Zi),e(w,we),$(tt,we,null),e(we,Wi),e(we,ot),e(ot,Gi),e(ot,_o),e(_o,Ci),e(ot,Fi),e(w,Ni),e(w,L),$(nt,L,null),e(L,Li),e(L,it),e(it,Bi),e(it,st),e(st,Vi),e(it,Ai),e(L,Ri),$(ve,L,null),e(L,zi),$(xe,L,null),e(w,Yi),e(w,$e),$(at,$e,null),e($e,qi),e($e,rt),e(rt,Xi),e(rt,lt),e(lt,Oi),e(rt,Hi),e(w,Qi),e(w,De),$(dt,De,null),e(De,Ki),e(De,bo),e(bo,es),e(w,ts),e(w,Te),$(ct,Te,null),e(Te,os),e(Te,ft),e(ft,ns),e(ft,yo),e(yo,is),e(ft,ss),e(w,as),e(w,U),$(pt,U,null),e(U,rs),e(U,ut),e(ut,ls),e(ut,Xt),e(Xt,ds),e(ut,cs),e(U,fs),e(U,wo),e(wo,ps),e(U,us),$(Se,U,null),e(U,ms),e(U,mt),e(mt,hs),e(mt,ht),e(ht,gs),e(mt,_s),e(U,bs),$(Me,U,null),e(w,ys),e(w,te),$(gt,te,null),e(te,ws),e(te,W),e(W,vs),e(W,Ot),e(Ot,xs),e(W,$s),e(W,vo),e(vo,Ds),e(W,Ts),e(W,xo),e(xo,Ss),e(W,Ms),e(W,$o),e($o,Ps),e(W,Js),e(te,ks),$(Pe,te,null),e(w,Es),e(w,j),$(_t,j,null),e(j,Is),e(j,O),e(O,Us),e(O,Do),e(Do,js),e(O,Zs),e(O,To),e(To,Ws),e(O,Gs),e(O,So),e(So,Cs),e(O,Fs),e(j,Ns),e(j,bt),e(bt,Ls),e(bt,Mo),e(Mo,Bs),e(bt,Vs),e(j,As),e(j,yt),e(yt,Rs),e(yt,Ht),e(Ht,zs),e(yt,Ys),e(j,qs),e(j,se),e(se,Xs),e(se,Qt),e(Qt,Os),e(se,Hs),e(se,Po),e(Po,Qs),e(se,Ks),e(j,ea),e(j,ae),e(ae,ta),e(ae,Kt),e(Kt,oa),e(ae,na),e(ae,Jo),e(Jo,ia),e(ae,sa),e(w,aa),e(w,Je),$(wt,Je,null),e(Je,ra),e(Je,ko),e(ko,la),e(w,da),e(w,ke),$(vt,ke,null),e(ke,ca),e(ke,H),e(H,fa),e(H,Eo),e(Eo,pa),e(H,ua),e(H,Io),e(Io,ma),e(H,ha),e(H,Uo),e(Uo,ga),e(H,_a),y(o,rn,g),y(o,re,g),e(re,Ee),e(Ee,jo),$(xt,jo,null),e(re,ba),e(re,Zo),e(Zo,ya),y(o,ln,g),y(o,le,g),$($t,le,null),e(le,wa),e(le,Wo),e(Wo,va),y(o,dn,g),y(o,de,g),e(de,Ie),e(Ie,Go),$(Dt,Go,null),e(de,xa),e(de,Co),e(Co,$a),y(o,cn,g),y(o,G,g),$(Tt,G,null),e(G,Da),e(G,Fo),e(Fo,Ta),e(G,Sa),e(G,St),e(St,Ma),e(St,eo),e(eo,Pa),e(St,Ja),e(G,ka),e(G,oe),$(Mt,oe,null),e(oe,Ea),e(oe,No),e(No,Ia),e(oe,Ua),$(Ue,oe,null),y(o,fn,g),y(o,ce,g),e(ce,je),e(je,Lo),$(Pt,Lo,null),e(ce,ja),e(ce,Bo),e(Bo,Za),y(o,pn,g),y(o,Q,g),$(Jt,Q,null),e(Q,Wa),e(Q,Vo),e(Vo,Ga),e(Q,Ca),e(Q,Ze),$(kt,Ze,null),e(Ze,Fa),e(Ze,Ao),e(Ao,Na),un=!0},p(o,[g]){const Et={};g&2&&(Et.$$scope={dirty:g,ctx:o}),pe.$set(Et);const Ro={};g&2&&(Ro.$$scope={dirty:g,ctx:o}),he.$set(Ro);const zo={};g&2&&(zo.$$scope={dirty:g,ctx:o}),ge.$set(zo);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:o}),_e.$set(Yo);const E={};g&2&&(E.$$scope={dirty:g,ctx:o}),ve.$set(E);const qo={};g&2&&(qo.$$scope={dirty:g,ctx:o}),xe.$set(qo);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:o}),Se.$set(Xo);const Oo={};g&2&&(Oo.$$scope={dirty:g,ctx:o}),Me.$set(Oo);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:o}),Pe.$set(Ho);const Qo={};g&2&&(Qo.$$scope={dirty:g,ctx:o}),Ue.$set(Qo)},i(o){un||(D(l.$$.fragment,o),D(pe.$$.fragment,o),D(Ye.$$.fragment,o),D(qe.$$.fragment,o),D(Oe.$$.fragment,o),D(he.$$.fragment,o),D(He.$$.fragment,o),D(ge.$$.fragment,o),D(_e.$$.fragment,o),D(Qe.$$.fragment,o),D(et.$$.fragment,o),D(tt.$$.fragment,o),D(nt.$$.fragment,o),D(ve.$$.fragment,o),D(xe.$$.fragment,o),D(at.$$.fragment,o),D(dt.$$.fragment,o),D(ct.$$.fragment,o),D(pt.$$.fragment,o),D(Se.$$.fragment,o),D(Me.$$.fragment,o),D(gt.$$.fragment,o),D(Pe.$$.fragment,o),D(_t.$$.fragment,o),D(wt.$$.fragment,o),D(vt.$$.fragment,o),D(xt.$$.fragment,o),D($t.$$.fragment,o),D(Dt.$$.fragment,o),D(Tt.$$.fragment,o),D(Mt.$$.fragment,o),D(Ue.$$.fragment,o),D(Pt.$$.fragment,o),D(Jt.$$.fragment,o),D(kt.$$.fragment,o),un=!0)},o(o){T(l.$$.fragment,o),T(pe.$$.fragment,o),T(Ye.$$.fragment,o),T(qe.$$.fragment,o),T(Oe.$$.fragment,o),T(he.$$.fragment,o),T(He.$$.fragment,o),T(ge.$$.fragment,o),T(_e.$$.fragment,o),T(Qe.$$.fragment,o),T(et.$$.fragment,o),T(tt.$$.fragment,o),T(nt.$$.fragment,o),T(ve.$$.fragment,o),T(xe.$$.fragment,o),T(at.$$.fragment,o),T(dt.$$.fragment,o),T(ct.$$.fragment,o),T(pt.$$.fragment,o),T(Se.$$.fragment,o),T(Me.$$.fragment,o),T(gt.$$.fragment,o),T(Pe.$$.fragment,o),T(_t.$$.fragment,o),T(wt.$$.fragment,o),T(vt.$$.fragment,o),T(xt.$$.fragment,o),T($t.$$.fragment,o),T(Dt.$$.fragment,o),T(Tt.$$.fragment,o),T(Mt.$$.fragment,o),T(Ue.$$.fragment,o),T(Pt.$$.fragment,o),T(Jt.$$.fragment,o),T(kt.$$.fragment,o),un=!1},d(o){t(f),o&&t(b),o&&t(h),S(l),o&&t(fe),o&&t(J),o&&t(tn),o&&t(Ft),o&&t(on),o&&t(Nt),o&&t(nn),S(pe,o),o&&t(sn),o&&t(ie),S(Ye),o&&t(an),o&&t(w),S(qe),S(Oe),S(he),S(He),S(ge),S(_e),S(Qe),S(et),S(tt),S(nt),S(ve),S(xe),S(at),S(dt),S(ct),S(pt),S(Se),S(Me),S(gt),S(Pe),S(_t),S(wt),S(vt),o&&t(rn),o&&t(re),S(xt),o&&t(ln),o&&t(le),S($t),o&&t(dn),o&&t(de),S(Dt),o&&t(cn),o&&t(G),S(Tt),S(Mt),S(Ue),o&&t(fn),o&&t(ce),S(Pt),o&&t(pn),o&&t(Q),S(Jt),S(kt)}}}const pl={local:"texttoimage",sections:[{local:"diffusers.StableDiffusionPipeline",title:"StableDiffusionPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"},{local:"diffusers.FlaxStableDiffusionPipeline",title:"FlaxStableDiffusionPipeline"},{local:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",title:"FlaxStableDiffusionPipelineOutput"}],title:"Text-to-image"};function ul(P){return el(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wl extends Or{constructor(f){super();Hr(this,f,ul,fl,Qr,{})}}export{wl as default,pl as metadata};
