import{S as il,i as sl,s as al,e as n,k as d,w,t as a,M as rl,c as i,d as t,m as c,a as s,x,h as r,b as p,G as e,g as v,y as $,q as D,o as S,B as T,v as ll,L as Zt}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Ha}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as E}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as Wt}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as nn}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as jt}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function dl(M){let f,y,h,m,_,l,u,F,V,fe,J,R,z,Be,Y,q,Ve;return{c(){f=n("p"),y=a("Make sure to check out the Stable Diffusion "),h=n("a"),m=a("Tips"),_=a(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),l=d(),u=n("p"),F=a("If you\u2019re interested in using one of the official checkpoints for a task, explore the "),V=n("a"),fe=a("CompVis"),J=a(", "),R=n("a"),z=a("Runway"),Be=a(", and "),Y=n("a"),q=a("Stability AI"),Ve=a(" Hub organizations!"),this.h()},l(Z){f=i(Z,"P",{});var k=s(f);y=r(k,"Make sure to check out the Stable Diffusion "),h=i(k,"A",{href:!0});var Gt=s(h);m=r(Gt,"Tips"),Gt.forEach(t),_=r(k," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),k.forEach(t),l=c(Z),u=i(Z,"P",{});var C=s(u);F=r(C,"If you\u2019re interested in using one of the official checkpoints for a task, explore the "),V=i(C,"A",{href:!0,rel:!0});var K=s(V);fe=r(K,"CompVis"),K.forEach(t),J=r(C,", "),R=i(C,"A",{href:!0,rel:!0});var Ft=s(R);z=r(Ft,"Runway"),Ft.forEach(t),Be=r(C,", and "),Y=i(C,"A",{href:!0,rel:!0});var Ct=s(Y);q=r(Ct,"Stability AI"),Ct.forEach(t),Ve=r(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(R,"href","https://huggingface.co/runwayml"),p(R,"rel","nofollow"),p(Y,"href","https://huggingface.co/stabilityai"),p(Y,"rel","nofollow")},m(Z,k){v(Z,f,k),e(f,y),e(f,h),e(h,m),e(f,_),v(Z,l,k),v(Z,u,k),e(u,F),e(u,V),e(V,fe),e(u,J),e(u,R),e(R,z),e(u,Be),e(u,Y),e(Y,q),e(u,Ve)},d(Z){Z&&t(f),Z&&t(l),Z&&t(u)}}}function cl(M){let f,y,h,m,_;return m=new Wt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMG9uJTIwbWFycyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){f=n("p"),y=a("Examples:"),h=d(),w(m.$$.fragment)},l(l){f=i(l,"P",{});var u=s(f);y=r(u,"Examples:"),u.forEach(t),h=c(l),x(m.$$.fragment,l)},m(l,u){v(l,f,u),e(f,y),v(l,h,u),$(m,l,u),_=!0},p:Zt,i(l){_||(D(m.$$.fragment,l),_=!0)},o(l){S(m.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),T(m,l)}}}function hl(M){let f,y,h,m,_;return m=new Wt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

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

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){f=n("p"),y=a("locally:"),h=d(),w(m.$$.fragment)},l(l){f=i(l,"P",{});var u=s(f);y=r(u,"locally:"),u.forEach(t),h=c(l),x(m.$$.fragment,l)},m(l,u){v(l,f,u),e(f,y),v(l,h,u),$(m,l,u),_=!0},p:Zt,i(l){_||(D(m.$$.fragment,l),_=!0)},o(l){S(m.$$.fragment,l),_=!1},d(l){l&&t(f),l&&t(h),T(m,l)}}}function _l(M){let f,y,h,m,_;return m=new Wt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGV2Fycmlvck1hbWE3NzclMkZPcmFuZ2VNaXhzJTJGYmxvYiUyRm1haW4lMkZNb2RlbHMlMkZBYnlzc09yYW5nZU1peCUyRkFieXNzT3JhbmdlTWl4LnNhZmV0ZW5zb3JzJTIyJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwbG9jYWwlMjBmaWxlJTBBJTIzJTIwZmlsZSUyMGlzJTIwZG93bmxvYWRlZCUyMHVuZGVyJTIwLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuY2twdCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMjIuJTJGdjEtNS1wcnVuZWQtZW1hb25seSUyMiklMEElMEElMjMlMjBFbmFibGUlMjBmbG9hdDE2JTIwYW5kJTIwbW92ZSUyMHRvJTIwR1BVJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix.safetensors&quot;</span>
<span class="hljs-meta">... </span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline, params = FlaxStableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, revision=<span class="hljs-string">&quot;bf16&quot;</span>, dtype=jax.numpy.bfloat16
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>prng_seed = jax.random.PRNGKey(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>num_inference_steps = <span class="hljs-number">50</span>

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

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

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

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