import{S as zr,i as Yr,s as qr,e as n,k as d,w as y,t as a,M as Xr,c as i,d as t,m as c,a as s,x as w,h as r,b as f,G as e,g as b,y as x,q as $,o as D,B as S,v as Or,L as oo}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Rr}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as no}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Xo}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as to}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Hr(J){let p,M,h,u,v,l,m,oe,B,ce,T,A,V,Fe,R,z,Le;return{c(){p=n("p"),M=a("Make sure to check out the Stable Diffusion "),h=n("a"),u=a("Tips"),v=a(" 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"),oe=a("If you\u2019re interested in using one of the official checkpoints for a task, explore the "),B=n("a"),ce=a("CompVis"),T=a(", "),A=n("a"),V=a("Runway"),Fe=a(", and "),R=n("a"),z=a("Stability AI"),Le=a(" Hub organizations!"),this.h()},l(Z){p=i(Z,"P",{});var U=s(p);M=r(U,"Make sure to check out the Stable Diffusion "),h=i(U,"A",{href:!0});var kt=s(h);u=r(kt,"Tips"),kt.forEach(t),v=r(U," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),U.forEach(t),l=c(Z),m=i(Z,"P",{});var G=s(m);oe=r(G,"If you\u2019re interested in using one of the official checkpoints for a task, explore the "),B=i(G,"A",{href:!0,rel:!0});var H=s(B);ce=r(H,"CompVis"),H.forEach(t),T=r(G,", "),A=i(G,"A",{href:!0,rel:!0});var Jt=s(A);V=r(Jt,"Runway"),Jt.forEach(t),Fe=r(G,", and "),R=i(G,"A",{href:!0,rel:!0});var Et=s(R);z=r(Et,"Stability AI"),Et.forEach(t),Le=r(G," Hub organizations!"),G.forEach(t),this.h()},h(){f(h,"href","overview#tips"),f(B,"href","https://huggingface.co/CompVis"),f(B,"rel","nofollow"),f(A,"href","https://huggingface.co/runwayml"),f(A,"rel","nofollow"),f(R,"href","https://huggingface.co/stabilityai"),f(R,"rel","nofollow")},m(Z,U){b(Z,p,U),e(p,M),e(p,h),e(h,u),e(p,v),b(Z,l,U),b(Z,m,U),e(m,oe),e(m,B),e(B,ce),e(m,T),e(m,A),e(A,V),e(m,Fe),e(m,R),e(R,z),e(m,Le)},d(Z){Z&&t(p),Z&&t(l),Z&&t(m)}}}function Qr(J){let p,M,h,u,v;return u=new no({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(){p=n("p"),M=a("Examples:"),h=d(),y(u.$$.fragment)},l(l){p=i(l,"P",{});var m=s(p);M=r(m,"Examples:"),m.forEach(t),h=c(l),w(u.$$.fragment,l)},m(l,m){b(l,p,m),e(p,M),b(l,h,m),x(u,l,m),v=!0},p:oo,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){D(u.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(h),S(u,l)}}}function Kr(J){let p,M;return{c(){p=n("p"),M=a(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(h){p=i(h,"P",{});var u=s(p);M=r(u,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),u.forEach(t)},m(h,u){b(h,p,u),e(p,M)},d(h){h&&t(p)}}}function el(J){let p,M,h,u,v;return u=new no({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){p=n("p"),M=a("Examples:"),h=d(),y(u.$$.fragment)},l(l){p=i(l,"P",{});var m=s(p);M=r(m,"Examples:"),m.forEach(t),h=c(l),w(u.$$.fragment,l)},m(l,m){b(l,p,m),e(p,M),b(l,h,m),x(u,l,m),v=!0},p:oo,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){D(u.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(h),S(u,l)}}}function tl(J){let p,M,h,u,v;return u=new no({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(){p=n("p"),M=a("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),h=d(),y(u.$$.fragment)},l(l){p=i(l,"P",{});var m=s(p);M=r(m,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),m.forEach(t),h=c(l),w(u.$$.fragment,l)},m(l,m){b(l,p,m),e(p,M),b(l,h,m),x(u,l,m),v=!0},p:oo,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){D(u.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(h),S(u,l)}}}function ol(J){let p,M,h,u,v;return u=new no({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(){p=n("p"),M=a("locally:"),h=d(),y(u.$$.fragment)},l(l){p=i(l,"P",{});var m=s(p);M=r(m,"locally:"),m.forEach(t),h=c(l),w(u.$$.fragment,l)},m(l,m){b(l,p,m),e(p,M),b(l,h,m),x(u,l,m),v=!0},p:oo,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){D(u.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(h),S(u,l)}}}function nl(J){let p,M,h,u,v;return u=new no({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(){p=n("p"),M=a("Examples:"),h=d(),y(u.$$.fragment)},l(l){p=i(l,"P",{});var m=s(p);M=r(m,"Examples:"),m.forEach(t),h=c(l),w(u.$$.fragment,l)},m(l,m){b(l,p,m),e(p,M),b(l,h,m),x(u,l,m),v=!0},p:oo,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){D(u.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(h),S(u,l)}}}function il(J){let p,M,h,u,v;return u=new no({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(){p=n("p"),M=a("Examples:"),h=d(),y(u.$$.fragment)},l(l){p=i(l,"P",{});var m=s(p);M=r(m,"Examples:"),m.forEach(t),h=c(l),w(u.$$.fragment,l)},m(l,m){b(l,p,m),e(p,M),b(l,h,m),x(u,l,m),v=!0},p:oo,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){D(u.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(h),S(u,l)}}}function sl(J){let p,M,h,u,v,l,m,oe,B,ce,T,A,V,Fe,R,z,Le,Z,U,kt,G,H,Jt,Et,Ut,Wn,Cn,Ne,Gn,Fn,Oo,It,Ln,Ho,jt,Be,Nn,Ae,Bn,An,Qo,fe,Ko,ne,pe,io,Ve,Vn,so,Rn,en,_,Re,zn,ao,Yn,qn,ze,Xn,Zt,On,Hn,Qn,ro,Kn,ei,Y,Wt,Ct,ti,oi,ni,Gt,Ft,ii,si,ai,Lt,Nt,ri,li,di,ue,Bt,ci,fi,lo,pi,ui,mi,Q,Ye,hi,co,gi,_i,me,bi,he,qe,vi,fo,yi,wi,ge,Xe,xi,Oe,$i,po,Di,Si,Pi,_e,He,Mi,uo,Ti,ki,be,Qe,Ji,Ke,Ei,mo,Ui,Ii,ji,F,et,Zi,tt,Wi,ot,Ci,Gi,Fi,ve,Li,ye,Ni,we,nt,Bi,it,Ai,st,Vi,Ri,zi,xe,at,Yi,ho,qi,Xi,$e,rt,Oi,lt,Hi,go,Qi,Ki,es,I,dt,ts,ct,os,At,ns,is,ss,_o,as,rs,De,ls,ft,ds,pt,cs,fs,ps,Se,us,K,ut,ms,W,hs,Vt,gs,_s,bo,bs,vs,vo,ys,ws,yo,xs,$s,Ds,Pe,Ss,j,mt,Ps,q,Ms,wo,Ts,ks,xo,Js,Es,$o,Us,Is,js,ht,Zs,Do,Ws,Cs,Gs,gt,Fs,Rt,Ls,Ns,Bs,ie,As,zt,Vs,Rs,So,zs,Ys,qs,se,Xs,Yt,Os,Hs,Po,Qs,Ks,ea,Me,_t,ta,Mo,oa,na,Te,bt,ia,X,sa,To,aa,ra,ko,la,da,Jo,ca,fa,tn,ae,ke,Eo,vt,pa,Uo,ua,on,re,yt,ma,Io,ha,nn,le,Je,jo,wt,ga,Zo,_a,sn,C,xt,ba,Wo,va,ya,$t,wa,qt,xa,$a,Da,ee,Dt,Sa,Co,Pa,Ma,Ee,an,de,Ue,Go,St,Ta,Fo,ka,rn,O,Pt,Ja,Lo,Ea,Ua,Ie,Mt,Ia,No,ja,ln;return l=new Xo({}),fe=new Rr({props:{$$slots:{default:[Hr]},$$scope:{ctx:J}}}),Ve=new Xo({}),Re=new k({props:{name:"class diffusers.StableDiffusionPipeline",anchor:"diffusers.StableDiffusionPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.19.2/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.19.2/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.19.2/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.19.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.19.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.19.2/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.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L72"}}),Ye=new k({props:{name:"__call__",anchor:"diffusers.StableDiffusionPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"guidance_rescale",val:": float = 0.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.19.2/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.19.2/en/api/pipelines/stable_diffusion/inpaint#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/cross_attention.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.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L515",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.19.2/en/api/pipelines/stable_diffusion/inpaint#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.19.2/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),me=new to({props:{anchor:"diffusers.StableDiffusionPipeline.__call__.example",$$slots:{default:[Qr]},$$scope:{ctx:J}}}),qe=new k({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/pipeline_utils.py#L1669"}}),Xe=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/pipeline_utils.py#L1684"}}),He=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L196"}}),Qe=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L203"}}),et=new k({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/pipeline_utils.py#L1608"}}),ve=new Rr({props:{warning:!0,$$slots:{default:[Kr]},$$scope:{ctx:J}}}),ye=new to({props:{anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[el]},$$scope:{ctx:J}}}),nt=new k({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/pipeline_utils.py#L1643"}}),at=new k({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L210"}}),rt=new k({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L218"}}),dt=new k({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**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.19.2/src/diffusers/loaders.py#L648"}}),De=new to({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example",$$slots:{default:[tl]},$$scope:{ctx:J}}}),Se=new to({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example-2",$$slots:{default:[ol]},$$scope:{ctx:J}}}),ut=new k({props:{name:"from_single_file",anchor:"diffusers.StableDiffusionPipeline.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to extract the EMA weights or not. Pass <code>True</code> to extract the EMA weights which usually yield
higher quality images for inference. Non-EMA weights are usually better for continuing finetuning.`,name:"extract_ema"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type the model was trained on. Use <code>&apos;epsilon&apos;</code> for all Stable Diffusion v1 models and
the Stable Diffusion v2 base model. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of input channels. If <code>None</code>, it is automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pndm&quot;</code>) &#x2014;
Type of scheduler to use. Should be one of <code>[&quot;pndm&quot;, &quot;lms&quot;, &quot;heun&quot;, &quot;euler&quot;, &quot;euler-ancestral&quot;, &quot;dpm&quot;, &quot;ddim&quot;]</code>.`,name:"scheduler_type"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.load_safety_checker",description:`<strong>load_safety_checker</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to load the safety checker or not.`,name:"load_safety_checker"},{anchor:"diffusers.StableDiffusionPipeline.from_single_file.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/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.19.2/src/diffusers/loaders.py#L1735"}}),Pe=new to({props:{anchor:"diffusers.StableDiffusionPipeline.from_single_file.example",$$slots:{default:[nl]},$$scope:{ctx:J}}}),mt=new k({props:{name:"load_lora_weights",anchor:"diffusers.StableDiffusionPipeline.load_lora_weights",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
See <a href="/docs/diffusers/v0.19.2/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.19.2/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/loaders.py#L925"}}),_t=new k({props:{name:"save_lora_weights",anchor:"diffusers.StableDiffusionPipeline.save_lora_weights",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"unet_lora_layers",val:": typing.Dict[str, typing.Union[torch.nn.modules.module.Module, torch.Tensor]] = None"},{name:"text_encoder_lora_layers",val:": typing.Dict[str, torch.nn.modules.module.Module] = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = False"}],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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/loaders.py#L1418"}}),bt=new k({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L225"}}),vt=new Xo({}),yt=new k({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.2/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),wt=new Xo({}),xt=new k({props:{name:"class diffusers.FlaxStableDiffusionPipeline",anchor:"diffusers.FlaxStableDiffusionPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.19.2/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.19.2/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.19.2/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.19.2/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py#L81"}}),Dt=new k({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"num_inference_steps",val:": int = 50"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"latents",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation.`,name:"prompt"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.latents",description:`<strong>latents</strong> (<code>jnp.array</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
array is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>This argument exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a
future release.</p>

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