import{S as Gr,i as Cr,s as Nr,e as i,k as d,w,t as r,M as Lr,c as s,d as t,m as c,a,x,h as l,b as p,G as e,g as v,y as $,q as D,o as S,B as T,v as Ar,L as It}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as ja}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as Et}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Oo}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as kt}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Br(M){let f,b,h,u,_,n,m,G,V,ce,J,z,R,Ne,Y,X,Le;return{c(){f=i("p"),b=r("Make sure to check out the Stable Diffusion "),h=i("a"),u=r("Tips"),_=r(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),n=d(),m=i("p"),G=r("If you\u2019re interested in using one of the official checkpoints for a task, explore the "),V=i("a"),ce=r("CompVis"),J=r(", "),z=i("a"),R=r("Runway"),Ne=r(", and "),Y=i("a"),X=r("Stability AI"),Le=r(" Hub organizations!"),this.h()},l(Z){f=s(Z,"P",{});var E=a(f);b=l(E,"Make sure to check out the Stable Diffusion "),h=s(E,"A",{href:!0});var Ut=a(h);u=l(Ut,"Tips"),Ut.forEach(t),_=l(E," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),E.forEach(t),n=c(Z),m=s(Z,"P",{});var C=a(m);G=l(C,"If you\u2019re interested in using one of the official checkpoints for a task, explore the "),V=s(C,"A",{href:!0,rel:!0});var Q=a(V);ce=l(Q,"CompVis"),Q.forEach(t),J=l(C,", "),z=s(C,"A",{href:!0,rel:!0});var jt=a(z);R=l(jt,"Runway"),jt.forEach(t),Ne=l(C,", and "),Y=s(C,"A",{href:!0,rel:!0});var Zt=a(Y);X=l(Zt,"Stability AI"),Zt.forEach(t),Le=l(C," Hub organizations!"),C.forEach(t),this.h()},h(){p(h,"href","overview#tips"),p(V,"href","https://huggingface.co/CompVis"),p(V,"rel","nofollow"),p(z,"href","https://huggingface.co/runwayml"),p(z,"rel","nofollow"),p(Y,"href","https://huggingface.co/stabilityai"),p(Y,"rel","nofollow")},m(Z,E){v(Z,f,E),e(f,b),e(f,h),e(h,u),e(f,_),v(Z,n,E),v(Z,m,E),e(m,G),e(m,V),e(V,ce),e(m,J),e(m,z),e(z,R),e(m,Ne),e(m,Y),e(Y,X),e(m,Le)},d(Z){Z&&t(f),Z&&t(n),Z&&t(m)}}}function Vr(M){let f,b,h,u,_;return u=new Et({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=i("p"),b=r("Examples:"),h=d(),w(u.$$.fragment)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"Examples:"),m.forEach(t),h=c(n),x(u.$$.fragment,n)},m(n,m){v(n,f,m),e(f,b),v(n,h,m),$(u,n,m),_=!0},p:It,i(n){_||(D(u.$$.fragment,n),_=!0)},o(n){S(u.$$.fragment,n),_=!1},d(n){n&&t(f),n&&t(h),T(u,n)}}}function zr(M){let f,b,h,u,_;return{c(){f=i("p"),b=r("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),h=i("code"),u=r("scaled_dot_product_attention"),_=r(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),h=s(m,"CODE",{});var G=a(h);u=l(G,"scaled_dot_product_attention"),G.forEach(t),_=l(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(n,m){v(n,f,m),e(f,b),e(f,h),e(h,u),e(f,_)},d(n){n&&t(f)}}}function Rr(M){let f,b,h,u,_;return u=new Et({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=i("p"),b=r("Examples:"),h=d(),w(u.$$.fragment)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"Examples:"),m.forEach(t),h=c(n),x(u.$$.fragment,n)},m(n,m){v(n,f,m),e(f,b),v(n,h,m),$(u,n,m),_=!0},p:It,i(n){_||(D(u.$$.fragment,n),_=!0)},o(n){S(u.$$.fragment,n),_=!1},d(n){n&&t(f),n&&t(h),T(u,n)}}}function Yr(M){let f,b;return{c(){f=i("p"),b=r(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(h){f=s(h,"P",{});var u=a(f);b=l(u,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),u.forEach(t)},m(h,u){v(h,f,u),e(f,b)},d(h){h&&t(f)}}}function Xr(M){let f,b,h,u,_;return u=new Et({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=i("p"),b=r("Examples:"),h=d(),w(u.$$.fragment)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"Examples:"),m.forEach(t),h=c(n),x(u.$$.fragment,n)},m(n,m){v(n,f,m),e(f,b),v(n,h,m),$(u,n,m),_=!0},p:It,i(n){_||(D(u.$$.fragment,n),_=!0)},o(n){S(u.$$.fragment,n),_=!1},d(n){n&&t(f),n&&t(h),T(u,n)}}}function qr(M){let f,b,h,u,_;return u=new Et({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=i("p"),b=r("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),h=d(),w(u.$$.fragment)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),m.forEach(t),h=c(n),x(u.$$.fragment,n)},m(n,m){v(n,f,m),e(f,b),v(n,h,m),$(u,n,m),_=!0},p:It,i(n){_||(D(u.$$.fragment,n),_=!0)},o(n){S(u.$$.fragment,n),_=!1},d(n){n&&t(f),n&&t(h),T(u,n)}}}function Or(M){let f,b,h,u,_;return u=new Et({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=i("p"),b=r("locally:"),h=d(),w(u.$$.fragment)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"locally:"),m.forEach(t),h=c(n),x(u.$$.fragment,n)},m(n,m){v(n,f,m),e(f,b),v(n,h,m),$(u,n,m),_=!0},p:It,i(n){_||(D(u.$$.fragment,n),_=!0)},o(n){S(u.$$.fragment,n),_=!1},d(n){n&&t(f),n&&t(h),T(u,n)}}}function Hr(M){let f,b,h,u,_;return u=new Et({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=i("p"),b=r("Examples:"),h=d(),w(u.$$.fragment)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"Examples:"),m.forEach(t),h=c(n),x(u.$$.fragment,n)},m(n,m){v(n,f,m),e(f,b),v(n,h,m),$(u,n,m),_=!0},p:It,i(n){_||(D(u.$$.fragment,n),_=!0)},o(n){S(u.$$.fragment,n),_=!1},d(n){n&&t(f),n&&t(h),T(u,n)}}}function Qr(M){let f,b,h,u,_;return u=new Et({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=i("p"),b=r("Examples:"),h=d(),w(u.$$.fragment)},l(n){f=s(n,"P",{});var m=a(f);b=l(m,"Examples:"),m.forEach(t),h=c(n),x(u.$$.fragment,n)},m(n,m){v(n,f,m),e(f,b),v(n,h,m),$(u,n,m),_=!0},p:It,i(n){_||(D(u.$$.fragment,n),_=!0)},o(n){S(u.$$.fragment,n),_=!1},d(n){n&&t(f),n&&t(h),T(u,n)}}}function Kr(M){let f,b,h,u,_,n,m,G,V,ce,J,z,R,Ne,Y,X,Le,Z,E,Ut,C,Q,jt,Zt,Wt,Wn,Fn,Ae,Gn,Cn,Ho,Ft,Nn,Qo,Gt,Be,Ln,Ve,An,Bn,Ko,fe,en,ne,pe,so,ze,Vn,ao,zn,tn,y,Re,Rn,ro,Yn,Xn,Ye,qn,Ct,On,Hn,Qn,lo,Kn,ei,q,Nt,Lt,ti,oi,ni,At,Bt,ii,si,ai,Vt,zt,ri,li,di,ue,Rt,ci,fi,co,pi,ui,mi,K,Xe,hi,fo,gi,_i,me,bi,N,qe,vi,po,yi,wi,he,xi,ge,$i,_e,Oe,Di,He,Si,uo,Ti,Pi,Mi,be,Qe,Ji,mo,ki,Ii,ve,Ke,Ei,et,Ui,ho,ji,Zi,Wi,L,tt,Fi,ot,Gi,nt,Ci,Ni,Li,ye,Ai,we,Bi,xe,it,Vi,st,zi,at,Ri,Yi,Xi,$e,rt,qi,go,Oi,Hi,De,lt,Qi,dt,Ki,_o,es,ts,os,U,ct,ns,ft,is,Yt,ss,as,rs,bo,ls,ds,Se,cs,pt,fs,ut,ps,us,ms,Te,hs,ee,mt,gs,W,_s,Xt,bs,vs,vo,ys,ws,yo,xs,$s,wo,Ds,Ss,Ts,Pe,Ps,j,ht,Ms,O,Js,xo,ks,Is,$o,Es,Us,Do,js,Zs,Ws,gt,Fs,So,Gs,Cs,Ns,_t,Ls,qt,As,Bs,Vs,ie,zs,Ot,Rs,Ys,To,Xs,qs,Os,se,Hs,Ht,Qs,Ks,Po,ea,ta,oa,Me,bt,na,Mo,ia,sa,Je,vt,aa,Jo,ra,on,ae,ke,ko,yt,la,Io,da,nn,re,wt,ca,Eo,fa,sn,le,Ie,Uo,xt,pa,jo,ua,an,F,$t,ma,Zo,ha,ga,Dt,_a,Qt,ba,va,ya,te,St,wa,Wo,xa,$a,Ee,rn,de,Ue,Fo,Tt,Da,Go,Sa,ln,H,Pt,Ta,Co,Pa,Ma,je,Mt,Ja,No,ka,dn;return n=new Oo({}),fe=new ja({props:{$$slots:{default:[Br]},$$scope:{ctx:M}}}),ze=new Oo({}),Re=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/v0.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#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> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/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> (<code>CLIPImageProcessor</code>) &#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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L70"}}),Xe=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[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.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/v0.21.0/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/v0.21.0/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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L520",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/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/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),me=new kt({props:{anchor:"diffusers.StableDiffusionPipeline.__call__.example",$$slots:{default:[Vr]},$$scope:{ctx:M}}}),qe=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1780"}}),he=new ja({props:{warning:!0,$$slots:{default:[zr]},$$scope:{ctx:M}}}),ge=new kt({props:{anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing.example",$$slots:{default:[Rr]},$$scope:{ctx:M}}}),Oe=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1820"}}),Qe=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L196"}}),Ke=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L203"}}),tt=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1719"}}),ye=new ja({props:{warning:!0,$$slots:{default:[Yr]},$$scope:{ctx:M}}}),we=new kt({props:{anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Xr]},$$scope:{ctx:M}}}),it=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/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1754"}}),rt=new k({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L210"}}),lt=new k({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L218"}}),ct=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[str, typing.List[str], NoneType] = None"},{name:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"text_encoder",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = 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.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).
If not specified, function will take self.tokenizer.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text. If not specified, function will take self.tokenizer.`,name:"tokenizer"},{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/v0.21.0/src/diffusers/loaders.py#L687"}}),Se=new kt({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example",$$slots:{default:[qr]},$$scope:{ctx:M}}}),Te=new kt({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example-2",$$slots:{default:[Or]},$$scope:{ctx:M}}}),mt=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> (<code>CLIPTextModel</code>, <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> (<code>CLIPTokenizer</code>, <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/v0.21.0/src/diffusers/loaders.py#L1999"}}),Pe=new kt({props:{anchor:"diffusers.StableDiffusionPipeline.from_single_file.example",$$slots:{default:[Hr]},$$scope:{ctx:M}}}),ht=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/v0.21.0/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/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L991"}}),bt=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/v0.21.0/src/diffusers/loaders.py#L1623"}}),vt=new k({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L255"}}),yt=new Oo({}),wt=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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L15"}}),xt=new Oo({}),$t=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/v0.21.0/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> (<code>FlaxCLIPTextModel</code>) &#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> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/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/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<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> (<code>CLIPImageProcessor</code>) &#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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py#L81"}}),St=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/v0.21.0/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/v0.21.0/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/v0.21.0/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/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Ee=new kt({props:{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.example",$$slots:{default:[Qr]},$$scope:{ctx:M}}}),Tt=new Oo({}),Pt=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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L36"}}),Mt=new k({props:{name:"replace",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/flax/struct.py#L111"}}),{c(){f=i("meta"),b=d(),h=i("h1"),u=i("a"),_=i("span"),w(n.$$.fragment),m=d(),G=i("span"),V=r("Text-to-image"),ce=d(),J=i("p"),z=r("The Stable Diffusion model was created by researchers and engineers from "),R=i("a"),Ne=r("CompVis"),Y=r(", "),X=i("a"),Le=r("Stability AI"),Z=r(", "),E=i("a"),Ut=r("Runway"),C=r(", and "),Q=i("a"),jt=r("LAION"),Zt=r(". The "),Wt=i("a"),Wn=r("StableDiffusionPipeline"),Fn=r(" 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("a"),Gn=r("High-Resolution Image Synthesis with Latent Diffusion Models"),Cn=r(" by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),Ho=d(),Ft=i("p"),Nn=r("The abstract from the paper is:"),Qo=d(),Gt=i("p"),Be=i("em"),Ln=r("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 "),Ve=i("a"),An=r("https://github.com/CompVis/latent-diffusion"),Bn=r("."),Ko=d(),w(fe.$$.fragment),en=d(),ne=i("h2"),pe=i("a"),so=i("span"),w(ze.$$.fragment),Vn=d(),ao=i("span"),zn=r("StableDiffusionPipeline"),tn=d(),y=i("div"),w(Re.$$.fragment),Rn=d(),ro=i("p"),Yn=r("Pipeline for text-to-image generation using Stable Diffusion."),Xn=d(),Ye=i("p"),qn=r("This model inherits from "),Ct=i("a"),On=r("DiffusionPipeline"),Hn=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Qn=d(),lo=i("p"),Kn=r("The pipeline also inherits the following loading methods:"),ei=d(),q=i("ul"),Nt=i("li"),Lt=i("a"),ti=r("load_textual_inversion()"),oi=r(" for loading textual inversion embeddings"),ni=d(),At=i("li"),Bt=i("a"),ii=r("load_lora_weights()"),si=r(" for loading LoRA weights"),ai=d(),Vt=i("li"),zt=i("a"),ri=r("save_lora_weights()"),li=r(" for saving LoRA weights"),di=d(),ue=i("li"),Rt=i("a"),ci=r("from_single_file()"),fi=r(" for loading "),co=i("code"),pi=r(".ckpt"),ui=r(" files"),mi=d(),K=i("div"),w(Xe.$$.fragment),hi=d(),fo=i("p"),gi=r("The call function to the pipeline for generation."),_i=d(),w(me.$$.fragment),bi=d(),N=i("div"),w(qe.$$.fragment),vi=d(),po=i("p"),yi=r(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),wi=d(),w(he.$$.fragment),xi=d(),w(ge.$$.fragment),$i=d(),_e=i("div"),w(Oe.$$.fragment),Di=d(),He=i("p"),Si=r("Disable sliced attention computation. If "),uo=i("code"),Ti=r("enable_attention_slicing"),Pi=r(` was previously called, attention is
computed in one step.`),Mi=d(),be=i("div"),w(Qe.$$.fragment),Ji=d(),mo=i("p"),ki=r(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Ii=d(),ve=i("div"),w(Ke.$$.fragment),Ei=d(),et=i("p"),Ui=r("Disable sliced VAE decoding. If "),ho=i("code"),ji=r("enable_vae_slicing"),Zi=r(` was previously enabled, this method will go back to
computing decoding in one step.`),Wi=d(),L=i("div"),w(tt.$$.fragment),Fi=d(),ot=i("p"),Gi=r("Enable memory efficient attention from "),nt=i("a"),Ci=r("xFormers"),Ni=r(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Li=d(),w(ye.$$.fragment),Ai=d(),w(we.$$.fragment),Bi=d(),xe=i("div"),w(it.$$.fragment),Vi=d(),st=i("p"),zi=r("Disable memory efficient attention from "),at=i("a"),Ri=r("xFormers"),Yi=r("."),Xi=d(),$e=i("div"),w(rt.$$.fragment),qi=d(),go=i("p"),Oi=r(`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.`),Hi=d(),De=i("div"),w(lt.$$.fragment),Qi=d(),dt=i("p"),Ki=r("Disable tiled VAE decoding. If "),_o=i("code"),es=r("enable_vae_tiling"),ts=r(` was previously enabled, this method will go back to
computing decoding in one step.`),os=d(),U=i("div"),w(ct.$$.fragment),ns=d(),ft=i("p"),is=r("Load textual inversion embeddings into the text encoder of "),Yt=i("a"),ss=r("StableDiffusionPipeline"),as=r(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),rs=d(),bo=i("p"),ls=r("Example:"),ds=d(),w(Se.$$.fragment),cs=d(),pt=i("p"),fs=r(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),ut=i("a"),ps=r("civitAI"),us=r(") and then load the vector"),ms=d(),w(Te.$$.fragment),hs=d(),ee=i("div"),w(mt.$$.fragment),gs=d(),W=i("p"),_s=r("Instantiate a "),Xt=i("a"),bs=r("DiffusionPipeline"),vs=r(" from pretrained pipeline weights saved in the "),vo=i("code"),ys=r(".ckpt"),ws=r(" or "),yo=i("code"),xs=r(".safetensors"),$s=r(`
format. The pipeline is set in evaluation mode (`),wo=i("code"),Ds=r("model.eval()"),Ss=r(") by default."),Ts=d(),w(Pe.$$.fragment),Ps=d(),j=i("div"),w(ht.$$.fragment),Ms=d(),O=i("p"),Js=r("Load LoRA weights specified in "),xo=i("code"),ks=r("pretrained_model_name_or_path_or_dict"),Is=r(" into "),$o=i("code"),Es=r("self.unet"),Us=r(` and
`),Do=i("code"),js=r("self.text_encoder"),Zs=r("."),Ws=d(),gt=i("p"),Fs=r("All kwargs are forwarded to "),So=i("code"),Gs=r("self.lora_state_dict"),Cs=r("."),Ns=d(),_t=i("p"),Ls=r("See "),qt=i("a"),As=r("lora_state_dict()"),Bs=r(" for more details on how the state dict is loaded."),Vs=d(),ie=i("p"),zs=r("See "),Ot=i("a"),Rs=r("load_lora_into_unet()"),Ys=r(` for more details on how the state dict is loaded into
`),To=i("code"),Xs=r("self.unet"),qs=r("."),Os=d(),se=i("p"),Hs=r("See "),Ht=i("a"),Qs=r("load_lora_into_text_encoder()"),Ks=r(` for more details on how the state dict is loaded
into `),Po=i("code"),ea=r("self.text_encoder"),ta=r("."),oa=d(),Me=i("div"),w(bt.$$.fragment),na=d(),Mo=i("p"),ia=r("Save the LoRA parameters corresponding to the UNet and text encoder."),sa=d(),Je=i("div"),w(vt.$$.fragment),aa=d(),Jo=i("p"),ra=r("Encodes the prompt into text encoder hidden states."),on=d(),ae=i("h2"),ke=i("a"),ko=i("span"),w(yt.$$.fragment),la=d(),Io=i("span"),da=r("StableDiffusionPipelineOutput"),nn=d(),re=i("div"),w(wt.$$.fragment),ca=d(),Eo=i("p"),fa=r("Output class for Stable Diffusion pipelines."),sn=d(),le=i("h2"),Ie=i("a"),Uo=i("span"),w(xt.$$.fragment),pa=d(),jo=i("span"),ua=r("FlaxStableDiffusionPipeline"),an=d(),F=i("div"),w($t.$$.fragment),ma=d(),Zo=i("p"),ha=r("Flax-based pipeline for text-to-image generation using Stable Diffusion."),ga=d(),Dt=i("p"),_a=r("This model inherits from "),Qt=i("a"),ba=r("FlaxDiffusionPipeline"),va=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ya=d(),te=i("div"),w(St.$$.fragment),wa=d(),Wo=i("p"),xa=r("The call function to the pipeline for generation."),$a=d(),w(Ee.$$.fragment),rn=d(),de=i("h2"),Ue=i("a"),Fo=i("span"),w(Tt.$$.fragment),Da=d(),Go=i("span"),Sa=r("FlaxStableDiffusionPipelineOutput"),ln=d(),H=i("div"),w(Pt.$$.fragment),Ta=d(),Co=i("p"),Pa=r("Output class for Flax-based Stable Diffusion pipelines."),Ma=d(),je=i("div"),w(Mt.$$.fragment),Ja=d(),No=i("p"),ka=r("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(o){const g=Lr('[data-svelte="svelte-1phssyn"]',document.head);f=s(g,"META",{name:!0,content:!0}),g.forEach(t),b=c(o),h=s(o,"H1",{class:!0});var Jt=a(h);u=s(Jt,"A",{id:!0,class:!0,href:!0});var Lo=a(u);_=s(Lo,"SPAN",{});var Ao=a(_);x(n.$$.fragment,Ao),Ao.forEach(t),Lo.forEach(t),m=c(Jt),G=s(Jt,"SPAN",{});var Bo=a(G);V=l(Bo,"Text-to-image"),Bo.forEach(t),Jt.forEach(t),ce=c(o),J=s(o,"P",{});var I=a(J);z=l(I,"The Stable Diffusion model was created by researchers and engineers from "),R=s(I,"A",{href:!0,rel:!0});var Vo=a(R);Ne=l(Vo,"CompVis"),Vo.forEach(t),Y=l(I,", "),X=s(I,"A",{href:!0,rel:!0});var zo=a(X);Le=l(zo,"Stability AI"),zo.forEach(t),Z=l(I,", "),E=s(I,"A",{href:!0,rel:!0});var Ro=a(E);Ut=l(Ro,"Runway"),Ro.forEach(t),C=l(I,", and "),Q=s(I,"A",{href:!0,rel:!0});var Yo=a(Q);jt=l(Yo,"LAION"),Yo.forEach(t),Zt=l(I,". The "),Wt=s(I,"A",{href:!0});var Xo=a(Wt);Wn=l(Xo,"StableDiffusionPipeline"),Xo.forEach(t),Fn=l(I," 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=s(I,"A",{href:!0,rel:!0});var Za=a(Ae);Gn=l(Za,"High-Resolution Image Synthesis with Latent Diffusion Models"),Za.forEach(t),Cn=l(I," by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),I.forEach(t),Ho=c(o),Ft=s(o,"P",{});var Wa=a(Ft);Nn=l(Wa,"The abstract from the paper is:"),Wa.forEach(t),Qo=c(o),Gt=s(o,"P",{});var Fa=a(Gt);Be=s(Fa,"EM",{});var cn=a(Be);Ln=l(cn,"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 "),Ve=s(cn,"A",{href:!0,rel:!0});var Ga=a(Ve);An=l(Ga,"https://github.com/CompVis/latent-diffusion"),Ga.forEach(t),Bn=l(cn,"."),cn.forEach(t),Fa.forEach(t),Ko=c(o),x(fe.$$.fragment,o),en=c(o),ne=s(o,"H2",{class:!0});var fn=a(ne);pe=s(fn,"A",{id:!0,class:!0,href:!0});var Ca=a(pe);so=s(Ca,"SPAN",{});var Na=a(so);x(ze.$$.fragment,Na),Na.forEach(t),Ca.forEach(t),Vn=c(fn),ao=s(fn,"SPAN",{});var La=a(ao);zn=l(La,"StableDiffusionPipeline"),La.forEach(t),fn.forEach(t),tn=c(o),y=s(o,"DIV",{class:!0});var P=a(y);x(Re.$$.fragment,P),Rn=c(P),ro=s(P,"P",{});var Aa=a(ro);Yn=l(Aa,"Pipeline for text-to-image generation using Stable Diffusion."),Aa.forEach(t),Xn=c(P),Ye=s(P,"P",{});var pn=a(Ye);qn=l(pn,"This model inherits from "),Ct=s(pn,"A",{href:!0});var Ba=a(Ct);On=l(Ba,"DiffusionPipeline"),Ba.forEach(t),Hn=l(pn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),pn.forEach(t),Qn=c(P),lo=s(P,"P",{});var Va=a(lo);Kn=l(Va,"The pipeline also inherits the following loading methods:"),Va.forEach(t),ei=c(P),q=s(P,"UL",{});var Ze=a(q);Nt=s(Ze,"LI",{});var Ia=a(Nt);Lt=s(Ia,"A",{href:!0});var za=a(Lt);ti=l(za,"load_textual_inversion()"),za.forEach(t),oi=l(Ia," for loading textual inversion embeddings"),Ia.forEach(t),ni=c(Ze),At=s(Ze,"LI",{});var Ea=a(At);Bt=s(Ea,"A",{href:!0});var Ra=a(Bt);ii=l(Ra,"load_lora_weights()"),Ra.forEach(t),si=l(Ea," for loading LoRA weights"),Ea.forEach(t),ai=c(Ze),Vt=s(Ze,"LI",{});var Ua=a(Vt);zt=s(Ua,"A",{href:!0});var Ya=a(zt);ri=l(Ya,"save_lora_weights()"),Ya.forEach(t),li=l(Ua," for saving LoRA weights"),Ua.forEach(t),di=c(Ze),ue=s(Ze,"LI",{});var qo=a(ue);Rt=s(qo,"A",{href:!0});var Xa=a(Rt);ci=l(Xa,"from_single_file()"),Xa.forEach(t),fi=l(qo," for loading "),co=s(qo,"CODE",{});var qa=a(co);pi=l(qa,".ckpt"),qa.forEach(t),ui=l(qo," files"),qo.forEach(t),Ze.forEach(t),mi=c(P),K=s(P,"DIV",{class:!0});var Kt=a(K);x(Xe.$$.fragment,Kt),hi=c(Kt),fo=s(Kt,"P",{});var Oa=a(fo);gi=l(Oa,"The call function to the pipeline for generation."),Oa.forEach(t),_i=c(Kt),x(me.$$.fragment,Kt),Kt.forEach(t),bi=c(P),N=s(P,"DIV",{class:!0});var We=a(N);x(qe.$$.fragment,We),vi=c(We),po=s(We,"P",{});var Ha=a(po);yi=l(Ha,`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.`),Ha.forEach(t),wi=c(We),x(he.$$.fragment,We),xi=c(We),x(ge.$$.fragment,We),We.forEach(t),$i=c(P),_e=s(P,"DIV",{class:!0});var un=a(_e);x(Oe.$$.fragment,un),Di=c(un),He=s(un,"P",{});var mn=a(He);Si=l(mn,"Disable sliced attention computation. If "),uo=s(mn,"CODE",{});var Qa=a(uo);Ti=l(Qa,"enable_attention_slicing"),Qa.forEach(t),Pi=l(mn,` was previously called, attention is
computed in one step.`),mn.forEach(t),un.forEach(t),Mi=c(P),be=s(P,"DIV",{class:!0});var hn=a(be);x(Qe.$$.fragment,hn),Ji=c(hn),mo=s(hn,"P",{});var Ka=a(mo);ki=l(Ka,`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.`),Ka.forEach(t),hn.forEach(t),Ii=c(P),ve=s(P,"DIV",{class:!0});var gn=a(ve);x(Ke.$$.fragment,gn),Ei=c(gn),et=s(gn,"P",{});var _n=a(et);Ui=l(_n,"Disable sliced VAE decoding. If "),ho=s(_n,"CODE",{});var er=a(ho);ji=l(er,"enable_vae_slicing"),er.forEach(t),Zi=l(_n,` was previously enabled, this method will go back to
computing decoding in one step.`),_n.forEach(t),gn.forEach(t),Wi=c(P),L=s(P,"DIV",{class:!0});var Fe=a(L);x(tt.$$.fragment,Fe),Fi=c(Fe),ot=s(Fe,"P",{});var bn=a(ot);Gi=l(bn,"Enable memory efficient attention from "),nt=s(bn,"A",{href:!0,rel:!0});var tr=a(nt);Ci=l(tr,"xFormers"),tr.forEach(t),Ni=l(bn,`. 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.`),bn.forEach(t),Li=c(Fe),x(ye.$$.fragment,Fe),Ai=c(Fe),x(we.$$.fragment,Fe),Fe.forEach(t),Bi=c(P),xe=s(P,"DIV",{class:!0});var vn=a(xe);x(it.$$.fragment,vn),Vi=c(vn),st=s(vn,"P",{});var yn=a(st);zi=l(yn,"Disable memory efficient attention from "),at=s(yn,"A",{href:!0,rel:!0});var or=a(at);Ri=l(or,"xFormers"),or.forEach(t),Yi=l(yn,"."),yn.forEach(t),vn.forEach(t),Xi=c(P),$e=s(P,"DIV",{class:!0});var wn=a($e);x(rt.$$.fragment,wn),qi=c(wn),go=s(wn,"P",{});var nr=a(go);Oi=l(nr,`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.`),nr.forEach(t),wn.forEach(t),Hi=c(P),De=s(P,"DIV",{class:!0});var xn=a(De);x(lt.$$.fragment,xn),Qi=c(xn),dt=s(xn,"P",{});var $n=a(dt);Ki=l($n,"Disable tiled VAE decoding. If "),_o=s($n,"CODE",{});var ir=a(_o);es=l(ir,"enable_vae_tiling"),ir.forEach(t),ts=l($n,` was previously enabled, this method will go back to
computing decoding in one step.`),$n.forEach(t),xn.forEach(t),os=c(P),U=s(P,"DIV",{class:!0});var A=a(U);x(ct.$$.fragment,A),ns=c(A),ft=s(A,"P",{});var Dn=a(ft);is=l(Dn,"Load textual inversion embeddings into the text encoder of "),Yt=s(Dn,"A",{href:!0});var sr=a(Yt);ss=l(sr,"StableDiffusionPipeline"),sr.forEach(t),as=l(Dn,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Dn.forEach(t),rs=c(A),bo=s(A,"P",{});var ar=a(bo);ls=l(ar,"Example:"),ar.forEach(t),ds=c(A),x(Se.$$.fragment,A),cs=c(A),pt=s(A,"P",{});var Sn=a(pt);fs=l(Sn,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),ut=s(Sn,"A",{href:!0,rel:!0});var rr=a(ut);ps=l(rr,"civitAI"),rr.forEach(t),us=l(Sn,") and then load the vector"),Sn.forEach(t),ms=c(A),x(Te.$$.fragment,A),A.forEach(t),hs=c(P),ee=s(P,"DIV",{class:!0});var eo=a(ee);x(mt.$$.fragment,eo),gs=c(eo),W=s(eo,"P",{});var oe=a(W);_s=l(oe,"Instantiate a "),Xt=s(oe,"A",{href:!0});var lr=a(Xt);bs=l(lr,"DiffusionPipeline"),lr.forEach(t),vs=l(oe," from pretrained pipeline weights saved in the "),vo=s(oe,"CODE",{});var dr=a(vo);ys=l(dr,".ckpt"),dr.forEach(t),ws=l(oe," or "),yo=s(oe,"CODE",{});var cr=a(yo);xs=l(cr,".safetensors"),cr.forEach(t),$s=l(oe,`
format. The pipeline is set in evaluation mode (`),wo=s(oe,"CODE",{});var fr=a(wo);Ds=l(fr,"model.eval()"),fr.forEach(t),Ss=l(oe,") by default."),oe.forEach(t),Ts=c(eo),x(Pe.$$.fragment,eo),eo.forEach(t),Ps=c(P),j=s(P,"DIV",{class:!0});var B=a(j);x(ht.$$.fragment,B),Ms=c(B),O=s(B,"P",{});var Ge=a(O);Js=l(Ge,"Load LoRA weights specified in "),xo=s(Ge,"CODE",{});var pr=a(xo);ks=l(pr,"pretrained_model_name_or_path_or_dict"),pr.forEach(t),Is=l(Ge," into "),$o=s(Ge,"CODE",{});var ur=a($o);Es=l(ur,"self.unet"),ur.forEach(t),Us=l(Ge,` and
`),Do=s(Ge,"CODE",{});var mr=a(Do);js=l(mr,"self.text_encoder"),mr.forEach(t),Zs=l(Ge,"."),Ge.forEach(t),Ws=c(B),gt=s(B,"P",{});var Tn=a(gt);Fs=l(Tn,"All kwargs are forwarded to "),So=s(Tn,"CODE",{});var hr=a(So);Gs=l(hr,"self.lora_state_dict"),hr.forEach(t),Cs=l(Tn,"."),Tn.forEach(t),Ns=c(B),_t=s(B,"P",{});var Pn=a(_t);Ls=l(Pn,"See "),qt=s(Pn,"A",{href:!0});var gr=a(qt);As=l(gr,"lora_state_dict()"),gr.forEach(t),Bs=l(Pn," for more details on how the state dict is loaded."),Pn.forEach(t),Vs=c(B),ie=s(B,"P",{});var to=a(ie);zs=l(to,"See "),Ot=s(to,"A",{href:!0});var _r=a(Ot);Rs=l(_r,"load_lora_into_unet()"),_r.forEach(t),Ys=l(to,` for more details on how the state dict is loaded into
`),To=s(to,"CODE",{});var br=a(To);Xs=l(br,"self.unet"),br.forEach(t),qs=l(to,"."),to.forEach(t),Os=c(B),se=s(B,"P",{});var oo=a(se);Hs=l(oo,"See "),Ht=s(oo,"A",{href:!0});var vr=a(Ht);Qs=l(vr,"load_lora_into_text_encoder()"),vr.forEach(t),Ks=l(oo,` for more details on how the state dict is loaded
into `),Po=s(oo,"CODE",{});var yr=a(Po);ea=l(yr,"self.text_encoder"),yr.forEach(t),ta=l(oo,"."),oo.forEach(t),B.forEach(t),oa=c(P),Me=s(P,"DIV",{class:!0});var Mn=a(Me);x(bt.$$.fragment,Mn),na=c(Mn),Mo=s(Mn,"P",{});var wr=a(Mo);ia=l(wr,"Save the LoRA parameters corresponding to the UNet and text encoder."),wr.forEach(t),Mn.forEach(t),sa=c(P),Je=s(P,"DIV",{class:!0});var Jn=a(Je);x(vt.$$.fragment,Jn),aa=c(Jn),Jo=s(Jn,"P",{});var xr=a(Jo);ra=l(xr,"Encodes the prompt into text encoder hidden states."),xr.forEach(t),Jn.forEach(t),P.forEach(t),on=c(o),ae=s(o,"H2",{class:!0});var kn=a(ae);ke=s(kn,"A",{id:!0,class:!0,href:!0});var $r=a(ke);ko=s($r,"SPAN",{});var Dr=a(ko);x(yt.$$.fragment,Dr),Dr.forEach(t),$r.forEach(t),la=c(kn),Io=s(kn,"SPAN",{});var Sr=a(Io);da=l(Sr,"StableDiffusionPipelineOutput"),Sr.forEach(t),kn.forEach(t),nn=c(o),re=s(o,"DIV",{class:!0});var In=a(re);x(wt.$$.fragment,In),ca=c(In),Eo=s(In,"P",{});var Tr=a(Eo);fa=l(Tr,"Output class for Stable Diffusion pipelines."),Tr.forEach(t),In.forEach(t),sn=c(o),le=s(o,"H2",{class:!0});var En=a(le);Ie=s(En,"A",{id:!0,class:!0,href:!0});var Pr=a(Ie);Uo=s(Pr,"SPAN",{});var Mr=a(Uo);x(xt.$$.fragment,Mr),Mr.forEach(t),Pr.forEach(t),pa=c(En),jo=s(En,"SPAN",{});var Jr=a(jo);ua=l(Jr,"FlaxStableDiffusionPipeline"),Jr.forEach(t),En.forEach(t),an=c(o),F=s(o,"DIV",{class:!0});var Ce=a(F);x($t.$$.fragment,Ce),ma=c(Ce),Zo=s(Ce,"P",{});var kr=a(Zo);ha=l(kr,"Flax-based pipeline for text-to-image generation using Stable Diffusion."),kr.forEach(t),ga=c(Ce),Dt=s(Ce,"P",{});var Un=a(Dt);_a=l(Un,"This model inherits from "),Qt=s(Un,"A",{href:!0});var Ir=a(Qt);ba=l(Ir,"FlaxDiffusionPipeline"),Ir.forEach(t),va=l(Un,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Un.forEach(t),ya=c(Ce),te=s(Ce,"DIV",{class:!0});var no=a(te);x(St.$$.fragment,no),wa=c(no),Wo=s(no,"P",{});var Er=a(Wo);xa=l(Er,"The call function to the pipeline for generation."),Er.forEach(t),$a=c(no),x(Ee.$$.fragment,no),no.forEach(t),Ce.forEach(t),rn=c(o),de=s(o,"H2",{class:!0});var jn=a(de);Ue=s(jn,"A",{id:!0,class:!0,href:!0});var Ur=a(Ue);Fo=s(Ur,"SPAN",{});var jr=a(Fo);x(Tt.$$.fragment,jr),jr.forEach(t),Ur.forEach(t),Da=c(jn),Go=s(jn,"SPAN",{});var Zr=a(Go);Sa=l(Zr,"FlaxStableDiffusionPipelineOutput"),Zr.forEach(t),jn.forEach(t),ln=c(o),H=s(o,"DIV",{class:!0});var io=a(H);x(Pt.$$.fragment,io),Ta=c(io),Co=s(io,"P",{});var Wr=a(Co);Pa=l(Wr,"Output class for Flax-based Stable Diffusion pipelines."),Wr.forEach(t),Ma=c(io),je=s(io,"DIV",{class:!0});var Zn=a(je);x(Mt.$$.fragment,Zn),Ja=c(Zn),No=s(Zn,"P",{});var Fr=a(No);ka=l(Fr,"\u201CReturns a new object replacing the specified fields with new values."),Fr.forEach(t),Zn.forEach(t),io.forEach(t),this.h()},h(){p(f,"name","hf:doc:metadata"),p(f,"content",JSON.stringify(el)),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(R,"href","https://github.com/CompVis"),p(R,"rel","nofollow"),p(X,"href","https://stability.ai/"),p(X,"rel","nofollow"),p(E,"href","https://github.com/runwayml"),p(E,"rel","nofollow"),p(Q,"href","https://laion.ai/"),p(Q,"rel","nofollow"),p(Wt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),p(Ae,"href","https://huggingface.co/papers/2112.10752"),p(Ae,"rel","nofollow"),p(Ve,"href","https://github.com/CompVis/latent-diffusion"),p(Ve,"rel","nofollow"),p(pe,"id","diffusers.StableDiffusionPipeline"),p(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(pe,"href","#diffusers.StableDiffusionPipeline"),p(ne,"class","relative group"),p(Ct,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Lt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),p(Bt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),p(zt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),p(Rt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),p(K,"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(_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(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(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(nt,"href","https://facebookresearch.github.io/xformers/"),p(nt,"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(at,"href","https://facebookresearch.github.io/xformers/"),p(at,"rel","nofollow"),p(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Yt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),p(ut,"href","https://civitai.com/models/3036?modelVersionId=9857"),p(ut,"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(Xt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),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(qt,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),p(Ot,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),p(Ht,"href","/docs/diffusers/v0.21.0/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(Me,"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(y,"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,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(ke,"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(ke,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(ae,"class","relative group"),p(re,"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(le,"class","relative group"),p(Qt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),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(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ue,"id","diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),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.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),p(de,"class","relative group"),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(H,"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),v(o,b,g),v(o,h,g),e(h,u),e(u,_),$(n,_,null),e(h,m),e(h,G),e(G,V),v(o,ce,g),v(o,J,g),e(J,z),e(J,R),e(R,Ne),e(J,Y),e(J,X),e(X,Le),e(J,Z),e(J,E),e(E,Ut),e(J,C),e(J,Q),e(Q,jt),e(J,Zt),e(J,Wt),e(Wt,Wn),e(J,Fn),e(J,Ae),e(Ae,Gn),e(J,Cn),v(o,Ho,g),v(o,Ft,g),e(Ft,Nn),v(o,Qo,g),v(o,Gt,g),e(Gt,Be),e(Be,Ln),e(Be,Ve),e(Ve,An),e(Be,Bn),v(o,Ko,g),$(fe,o,g),v(o,en,g),v(o,ne,g),e(ne,pe),e(pe,so),$(ze,so,null),e(ne,Vn),e(ne,ao),e(ao,zn),v(o,tn,g),v(o,y,g),$(Re,y,null),e(y,Rn),e(y,ro),e(ro,Yn),e(y,Xn),e(y,Ye),e(Ye,qn),e(Ye,Ct),e(Ct,On),e(Ye,Hn),e(y,Qn),e(y,lo),e(lo,Kn),e(y,ei),e(y,q),e(q,Nt),e(Nt,Lt),e(Lt,ti),e(Nt,oi),e(q,ni),e(q,At),e(At,Bt),e(Bt,ii),e(At,si),e(q,ai),e(q,Vt),e(Vt,zt),e(zt,ri),e(Vt,li),e(q,di),e(q,ue),e(ue,Rt),e(Rt,ci),e(ue,fi),e(ue,co),e(co,pi),e(ue,ui),e(y,mi),e(y,K),$(Xe,K,null),e(K,hi),e(K,fo),e(fo,gi),e(K,_i),$(me,K,null),e(y,bi),e(y,N),$(qe,N,null),e(N,vi),e(N,po),e(po,yi),e(N,wi),$(he,N,null),e(N,xi),$(ge,N,null),e(y,$i),e(y,_e),$(Oe,_e,null),e(_e,Di),e(_e,He),e(He,Si),e(He,uo),e(uo,Ti),e(He,Pi),e(y,Mi),e(y,be),$(Qe,be,null),e(be,Ji),e(be,mo),e(mo,ki),e(y,Ii),e(y,ve),$(Ke,ve,null),e(ve,Ei),e(ve,et),e(et,Ui),e(et,ho),e(ho,ji),e(et,Zi),e(y,Wi),e(y,L),$(tt,L,null),e(L,Fi),e(L,ot),e(ot,Gi),e(ot,nt),e(nt,Ci),e(ot,Ni),e(L,Li),$(ye,L,null),e(L,Ai),$(we,L,null),e(y,Bi),e(y,xe),$(it,xe,null),e(xe,Vi),e(xe,st),e(st,zi),e(st,at),e(at,Ri),e(st,Yi),e(y,Xi),e(y,$e),$(rt,$e,null),e($e,qi),e($e,go),e(go,Oi),e(y,Hi),e(y,De),$(lt,De,null),e(De,Qi),e(De,dt),e(dt,Ki),e(dt,_o),e(_o,es),e(dt,ts),e(y,os),e(y,U),$(ct,U,null),e(U,ns),e(U,ft),e(ft,is),e(ft,Yt),e(Yt,ss),e(ft,as),e(U,rs),e(U,bo),e(bo,ls),e(U,ds),$(Se,U,null),e(U,cs),e(U,pt),e(pt,fs),e(pt,ut),e(ut,ps),e(pt,us),e(U,ms),$(Te,U,null),e(y,hs),e(y,ee),$(mt,ee,null),e(ee,gs),e(ee,W),e(W,_s),e(W,Xt),e(Xt,bs),e(W,vs),e(W,vo),e(vo,ys),e(W,ws),e(W,yo),e(yo,xs),e(W,$s),e(W,wo),e(wo,Ds),e(W,Ss),e(ee,Ts),$(Pe,ee,null),e(y,Ps),e(y,j),$(ht,j,null),e(j,Ms),e(j,O),e(O,Js),e(O,xo),e(xo,ks),e(O,Is),e(O,$o),e($o,Es),e(O,Us),e(O,Do),e(Do,js),e(O,Zs),e(j,Ws),e(j,gt),e(gt,Fs),e(gt,So),e(So,Gs),e(gt,Cs),e(j,Ns),e(j,_t),e(_t,Ls),e(_t,qt),e(qt,As),e(_t,Bs),e(j,Vs),e(j,ie),e(ie,zs),e(ie,Ot),e(Ot,Rs),e(ie,Ys),e(ie,To),e(To,Xs),e(ie,qs),e(j,Os),e(j,se),e(se,Hs),e(se,Ht),e(Ht,Qs),e(se,Ks),e(se,Po),e(Po,ea),e(se,ta),e(y,oa),e(y,Me),$(bt,Me,null),e(Me,na),e(Me,Mo),e(Mo,ia),e(y,sa),e(y,Je),$(vt,Je,null),e(Je,aa),e(Je,Jo),e(Jo,ra),v(o,on,g),v(o,ae,g),e(ae,ke),e(ke,ko),$(yt,ko,null),e(ae,la),e(ae,Io),e(Io,da),v(o,nn,g),v(o,re,g),$(wt,re,null),e(re,ca),e(re,Eo),e(Eo,fa),v(o,sn,g),v(o,le,g),e(le,Ie),e(Ie,Uo),$(xt,Uo,null),e(le,pa),e(le,jo),e(jo,ua),v(o,an,g),v(o,F,g),$($t,F,null),e(F,ma),e(F,Zo),e(Zo,ha),e(F,ga),e(F,Dt),e(Dt,_a),e(Dt,Qt),e(Qt,ba),e(Dt,va),e(F,ya),e(F,te),$(St,te,null),e(te,wa),e(te,Wo),e(Wo,xa),e(te,$a),$(Ee,te,null),v(o,rn,g),v(o,de,g),e(de,Ue),e(Ue,Fo),$(Tt,Fo,null),e(de,Da),e(de,Go),e(Go,Sa),v(o,ln,g),v(o,H,g),$(Pt,H,null),e(H,Ta),e(H,Co),e(Co,Pa),e(H,Ma),e(H,je),$(Mt,je,null),e(je,Ja),e(je,No),e(No,ka),dn=!0},p(o,[g]){const Jt={};g&2&&(Jt.$$scope={dirty:g,ctx:o}),fe.$set(Jt);const Lo={};g&2&&(Lo.$$scope={dirty:g,ctx:o}),me.$set(Lo);const Ao={};g&2&&(Ao.$$scope={dirty:g,ctx:o}),he.$set(Ao);const Bo={};g&2&&(Bo.$$scope={dirty:g,ctx:o}),ge.$set(Bo);const I={};g&2&&(I.$$scope={dirty:g,ctx:o}),ye.$set(I);const Vo={};g&2&&(Vo.$$scope={dirty:g,ctx:o}),we.$set(Vo);const zo={};g&2&&(zo.$$scope={dirty:g,ctx:o}),Se.$set(zo);const Ro={};g&2&&(Ro.$$scope={dirty:g,ctx:o}),Te.$set(Ro);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:o}),Pe.$set(Yo);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:o}),Ee.$set(Xo)},i(o){dn||(D(n.$$.fragment,o),D(fe.$$.fragment,o),D(ze.$$.fragment,o),D(Re.$$.fragment,o),D(Xe.$$.fragment,o),D(me.$$.fragment,o),D(qe.$$.fragment,o),D(he.$$.fragment,o),D(ge.$$.fragment,o),D(Oe.$$.fragment,o),D(Qe.$$.fragment,o),D(Ke.$$.fragment,o),D(tt.$$.fragment,o),D(ye.$$.fragment,o),D(we.$$.fragment,o),D(it.$$.fragment,o),D(rt.$$.fragment,o),D(lt.$$.fragment,o),D(ct.$$.fragment,o),D(Se.$$.fragment,o),D(Te.$$.fragment,o),D(mt.$$.fragment,o),D(Pe.$$.fragment,o),D(ht.$$.fragment,o),D(bt.$$.fragment,o),D(vt.$$.fragment,o),D(yt.$$.fragment,o),D(wt.$$.fragment,o),D(xt.$$.fragment,o),D($t.$$.fragment,o),D(St.$$.fragment,o),D(Ee.$$.fragment,o),D(Tt.$$.fragment,o),D(Pt.$$.fragment,o),D(Mt.$$.fragment,o),dn=!0)},o(o){S(n.$$.fragment,o),S(fe.$$.fragment,o),S(ze.$$.fragment,o),S(Re.$$.fragment,o),S(Xe.$$.fragment,o),S(me.$$.fragment,o),S(qe.$$.fragment,o),S(he.$$.fragment,o),S(ge.$$.fragment,o),S(Oe.$$.fragment,o),S(Qe.$$.fragment,o),S(Ke.$$.fragment,o),S(tt.$$.fragment,o),S(ye.$$.fragment,o),S(we.$$.fragment,o),S(it.$$.fragment,o),S(rt.$$.fragment,o),S(lt.$$.fragment,o),S(ct.$$.fragment,o),S(Se.$$.fragment,o),S(Te.$$.fragment,o),S(mt.$$.fragment,o),S(Pe.$$.fragment,o),S(ht.$$.fragment,o),S(bt.$$.fragment,o),S(vt.$$.fragment,o),S(yt.$$.fragment,o),S(wt.$$.fragment,o),S(xt.$$.fragment,o),S($t.$$.fragment,o),S(St.$$.fragment,o),S(Ee.$$.fragment,o),S(Tt.$$.fragment,o),S(Pt.$$.fragment,o),S(Mt.$$.fragment,o),dn=!1},d(o){t(f),o&&t(b),o&&t(h),T(n),o&&t(ce),o&&t(J),o&&t(Ho),o&&t(Ft),o&&t(Qo),o&&t(Gt),o&&t(Ko),T(fe,o),o&&t(en),o&&t(ne),T(ze),o&&t(tn),o&&t(y),T(Re),T(Xe),T(me),T(qe),T(he),T(ge),T(Oe),T(Qe),T(Ke),T(tt),T(ye),T(we),T(it),T(rt),T(lt),T(ct),T(Se),T(Te),T(mt),T(Pe),T(ht),T(bt),T(vt),o&&t(on),o&&t(ae),T(yt),o&&t(nn),o&&t(re),T(wt),o&&t(sn),o&&t(le),T(xt),o&&t(an),o&&t(F),T($t),T(St),T(Ee),o&&t(rn),o&&t(de),T(Tt),o&&t(ln),o&&t(H),T(Pt),T(Mt)}}}const el={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 tl(M){return Ar(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ll extends Gr{constructor(f){super();Cr(this,f,tl,Kr,Nr,{})}}export{ll as default,el as metadata};
