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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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