import{S as ir,i as lr,s as rr,e as o,k as c,w as $,t as s,M as dr,c as n,d as t,m as f,a,x as M,h as i,b as u,G as e,g as P,y as T,q as D,o as S,B as E,v as cr,L as Nt}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Sn}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as Vt}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as sr}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Bt}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function fr(J){let d,v,m,p,b;return p=new Vt({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(){d=o("p"),v=s("Examples:"),m=c(),$(p.$$.fragment)},l(r){d=n(r,"P",{});var h=a(d);v=i(h,"Examples:"),h.forEach(t),m=f(r),M(p.$$.fragment,r)},m(r,h){P(r,d,h),e(d,v),P(r,m,h),T(p,r,h),b=!0},p:Nt,i(r){b||(D(p.$$.fragment,r),b=!0)},o(r){S(p.$$.fragment,r),b=!1},d(r){r&&t(d),r&&t(m),E(p,r)}}}function pr(J){let d,v,m,p,b;return p=new Vt({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(){d=o("p"),v=s("Examples:"),m=c(),$(p.$$.fragment)},l(r){d=n(r,"P",{});var h=a(d);v=i(h,"Examples:"),h.forEach(t),m=f(r),M(p.$$.fragment,r)},m(r,h){P(r,d,h),e(d,v),P(r,m,h),T(p,r,h),b=!0},p:Nt,i(r){b||(D(p.$$.fragment,r),b=!0)},o(r){S(p.$$.fragment,r),b=!1},d(r){r&&t(d),r&&t(m),E(p,r)}}}function ur(J){let d,v;return{c(){d=o("p"),v=s("This function is experimental and might change in the future.")},l(m){d=n(m,"P",{});var p=a(d);v=i(p,"This function is experimental and might change in the future."),p.forEach(t)},m(m,p){P(m,d,p),e(d,v)},d(m){m&&t(d)}}}function mr(J){let d,v,m,p,b,r,h,k;return{c(){d=o("p"),v=s("It is required to be logged in ("),m=o("code"),p=s("huggingface-cli login"),b=s(") when you want to use private or "),r=o("a"),h=s(`gated
models`),k=s("."),this.h()},l(_){d=n(_,"P",{});var x=a(d);v=i(x,"It is required to be logged in ("),m=n(x,"CODE",{});var U=a(m);p=i(U,"huggingface-cli login"),U.forEach(t),b=i(x,") when you want to use private or "),r=n(x,"A",{href:!0,rel:!0});var F=a(r);h=i(F,`gated
models`),F.forEach(t),k=i(x,"."),x.forEach(t),this.h()},h(){u(r,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),u(r,"rel","nofollow")},m(_,x){P(_,d,x),e(d,v),e(d,m),e(m,p),e(d,b),e(d,r),e(r,h),e(d,k)},d(_){_&&t(d)}}}function hr(J){let d,v,m,p,b,r,h,k;return h=new Vt({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(){d=o("p"),v=s("To load a textual inversion embedding vector in "),m=o("code"),p=s("diffusers"),b=s(" format:"),r=c(),$(h.$$.fragment)},l(_){d=n(_,"P",{});var x=a(d);v=i(x,"To load a textual inversion embedding vector in "),m=n(x,"CODE",{});var U=a(m);p=i(U,"diffusers"),U.forEach(t),b=i(x," format:"),x.forEach(t),r=f(_),M(h.$$.fragment,_)},m(_,x){P(_,d,x),e(d,v),e(d,m),e(m,p),e(d,b),P(_,r,x),T(h,_,x),k=!0},p:Nt,i(_){k||(D(h.$$.fragment,_),k=!0)},o(_){S(h.$$.fragment,_),k=!1},d(_){_&&t(d),_&&t(r),E(h,_)}}}function gr(J){let d,v,m,p,b,r,h,k;return h=new Vt({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(){d=o("p"),v=s("e.g. from "),m=o("a"),p=s("civitAI"),b=s(" and then load the vector locally:"),r=c(),$(h.$$.fragment),this.h()},l(_){d=n(_,"P",{});var x=a(d);v=i(x,"e.g. from "),m=n(x,"A",{href:!0,rel:!0});var U=a(m);p=i(U,"civitAI"),U.forEach(t),b=i(x," and then load the vector locally:"),x.forEach(t),r=f(_),M(h.$$.fragment,_),this.h()},h(){u(m,"href","https://civitai.com/models/3036?modelVersionId=9857"),u(m,"rel","nofollow")},m(_,x){P(_,d,x),e(d,v),e(d,m),e(m,p),e(d,b),P(_,r,x),T(h,_,x),k=!0},p:Nt,i(_){k||(D(h.$$.fragment,_),k=!0)},o(_){S(h.$$.fragment,_),k=!1},d(_){_&&t(d),_&&t(r),E(h,_)}}}function _r(J){let d,v,m,p,b;return p=new Vt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9ja3B0KCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZXYXJyaW9yTWFtYTc3NyUyRk9yYW5nZU1peHMlMkZibG9iJTJGbWFpbiUyRk1vZGVscyUyRkFieXNzT3JhbmdlTWl4JTJGQWJ5c3NPcmFuZ2VNaXguc2FmZXRlbnNvcnMlMjIlMEEpJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBsb2NhbCUyMGZpbGUlMEElMjMlMjBmaWxlJTIwaXMlMjBkb3dubG9hZGVkJTIwdW5kZXIlMjAuJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX2NrcHQoJTIyLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHklMjIpJTBBJTBBJTIzJTIwRW5hYmxlJTIwZmxvYXQxNiUyMGFuZCUyMG1vdmUlMjB0byUyMEdQVSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9ja3B0KCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",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_ckpt(
<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_ckpt(<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_ckpt(
<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(){d=o("p"),v=s("Examples:"),m=c(),$(p.$$.fragment)},l(r){d=n(r,"P",{});var h=a(d);v=i(h,"Examples:"),h.forEach(t),m=f(r),M(p.$$.fragment,r)},m(r,h){P(r,d,h),e(d,v),P(r,m,h),T(p,r,h),b=!0},p:Nt,i(r){b||(D(p.$$.fragment,r),b=!0)},o(r){S(p.$$.fragment,r),b=!1},d(r){r&&t(d),r&&t(m),E(p,r)}}}function br(J){let d,v,m,p,b;return{c(){d=o("p"),v=s("We support loading A1111 formatted LoRA checkpoints in a limited capacity."),m=c(),p=o("p"),b=s("This function is experimental and might change in the future.")},l(r){d=n(r,"P",{});var h=a(d);v=i(h,"We support loading A1111 formatted LoRA checkpoints in a limited capacity."),h.forEach(t),m=f(r),p=n(r,"P",{});var k=a(p);b=i(k,"This function is experimental and might change in the future."),k.forEach(t)},m(r,h){P(r,d,h),e(d,v),P(r,m,h),P(r,p,h),e(p,b)},d(r){r&&t(d),r&&t(m),r&&t(p)}}}function vr(J){let d,v,m,p,b,r,h,k;return{c(){d=o("p"),v=s("It is required to be logged in ("),m=o("code"),p=s("huggingface-cli login"),b=s(") when you want to use private or "),r=o("a"),h=s(`gated
models`),k=s("."),this.h()},l(_){d=n(_,"P",{});var x=a(d);v=i(x,"It is required to be logged in ("),m=n(x,"CODE",{});var U=a(m);p=i(U,"huggingface-cli login"),U.forEach(t),b=i(x,") when you want to use private or "),r=n(x,"A",{href:!0,rel:!0});var F=a(r);h=i(F,`gated
models`),F.forEach(t),k=i(x,"."),x.forEach(t),this.h()},h(){u(r,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),u(r,"rel","nofollow")},m(_,x){P(_,d,x),e(d,v),e(d,m),e(m,p),e(d,b),e(d,r),e(r,h),e(d,k)},d(_){_&&t(d)}}}function yr(J){let d,v,m,p,b;return p=new Vt({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(){d=o("p"),v=s("Examples:"),m=c(),$(p.$$.fragment)},l(r){d=n(r,"P",{});var h=a(d);v=i(h,"Examples:"),h.forEach(t),m=f(r),M(p.$$.fragment,r)},m(r,h){P(r,d,h),e(d,v),P(r,m,h),T(p,r,h),b=!0},p:Nt,i(r){b||(D(p.$$.fragment,r),b=!0)},o(r){S(p.$$.fragment,r),b=!1},d(r){r&&t(d),r&&t(m),E(p,r)}}}function wr(J){let d,v,m,p,b,r,h,k,_,x,U,F,Lt,Me,En,At,Pn,qo,C,kn,Te,Jn,Un,De,In,jn,Se,Cn,Zn,Ee,Wn,Gn,xt,Fn,Bn,Xo,$t,Nn,zo,ne,Pe,Rt,Vn,Ln,ke,An,Rn,Je,qt,qn,Xn,Ue,zn,Yo,Mt,Yn,Qo,Z,Ie,Xt,Qn,Hn,je,On,Kn,Ce,zt,ea,ta,Ze,oa,na,We,Yt,aa,sa,Ge,ia,la,Fe,Qt,ra,da,Be,ca,fa,Ne,Ht,pa,ua,Ve,ma,ha,Le,Ot,ga,_a,Ae,ba,Ho,g,Re,va,Kt,ya,wa,qe,xa,Tt,$a,Ma,Ta,eo,Da,Sa,K,Xe,to,Ea,Pa,Dt,ka,Ja,ze,oo,Ua,Ia,St,ja,Ca,Ye,no,Za,Wa,Et,Ga,Fa,ao,Ba,Na,so,Qe,io,Va,La,Pt,Aa,Ra,q,He,qa,lo,Xa,za,ae,Ya,X,Oe,Qa,ro,Ha,Oa,co,Ka,es,se,Ke,ts,et,os,fo,ns,as,ss,z,tt,is,po,ls,rs,uo,ds,cs,ie,ot,fs,nt,ps,mo,us,ms,hs,B,at,gs,ho,_s,bs,go,vs,ys,_o,ws,xs,le,$s,re,st,Ms,bo,Ts,Ds,Y,it,Ss,vo,Es,Ps,yo,ks,Js,de,lt,Us,rt,Is,wo,js,Cs,Zs,I,dt,Ws,ee,Gs,xo,Fs,Bs,$o,Ns,Vs,Ls,ce,As,fe,Rs,Mo,qs,Xs,pe,zs,To,Ys,Qs,ue,Hs,L,ct,Os,Do,Ks,ei,ft,ti,So,oi,ni,ai,me,si,A,pt,ii,te,li,kt,ri,di,ut,Eo,ci,fi,pi,he,ui,ge,mi,_e,mt,hi,Po,gi,_i,be,ht,bi,N,vi,ko,yi,wi,Jo,xi,$i,Uo,Mi,Ti,Io,Di,Si,Ei,ve,gt,Pi,oe,ki,jo,Ji,Ui,Co,Ii,ji,Oo,V,_t,Ci,Zo,Zi,Wi,bt,Gi,Wo,Fi,Bi,Ni,Q,vt,Vi,Go,Li,Ai,ye,Ko;return r=new sr({}),Me=new sr({}),Re=new j({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.17.0/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.0/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.17.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.17.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.17.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L72"}}),He=new j({props:{name:"__call__",anchor:"diffusers.StableDiffusionPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"guidance_rescale",val:": float = 0.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#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 self.unet.config.sample_size * self.vae_scale_factor) &#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;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,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 not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionPipeline.__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;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,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;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</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 will ge 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, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionPipeline.__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, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionPipeline.__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 generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.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.17.0/en/api/pipelines/stable_diffusion/overview#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 will be called every <code>callback_steps</code> steps during inference. The function will be
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 will be called. If not specified, the callback will be
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 under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</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 proposed by <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a> <code>guidance_scale</code> is defined as <code>&#x3C6;</code> in equation 16. of
<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.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L564",returnDescription:`
<p><a
  href="/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),ae=new Bt({props:{anchor:"diffusers.StableDiffusionPipeline.__call__.example",$$slots:{default:[fr]},$$scope:{ctx:J}}}),Oe=new j({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.17.0/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),Ke=new j({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/pipeline_utils.py#L1508"}}),tt=new j({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L199"}}),ot=new j({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L208"}}),at=new j({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.17.0/src/diffusers/pipelines/pipeline_utils.py#L1434"}}),le=new Bt({props:{anchor:"diffusers.StableDiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[pr]},$$scope:{ctx:J}}}),st=new j({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/pipeline_utils.py#L1466"}}),it=new j({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L215"}}),lt=new j({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L224"}}),dt=new j({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:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like
<code>&quot;sd-concepts-library/low-poly-hd-logos-icons&quot;</code>.</li>
<li>A path to a <em>directory</em> containing textual inversion weights, e.g.
<code>./my_text_inversion_directory/</code>.</li>
<li>A path to a <em>file</em> containing textual inversion weights, e.g. <code>./my_text_inversions.pt</code>.</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>
<p>Or a list of those elements.`,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 in two cases:</p>
<ul>
<li>The saved textual inversion file is in <code>diffusers</code> 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 &#x201C;Automatic1111&#x201D; form.</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 in which a downloaded pretrained model configuration should be cached if the
standard cache should not be 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 delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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, e.g., <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(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be 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;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/loaders.py#L482"}}),ce=new Sn({props:{warning:!0,$$slots:{default:[ur]},$$scope:{ctx:J}}}),fe=new Sn({props:{$$slots:{default:[mr]},$$scope:{ctx:J}}}),pe=new Bt({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example",$$slots:{default:[hr]},$$scope:{ctx:J}}}),ue=new Bt({props:{anchor:"diffusers.StableDiffusionPipeline.load_textual_inversion.example-2",$$slots:{default:[gr]},$$scope:{ctx:J}}}),ct=new j({props:{name:"from_ckpt",anchor:"diffusers.StableDiffusionPipeline.from_ckpt",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.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 .ckpt file on the Hub. Should be in the format
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;&quot;</code></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_ckpt.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 under this dtype. If <code>&quot;auto&quot;</code> is passed the dtype
will be automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.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_ckpt.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.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, e.g., <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_ckpt.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.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>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.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 pipeline will load the <code>safetensors</code> weights if they&#x2019;re available <strong>and</strong> if the
<code>safetensors</code> library is installed. If set to <code>True</code>, the pipeline will forcibly load the models from
<code>safetensors</code> weights. If set to <code>False</code> the pipeline will <em>not</em> use <code>safetensors</code>.`,name:"use_safetensors"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Only relevant for
checkpoints that have both EMA and non-EMA weights. Whether to extract the EMA weights or not. Defaults
to <code>False</code>. Pass <code>True</code> to extract the EMA weights. EMA weights usually yield higher quality images for
inference. Non-EMA weights are usually better to continue fine-tuning.`,name:"extract_ema"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.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. This is necessary when running stable`,name:"upcast_attention"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size that the model was trained on. Use 512 for Stable Diffusion v1.X and Stable Diffusion v2
Base. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type that the model was trained on. Use <code>&apos;epsilon&apos;</code> for Stable Diffusion v1.X and Stable
Diffusion v2 Base. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to None) &#x2014;
The number of input channels. If <code>None</code>, it will be automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to &#x2018;pndm&#x2019;) &#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_ckpt.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. Defaults to <code>True</code>.`,name:"load_safety_checker"},{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load - and saveable variables - <em>i.e.</em> the pipeline components - of the
specific pipeline class. The overwritten components are then 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.17.0/src/diffusers/loaders.py#L1337"}}),me=new Bt({props:{anchor:"diffusers.StableDiffusionPipeline.from_ckpt.example",$$slots:{default:[_r]},$$scope:{ctx:J}}}),pt=new j({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;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like <code>google/ddpm-celebahq-256</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using <code>~ModelMixin.save_config</code>, e.g.,
<code>./my_model_directory/</code>.</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_or_dict"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.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_lora_weights.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.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, e.g., <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_lora_weights.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionPipeline.load_lora_weights.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/loaders.py#L781"}}),he=new Sn({props:{warning:!0,$$slots:{default:[br]},$$scope:{ctx:J}}}),ge=new Sn({props:{$$slots:{default:[vr]},$$scope:{ctx:J}}}),mt=new j({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 which to save. 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 UNet. Specifying this helps to make the
serialization process easier and cleaner. Values can be both LoRA torch.nn.Modules layers or torch
weights.`,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] or </code>Dict[str, torch.Tensor]<code>) -- State dict of the LoRA layers corresponding to the </code>text_encoder<code>. Since the </code>text_encoder<code>comes from</code>transformers`, we cannot rejig it. That is why we have to explicitly pass the text encoder LoRA state\ndict. Values can be both LoRA torch.nn.Modules layers or torch weights.",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 when in distributed training like
TPUs and 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 on distributed training like TPUs when one
need to replace <code>torch.save</code> by 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.17.0/src/diffusers/loaders.py#L1201"}}),ht=new j({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.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L256"}}),gt=new j({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L231"}}),_t=new j({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.17.0/en/api/models#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.0/en/api/models#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py#L81"}}),vt=new j({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>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#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 self.unet.config.sample_size * self.vae_scale_factor) &#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;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,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. tensor will ge 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. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,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 <code>FlaxStableDiffusionPipelineOutput</code> instead of
a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py#L311",returnDescription:`
<p><code>FlaxStableDiffusionPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>FlaxStableDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),ye=new Bt({props:{anchor:"diffusers.FlaxStableDiffusionPipeline.__call__.example",$$slots:{default:[yr]},$$scope:{ctx:J}}}),{c(){d=o("meta"),v=c(),m=o("h1"),p=o("a"),b=o("span"),$(r.$$.fragment),h=c(),k=o("span"),_=s("Text-to-Image Generation"),x=c(),U=o("h2"),F=o("a"),Lt=o("span"),$(Me.$$.fragment),En=c(),At=o("span"),Pn=s("StableDiffusionPipeline"),qo=c(),C=o("p"),kn=s("The Stable Diffusion model was created by the researchers and engineers from "),Te=o("a"),Jn=s("CompVis"),Un=s(", "),De=o("a"),In=s("Stability AI"),jn=s(", "),Se=o("a"),Cn=s("runway"),Zn=s(", and "),Ee=o("a"),Wn=s("LAION"),Gn=s(". The "),xt=o("a"),Fn=s("StableDiffusionPipeline"),Bn=s(" is capable of generating photo-realistic images given any text input using Stable Diffusion."),Xo=c(),$t=o("p"),Nn=s("The original codebase can be found here:"),zo=c(),ne=o("ul"),Pe=o("li"),Rt=o("em"),Vn=s("Stable Diffusion V1"),Ln=s(": "),ke=o("a"),An=s("CompVis/stable-diffusion"),Rn=c(),Je=o("li"),qt=o("em"),qn=s("Stable Diffusion v2"),Xn=s(": "),Ue=o("a"),zn=s("Stability-AI/stablediffusion"),Yo=c(),Mt=o("p"),Yn=s("Available Checkpoints are:"),Qo=c(),Z=o("ul"),Ie=o("li"),Xt=o("em"),Qn=s("stable-diffusion-v1-4 (512x512 resolution)"),Hn=c(),je=o("a"),On=s("CompVis/stable-diffusion-v1-4"),Kn=c(),Ce=o("li"),zt=o("em"),ea=s("stable-diffusion-v1-5 (512x512 resolution)"),ta=c(),Ze=o("a"),oa=s("runwayml/stable-diffusion-v1-5"),na=c(),We=o("li"),Yt=o("em"),aa=s("stable-diffusion-2-base (512x512 resolution)"),sa=s(": "),Ge=o("a"),ia=s("stabilityai/stable-diffusion-2-base"),la=c(),Fe=o("li"),Qt=o("em"),ra=s("stable-diffusion-2 (768x768 resolution)"),da=s(": "),Be=o("a"),ca=s("stabilityai/stable-diffusion-2"),fa=c(),Ne=o("li"),Ht=o("em"),pa=s("stable-diffusion-2-1-base (512x512 resolution)"),ua=c(),Ve=o("a"),ma=s("stabilityai/stable-diffusion-2-1-base"),ha=c(),Le=o("li"),Ot=o("em"),ga=s("stable-diffusion-2-1 (768x768 resolution)"),_a=s(": "),Ae=o("a"),ba=s("stabilityai/stable-diffusion-2-1"),Ho=c(),g=o("div"),$(Re.$$.fragment),va=c(),Kt=o("p"),ya=s("Pipeline for text-to-image generation using Stable Diffusion."),wa=c(),qe=o("p"),xa=s("This model inherits from "),Tt=o("a"),$a=s("DiffusionPipeline"),Ma=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ta=c(),eo=o("p"),Da=s("In addition the pipeline inherits the following loading methods:"),Sa=c(),K=o("ul"),Xe=o("li"),to=o("em"),Ea=s("Textual-Inversion"),Pa=s(": "),Dt=o("a"),ka=s("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Ja=c(),ze=o("li"),oo=o("em"),Ua=s("LoRA"),Ia=s(": "),St=o("a"),ja=s("loaders.LoraLoaderMixin.load_lora_weights()"),Ca=c(),Ye=o("li"),no=o("em"),Za=s("Ckpt"),Wa=s(": "),Et=o("a"),Ga=s("loaders.FromCkptMixin.from_ckpt()"),Fa=c(),ao=o("p"),Ba=s("as well as the following saving methods:"),Na=c(),so=o("ul"),Qe=o("li"),io=o("em"),Va=s("LoRA"),La=s(": "),Pt=o("a"),Aa=s("loaders.LoraLoaderMixin.save_lora_weights()"),Ra=c(),q=o("div"),$(He.$$.fragment),qa=c(),lo=o("p"),Xa=s("Function invoked when calling the pipeline for generation."),za=c(),$(ae.$$.fragment),Ya=c(),X=o("div"),$(Oe.$$.fragment),Qa=c(),ro=o("p"),Ha=s("Enable sliced attention computation."),Oa=c(),co=o("p"),Ka=s(`When this option is enabled, the attention module will split 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.`),es=c(),se=o("div"),$(Ke.$$.fragment),ts=c(),et=o("p"),os=s("Disable sliced attention computation. If "),fo=o("code"),ns=s("enable_attention_slicing"),as=s(` was previously invoked, this method will go
back to computing attention in one step.`),ss=c(),z=o("div"),$(tt.$$.fragment),is=c(),po=o("p"),ls=s("Enable sliced VAE decoding."),rs=c(),uo=o("p"),ds=s(`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.`),cs=c(),ie=o("div"),$(ot.$$.fragment),fs=c(),nt=o("p"),ps=s("Disable sliced VAE decoding. If "),mo=o("code"),us=s("enable_vae_slicing"),ms=s(` was previously invoked, this method will go back to
computing decoding in one step.`),hs=c(),B=o("div"),$(at.$$.fragment),gs=c(),ho=o("p"),_s=s("Enable memory efficient attention as implemented in xformers."),bs=c(),go=o("p"),vs=s(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),ys=c(),_o=o("p"),ws=s(`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),xs=c(),$(le.$$.fragment),$s=c(),re=o("div"),$(st.$$.fragment),Ms=c(),bo=o("p"),Ts=s("Disable memory efficient attention as implemented in xformers."),Ds=c(),Y=o("div"),$(it.$$.fragment),Ss=c(),vo=o("p"),Es=s("Enable tiled VAE decoding."),Ps=c(),yo=o("p"),ks=s(`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 to save a large amount of memory and to allow the processing of larger images.`),Js=c(),de=o("div"),$(lt.$$.fragment),Us=c(),rt=o("p"),Is=s("Disable tiled VAE decoding. If "),wo=o("code"),js=s("enable_vae_tiling"),Cs=s(` was previously invoked, this method will go back to
computing decoding in one step.`),Zs=c(),I=o("div"),$(dt.$$.fragment),Ws=c(),ee=o("p"),Gs=s("Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),xo=o("code"),Fs=s("diffusers"),Bs=s(` and
`),$o=o("code"),Ns=s("Automatic1111"),Vs=s(" formats are supported (see example below)."),Ls=c(),$(ce.$$.fragment),As=c(),$(fe.$$.fragment),Rs=c(),Mo=o("p"),qs=s("Example:"),Xs=c(),$(pe.$$.fragment),zs=c(),To=o("p"),Ys=s("To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),Qs=c(),$(ue.$$.fragment),Hs=c(),L=o("div"),$(ct.$$.fragment),Os=c(),Do=o("p"),Ks=s("Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights saved in the original .ckpt format."),ei=c(),ft=o("p"),ti=s("The pipeline is set in evaluation mode by default using "),So=o("code"),oi=s("model.eval()"),ni=s(" (Dropout modules are deactivated)."),ai=c(),$(me.$$.fragment),si=c(),A=o("div"),$(pt.$$.fragment),ii=c(),te=o("p"),li=s("Load pretrained attention processor layers (such as LoRA) into "),kt=o("a"),ri=s("UNet2DConditionModel"),di=s(` and
`),ut=o("a"),Eo=o("code"),ci=s("CLIPTextModel"),fi=s(")."),pi=c(),$(he.$$.fragment),ui=c(),$(ge.$$.fragment),mi=c(),_e=o("div"),$(mt.$$.fragment),hi=c(),Po=o("p"),gi=s("Save the LoRA parameters corresponding to the UNet and the text encoder."),_i=c(),be=o("div"),$(ht.$$.fragment),bi=c(),N=o("p"),vi=s(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ko=o("code"),yi=s("enable_sequential_cpu_offload"),wi=s(", this method moves one whole model at a time to the GPU when its "),Jo=o("code"),xi=s("forward"),$i=s(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Uo=o("code"),Mi=s("enable_sequential_cpu_offload"),Ti=s(", but performance is much better due to the iterative execution of the "),Io=o("code"),Di=s("unet"),Si=s("."),Ei=c(),ve=o("div"),$(gt.$$.fragment),Pi=c(),oe=o("p"),ki=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),jo=o("code"),Ji=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ui=s("forward"),Co=o("code"),Ii=s("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),ji=s("enable_model_cpu_offload`, but performance is lower."),Oo=c(),V=o("div"),$(_t.$$.fragment),Ci=c(),Zo=o("p"),Zi=s("Pipeline for text-to-image generation using Stable Diffusion."),Wi=c(),bt=o("p"),Gi=s("This model inherits from "),Wo=o("code"),Fi=s("FlaxDiffusionPipeline"),Bi=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ni=c(),Q=o("div"),$(vt.$$.fragment),Vi=c(),Go=o("p"),Li=s("Function invoked when calling the pipeline for generation."),Ai=c(),$(ye.$$.fragment),this.h()},l(l){const w=dr('[data-svelte="svelte-1phssyn"]',document.head);d=n(w,"META",{name:!0,content:!0}),w.forEach(t),v=f(l),m=n(l,"H1",{class:!0});var yt=a(m);p=n(yt,"A",{id:!0,class:!0,href:!0});var Fo=a(p);b=n(Fo,"SPAN",{});var Bo=a(b);M(r.$$.fragment,Bo),Bo.forEach(t),Fo.forEach(t),h=f(yt),k=n(yt,"SPAN",{});var No=a(k);_=i(No,"Text-to-Image Generation"),No.forEach(t),yt.forEach(t),x=f(l),U=n(l,"H2",{class:!0});var wt=a(U);F=n(wt,"A",{id:!0,class:!0,href:!0});var Vo=a(F);Lt=n(Vo,"SPAN",{});var Lo=a(Lt);M(Me.$$.fragment,Lo),Lo.forEach(t),Vo.forEach(t),En=f(wt),At=n(wt,"SPAN",{});var Ao=a(At);Pn=i(Ao,"StableDiffusionPipeline"),Ao.forEach(t),wt.forEach(t),qo=f(l),C=n(l,"P",{});var G=a(C);kn=i(G,"The Stable Diffusion model was created by the researchers and engineers from "),Te=n(G,"A",{href:!0,rel:!0});var Ro=a(Te);Jn=i(Ro,"CompVis"),Ro.forEach(t),Un=i(G,", "),De=n(G,"A",{href:!0,rel:!0});var Ri=a(De);In=i(Ri,"Stability AI"),Ri.forEach(t),jn=i(G,", "),Se=n(G,"A",{href:!0,rel:!0});var qi=a(Se);Cn=i(qi,"runway"),qi.forEach(t),Zn=i(G,", and "),Ee=n(G,"A",{href:!0,rel:!0});var Xi=a(Ee);Wn=i(Xi,"LAION"),Xi.forEach(t),Gn=i(G,". The "),xt=n(G,"A",{href:!0});var zi=a(xt);Fn=i(zi,"StableDiffusionPipeline"),zi.forEach(t),Bn=i(G," is capable of generating photo-realistic images given any text input using Stable Diffusion."),G.forEach(t),Xo=f(l),$t=n(l,"P",{});var Yi=a($t);Nn=i(Yi,"The original codebase can be found here:"),Yi.forEach(t),zo=f(l),ne=n(l,"UL",{});var en=a(ne);Pe=n(en,"LI",{});var tn=a(Pe);Rt=n(tn,"EM",{});var Qi=a(Rt);Vn=i(Qi,"Stable Diffusion V1"),Qi.forEach(t),Ln=i(tn,": "),ke=n(tn,"A",{href:!0,rel:!0});var Hi=a(ke);An=i(Hi,"CompVis/stable-diffusion"),Hi.forEach(t),tn.forEach(t),Rn=f(en),Je=n(en,"LI",{});var on=a(Je);qt=n(on,"EM",{});var Oi=a(qt);qn=i(Oi,"Stable Diffusion v2"),Oi.forEach(t),Xn=i(on,": "),Ue=n(on,"A",{href:!0,rel:!0});var Ki=a(Ue);zn=i(Ki,"Stability-AI/stablediffusion"),Ki.forEach(t),on.forEach(t),en.forEach(t),Yo=f(l),Mt=n(l,"P",{});var el=a(Mt);Yn=i(el,"Available Checkpoints are:"),el.forEach(t),Qo=f(l),Z=n(l,"UL",{});var R=a(Z);Ie=n(R,"LI",{});var nn=a(Ie);Xt=n(nn,"EM",{});var tl=a(Xt);Qn=i(tl,"stable-diffusion-v1-4 (512x512 resolution)"),tl.forEach(t),Hn=f(nn),je=n(nn,"A",{href:!0,rel:!0});var ol=a(je);On=i(ol,"CompVis/stable-diffusion-v1-4"),ol.forEach(t),nn.forEach(t),Kn=f(R),Ce=n(R,"LI",{});var an=a(Ce);zt=n(an,"EM",{});var nl=a(zt);ea=i(nl,"stable-diffusion-v1-5 (512x512 resolution)"),nl.forEach(t),ta=f(an),Ze=n(an,"A",{href:!0,rel:!0});var al=a(Ze);oa=i(al,"runwayml/stable-diffusion-v1-5"),al.forEach(t),an.forEach(t),na=f(R),We=n(R,"LI",{});var sn=a(We);Yt=n(sn,"EM",{});var sl=a(Yt);aa=i(sl,"stable-diffusion-2-base (512x512 resolution)"),sl.forEach(t),sa=i(sn,": "),Ge=n(sn,"A",{href:!0,rel:!0});var il=a(Ge);ia=i(il,"stabilityai/stable-diffusion-2-base"),il.forEach(t),sn.forEach(t),la=f(R),Fe=n(R,"LI",{});var ln=a(Fe);Qt=n(ln,"EM",{});var ll=a(Qt);ra=i(ll,"stable-diffusion-2 (768x768 resolution)"),ll.forEach(t),da=i(ln,": "),Be=n(ln,"A",{href:!0,rel:!0});var rl=a(Be);ca=i(rl,"stabilityai/stable-diffusion-2"),rl.forEach(t),ln.forEach(t),fa=f(R),Ne=n(R,"LI",{});var rn=a(Ne);Ht=n(rn,"EM",{});var dl=a(Ht);pa=i(dl,"stable-diffusion-2-1-base (512x512 resolution)"),dl.forEach(t),ua=f(rn),Ve=n(rn,"A",{href:!0,rel:!0});var cl=a(Ve);ma=i(cl,"stabilityai/stable-diffusion-2-1-base"),cl.forEach(t),rn.forEach(t),ha=f(R),Le=n(R,"LI",{});var dn=a(Le);Ot=n(dn,"EM",{});var fl=a(Ot);ga=i(fl,"stable-diffusion-2-1 (768x768 resolution)"),fl.forEach(t),_a=i(dn,": "),Ae=n(dn,"A",{href:!0,rel:!0});var pl=a(Ae);ba=i(pl,"stabilityai/stable-diffusion-2-1"),pl.forEach(t),dn.forEach(t),R.forEach(t),Ho=f(l),g=n(l,"DIV",{class:!0});var y=a(g);M(Re.$$.fragment,y),va=f(y),Kt=n(y,"P",{});var ul=a(Kt);ya=i(ul,"Pipeline for text-to-image generation using Stable Diffusion."),ul.forEach(t),wa=f(y),qe=n(y,"P",{});var cn=a(qe);xa=i(cn,"This model inherits from "),Tt=n(cn,"A",{href:!0});var ml=a(Tt);$a=i(ml,"DiffusionPipeline"),ml.forEach(t),Ma=i(cn,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),cn.forEach(t),Ta=f(y),eo=n(y,"P",{});var hl=a(eo);Da=i(hl,"In addition the pipeline inherits the following loading methods:"),hl.forEach(t),Sa=f(y),K=n(y,"UL",{});var Jt=a(K);Xe=n(Jt,"LI",{});var fn=a(Xe);to=n(fn,"EM",{});var gl=a(to);Ea=i(gl,"Textual-Inversion"),gl.forEach(t),Pa=i(fn,": "),Dt=n(fn,"A",{href:!0});var _l=a(Dt);ka=i(_l,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),_l.forEach(t),fn.forEach(t),Ja=f(Jt),ze=n(Jt,"LI",{});var pn=a(ze);oo=n(pn,"EM",{});var bl=a(oo);Ua=i(bl,"LoRA"),bl.forEach(t),Ia=i(pn,": "),St=n(pn,"A",{href:!0});var vl=a(St);ja=i(vl,"loaders.LoraLoaderMixin.load_lora_weights()"),vl.forEach(t),pn.forEach(t),Ca=f(Jt),Ye=n(Jt,"LI",{});var un=a(Ye);no=n(un,"EM",{});var yl=a(no);Za=i(yl,"Ckpt"),yl.forEach(t),Wa=i(un,": "),Et=n(un,"A",{href:!0});var wl=a(Et);Ga=i(wl,"loaders.FromCkptMixin.from_ckpt()"),wl.forEach(t),un.forEach(t),Jt.forEach(t),Fa=f(y),ao=n(y,"P",{});var xl=a(ao);Ba=i(xl,"as well as the following saving methods:"),xl.forEach(t),Na=f(y),so=n(y,"UL",{});var $l=a(so);Qe=n($l,"LI",{});var mn=a(Qe);io=n(mn,"EM",{});var Ml=a(io);Va=i(Ml,"LoRA"),Ml.forEach(t),La=i(mn,": "),Pt=n(mn,"A",{href:!0});var Tl=a(Pt);Aa=i(Tl,"loaders.LoraLoaderMixin.save_lora_weights()"),Tl.forEach(t),mn.forEach(t),$l.forEach(t),Ra=f(y),q=n(y,"DIV",{class:!0});var Ut=a(q);M(He.$$.fragment,Ut),qa=f(Ut),lo=n(Ut,"P",{});var Dl=a(lo);Xa=i(Dl,"Function invoked when calling the pipeline for generation."),Dl.forEach(t),za=f(Ut),M(ae.$$.fragment,Ut),Ut.forEach(t),Ya=f(y),X=n(y,"DIV",{class:!0});var It=a(X);M(Oe.$$.fragment,It),Qa=f(It),ro=n(It,"P",{});var Sl=a(ro);Ha=i(Sl,"Enable sliced attention computation."),Sl.forEach(t),Oa=f(It),co=n(It,"P",{});var El=a(co);Ka=i(El,`When this option is enabled, the attention module will split 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.`),El.forEach(t),It.forEach(t),es=f(y),se=n(y,"DIV",{class:!0});var hn=a(se);M(Ke.$$.fragment,hn),ts=f(hn),et=n(hn,"P",{});var gn=a(et);os=i(gn,"Disable sliced attention computation. If "),fo=n(gn,"CODE",{});var Pl=a(fo);ns=i(Pl,"enable_attention_slicing"),Pl.forEach(t),as=i(gn,` was previously invoked, this method will go
back to computing attention in one step.`),gn.forEach(t),hn.forEach(t),ss=f(y),z=n(y,"DIV",{class:!0});var jt=a(z);M(tt.$$.fragment,jt),is=f(jt),po=n(jt,"P",{});var kl=a(po);ls=i(kl,"Enable sliced VAE decoding."),kl.forEach(t),rs=f(jt),uo=n(jt,"P",{});var Jl=a(uo);ds=i(Jl,`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.`),Jl.forEach(t),jt.forEach(t),cs=f(y),ie=n(y,"DIV",{class:!0});var _n=a(ie);M(ot.$$.fragment,_n),fs=f(_n),nt=n(_n,"P",{});var bn=a(nt);ps=i(bn,"Disable sliced VAE decoding. If "),mo=n(bn,"CODE",{});var Ul=a(mo);us=i(Ul,"enable_vae_slicing"),Ul.forEach(t),ms=i(bn,` was previously invoked, this method will go back to
computing decoding in one step.`),bn.forEach(t),_n.forEach(t),hs=f(y),B=n(y,"DIV",{class:!0});var H=a(B);M(at.$$.fragment,H),gs=f(H),ho=n(H,"P",{});var Il=a(ho);_s=i(Il,"Enable memory efficient attention as implemented in xformers."),Il.forEach(t),bs=f(H),go=n(H,"P",{});var jl=a(go);vs=i(jl,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),jl.forEach(t),ys=f(H),_o=n(H,"P",{});var Cl=a(_o);ws=i(Cl,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Cl.forEach(t),xs=f(H),M(le.$$.fragment,H),H.forEach(t),$s=f(y),re=n(y,"DIV",{class:!0});var vn=a(re);M(st.$$.fragment,vn),Ms=f(vn),bo=n(vn,"P",{});var Zl=a(bo);Ts=i(Zl,"Disable memory efficient attention as implemented in xformers."),Zl.forEach(t),vn.forEach(t),Ds=f(y),Y=n(y,"DIV",{class:!0});var Ct=a(Y);M(it.$$.fragment,Ct),Ss=f(Ct),vo=n(Ct,"P",{});var Wl=a(vo);Es=i(Wl,"Enable tiled VAE decoding."),Wl.forEach(t),Ps=f(Ct),yo=n(Ct,"P",{});var Gl=a(yo);ks=i(Gl,`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 to save a large amount of memory and to allow the processing of larger images.`),Gl.forEach(t),Ct.forEach(t),Js=f(y),de=n(y,"DIV",{class:!0});var yn=a(de);M(lt.$$.fragment,yn),Us=f(yn),rt=n(yn,"P",{});var wn=a(rt);Is=i(wn,"Disable tiled VAE decoding. If "),wo=n(wn,"CODE",{});var Fl=a(wo);js=i(Fl,"enable_vae_tiling"),Fl.forEach(t),Cs=i(wn,` was previously invoked, this method will go back to
computing decoding in one step.`),wn.forEach(t),yn.forEach(t),Zs=f(y),I=n(y,"DIV",{class:!0});var W=a(I);M(dt.$$.fragment,W),Ws=f(W),ee=n(W,"P",{});var Zt=a(ee);Gs=i(Zt,"Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),xo=n(Zt,"CODE",{});var Bl=a(xo);Fs=i(Bl,"diffusers"),Bl.forEach(t),Bs=i(Zt,` and
`),$o=n(Zt,"CODE",{});var Nl=a($o);Ns=i(Nl,"Automatic1111"),Nl.forEach(t),Vs=i(Zt," formats are supported (see example below)."),Zt.forEach(t),Ls=f(W),M(ce.$$.fragment,W),As=f(W),M(fe.$$.fragment,W),Rs=f(W),Mo=n(W,"P",{});var Vl=a(Mo);qs=i(Vl,"Example:"),Vl.forEach(t),Xs=f(W),M(pe.$$.fragment,W),zs=f(W),To=n(W,"P",{});var Ll=a(To);Ys=i(Ll,"To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),Ll.forEach(t),Qs=f(W),M(ue.$$.fragment,W),W.forEach(t),Hs=f(y),L=n(y,"DIV",{class:!0});var we=a(L);M(ct.$$.fragment,we),Os=f(we),Do=n(we,"P",{});var Al=a(Do);Ks=i(Al,"Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights saved in the original .ckpt format."),Al.forEach(t),ei=f(we),ft=n(we,"P",{});var xn=a(ft);ti=i(xn,"The pipeline is set in evaluation mode by default using "),So=n(xn,"CODE",{});var Rl=a(So);oi=i(Rl,"model.eval()"),Rl.forEach(t),ni=i(xn," (Dropout modules are deactivated)."),xn.forEach(t),ai=f(we),M(me.$$.fragment,we),we.forEach(t),si=f(y),A=n(y,"DIV",{class:!0});var xe=a(A);M(pt.$$.fragment,xe),ii=f(xe),te=n(xe,"P",{});var Wt=a(te);li=i(Wt,"Load pretrained attention processor layers (such as LoRA) into "),kt=n(Wt,"A",{href:!0});var ql=a(kt);ri=i(ql,"UNet2DConditionModel"),ql.forEach(t),di=i(Wt,` and
`),ut=n(Wt,"A",{href:!0,rel:!0});var Xl=a(ut);Eo=n(Xl,"CODE",{});var zl=a(Eo);ci=i(zl,"CLIPTextModel"),zl.forEach(t),Xl.forEach(t),fi=i(Wt,")."),Wt.forEach(t),pi=f(xe),M(he.$$.fragment,xe),ui=f(xe),M(ge.$$.fragment,xe),xe.forEach(t),mi=f(y),_e=n(y,"DIV",{class:!0});var $n=a(_e);M(mt.$$.fragment,$n),hi=f($n),Po=n($n,"P",{});var Yl=a(Po);gi=i(Yl,"Save the LoRA parameters corresponding to the UNet and the text encoder."),Yl.forEach(t),$n.forEach(t),_i=f(y),be=n(y,"DIV",{class:!0});var Mn=a(be);M(ht.$$.fragment,Mn),bi=f(Mn),N=n(Mn,"P",{});var O=a(N);vi=i(O,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ko=n(O,"CODE",{});var Ql=a(ko);yi=i(Ql,"enable_sequential_cpu_offload"),Ql.forEach(t),wi=i(O,", this method moves one whole model at a time to the GPU when its "),Jo=n(O,"CODE",{});var Hl=a(Jo);xi=i(Hl,"forward"),Hl.forEach(t),$i=i(O,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Uo=n(O,"CODE",{});var Ol=a(Uo);Mi=i(Ol,"enable_sequential_cpu_offload"),Ol.forEach(t),Ti=i(O,", but performance is much better due to the iterative execution of the "),Io=n(O,"CODE",{});var Kl=a(Io);Di=i(Kl,"unet"),Kl.forEach(t),Si=i(O,"."),O.forEach(t),Mn.forEach(t),Ei=f(y),ve=n(y,"DIV",{class:!0});var Tn=a(ve);M(gt.$$.fragment,Tn),Pi=f(Tn),oe=n(Tn,"P",{});var Gt=a(oe);ki=i(Gt,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),jo=n(Gt,"CODE",{});var er=a(jo);Ji=i(er,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),er.forEach(t),Ui=i(Gt,"forward"),Co=n(Gt,"CODE",{});var tr=a(Co);Ii=i(tr,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),tr.forEach(t),ji=i(Gt,"enable_model_cpu_offload`, but performance is lower."),Gt.forEach(t),Tn.forEach(t),y.forEach(t),Oo=f(l),V=n(l,"DIV",{class:!0});var $e=a(V);M(_t.$$.fragment,$e),Ci=f($e),Zo=n($e,"P",{});var or=a(Zo);Zi=i(or,"Pipeline for text-to-image generation using Stable Diffusion."),or.forEach(t),Wi=f($e),bt=n($e,"P",{});var Dn=a(bt);Gi=i(Dn,"This model inherits from "),Wo=n(Dn,"CODE",{});var nr=a(Wo);Fi=i(nr,"FlaxDiffusionPipeline"),nr.forEach(t),Bi=i(Dn,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Dn.forEach(t),Ni=f($e),Q=n($e,"DIV",{class:!0});var Ft=a(Q);M(vt.$$.fragment,Ft),Vi=f(Ft),Go=n(Ft,"P",{});var ar=a(Go);Li=i(ar,"Function invoked when calling the pipeline for generation."),ar.forEach(t),Ai=f(Ft),M(ye.$$.fragment,Ft),Ft.forEach(t),$e.forEach(t),this.h()},h(){u(d,"name","hf:doc:metadata"),u(d,"content",JSON.stringify(xr)),u(p,"id","texttoimage-generation"),u(p,"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"),u(p,"href","#texttoimage-generation"),u(m,"class","relative group"),u(F,"id","diffusers.StableDiffusionPipeline"),u(F,"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"),u(F,"href","#diffusers.StableDiffusionPipeline"),u(U,"class","relative group"),u(Te,"href","https://github.com/CompVis"),u(Te,"rel","nofollow"),u(De,"href","https://stability.ai/"),u(De,"rel","nofollow"),u(Se,"href","https://github.com/runwayml"),u(Se,"rel","nofollow"),u(Ee,"href","https://laion.ai/"),u(Ee,"rel","nofollow"),u(xt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),u(ke,"href","https://github.com/CompVis/stable-diffusion"),u(ke,"rel","nofollow"),u(Ue,"href","https://github.com/Stability-AI/stablediffusion"),u(Ue,"rel","nofollow"),u(je,"href","https://huggingface.co/CompVis/stable-diffusion-v1-4"),u(je,"rel","nofollow"),u(Ze,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),u(Ze,"rel","nofollow"),u(Ge,"href","https://huggingface.co/stabilityai/stable-diffusion-2-base"),u(Ge,"rel","nofollow"),u(Be,"href","https://huggingface.co/stabilityai/stable-diffusion-2"),u(Be,"rel","nofollow"),u(Ve,"href","https://huggingface.co/stabilityai/stable-diffusion-2-1-base"),u(Ve,"rel","nofollow"),u(Ae,"href","https://huggingface.co/stabilityai/stable-diffusion-2-1"),u(Ae,"rel","nofollow"),u(Tt,"href","/docs/diffusers/v0.17.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),u(Dt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.load_textual_inversion"),u(St,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.load_lora_weights"),u(Et,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.from_ckpt"),u(Pt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.save_lora_weights"),u(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(kt,"href","/docs/diffusers/v0.17.0/en/api/models#diffusers.UNet2DConditionModel"),u(ut,"href","https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel"),u(ut,"rel","nofollow"),u(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(l,w){e(document.head,d),P(l,v,w),P(l,m,w),e(m,p),e(p,b),T(r,b,null),e(m,h),e(m,k),e(k,_),P(l,x,w),P(l,U,w),e(U,F),e(F,Lt),T(Me,Lt,null),e(U,En),e(U,At),e(At,Pn),P(l,qo,w),P(l,C,w),e(C,kn),e(C,Te),e(Te,Jn),e(C,Un),e(C,De),e(De,In),e(C,jn),e(C,Se),e(Se,Cn),e(C,Zn),e(C,Ee),e(Ee,Wn),e(C,Gn),e(C,xt),e(xt,Fn),e(C,Bn),P(l,Xo,w),P(l,$t,w),e($t,Nn),P(l,zo,w),P(l,ne,w),e(ne,Pe),e(Pe,Rt),e(Rt,Vn),e(Pe,Ln),e(Pe,ke),e(ke,An),e(ne,Rn),e(ne,Je),e(Je,qt),e(qt,qn),e(Je,Xn),e(Je,Ue),e(Ue,zn),P(l,Yo,w),P(l,Mt,w),e(Mt,Yn),P(l,Qo,w),P(l,Z,w),e(Z,Ie),e(Ie,Xt),e(Xt,Qn),e(Ie,Hn),e(Ie,je),e(je,On),e(Z,Kn),e(Z,Ce),e(Ce,zt),e(zt,ea),e(Ce,ta),e(Ce,Ze),e(Ze,oa),e(Z,na),e(Z,We),e(We,Yt),e(Yt,aa),e(We,sa),e(We,Ge),e(Ge,ia),e(Z,la),e(Z,Fe),e(Fe,Qt),e(Qt,ra),e(Fe,da),e(Fe,Be),e(Be,ca),e(Z,fa),e(Z,Ne),e(Ne,Ht),e(Ht,pa),e(Ne,ua),e(Ne,Ve),e(Ve,ma),e(Z,ha),e(Z,Le),e(Le,Ot),e(Ot,ga),e(Le,_a),e(Le,Ae),e(Ae,ba),P(l,Ho,w),P(l,g,w),T(Re,g,null),e(g,va),e(g,Kt),e(Kt,ya),e(g,wa),e(g,qe),e(qe,xa),e(qe,Tt),e(Tt,$a),e(qe,Ma),e(g,Ta),e(g,eo),e(eo,Da),e(g,Sa),e(g,K),e(K,Xe),e(Xe,to),e(to,Ea),e(Xe,Pa),e(Xe,Dt),e(Dt,ka),e(K,Ja),e(K,ze),e(ze,oo),e(oo,Ua),e(ze,Ia),e(ze,St),e(St,ja),e(K,Ca),e(K,Ye),e(Ye,no),e(no,Za),e(Ye,Wa),e(Ye,Et),e(Et,Ga),e(g,Fa),e(g,ao),e(ao,Ba),e(g,Na),e(g,so),e(so,Qe),e(Qe,io),e(io,Va),e(Qe,La),e(Qe,Pt),e(Pt,Aa),e(g,Ra),e(g,q),T(He,q,null),e(q,qa),e(q,lo),e(lo,Xa),e(q,za),T(ae,q,null),e(g,Ya),e(g,X),T(Oe,X,null),e(X,Qa),e(X,ro),e(ro,Ha),e(X,Oa),e(X,co),e(co,Ka),e(g,es),e(g,se),T(Ke,se,null),e(se,ts),e(se,et),e(et,os),e(et,fo),e(fo,ns),e(et,as),e(g,ss),e(g,z),T(tt,z,null),e(z,is),e(z,po),e(po,ls),e(z,rs),e(z,uo),e(uo,ds),e(g,cs),e(g,ie),T(ot,ie,null),e(ie,fs),e(ie,nt),e(nt,ps),e(nt,mo),e(mo,us),e(nt,ms),e(g,hs),e(g,B),T(at,B,null),e(B,gs),e(B,ho),e(ho,_s),e(B,bs),e(B,go),e(go,vs),e(B,ys),e(B,_o),e(_o,ws),e(B,xs),T(le,B,null),e(g,$s),e(g,re),T(st,re,null),e(re,Ms),e(re,bo),e(bo,Ts),e(g,Ds),e(g,Y),T(it,Y,null),e(Y,Ss),e(Y,vo),e(vo,Es),e(Y,Ps),e(Y,yo),e(yo,ks),e(g,Js),e(g,de),T(lt,de,null),e(de,Us),e(de,rt),e(rt,Is),e(rt,wo),e(wo,js),e(rt,Cs),e(g,Zs),e(g,I),T(dt,I,null),e(I,Ws),e(I,ee),e(ee,Gs),e(ee,xo),e(xo,Fs),e(ee,Bs),e(ee,$o),e($o,Ns),e(ee,Vs),e(I,Ls),T(ce,I,null),e(I,As),T(fe,I,null),e(I,Rs),e(I,Mo),e(Mo,qs),e(I,Xs),T(pe,I,null),e(I,zs),e(I,To),e(To,Ys),e(I,Qs),T(ue,I,null),e(g,Hs),e(g,L),T(ct,L,null),e(L,Os),e(L,Do),e(Do,Ks),e(L,ei),e(L,ft),e(ft,ti),e(ft,So),e(So,oi),e(ft,ni),e(L,ai),T(me,L,null),e(g,si),e(g,A),T(pt,A,null),e(A,ii),e(A,te),e(te,li),e(te,kt),e(kt,ri),e(te,di),e(te,ut),e(ut,Eo),e(Eo,ci),e(te,fi),e(A,pi),T(he,A,null),e(A,ui),T(ge,A,null),e(g,mi),e(g,_e),T(mt,_e,null),e(_e,hi),e(_e,Po),e(Po,gi),e(g,_i),e(g,be),T(ht,be,null),e(be,bi),e(be,N),e(N,vi),e(N,ko),e(ko,yi),e(N,wi),e(N,Jo),e(Jo,xi),e(N,$i),e(N,Uo),e(Uo,Mi),e(N,Ti),e(N,Io),e(Io,Di),e(N,Si),e(g,Ei),e(g,ve),T(gt,ve,null),e(ve,Pi),e(ve,oe),e(oe,ki),e(oe,jo),e(jo,Ji),e(oe,Ui),e(oe,Co),e(Co,Ii),e(oe,ji),P(l,Oo,w),P(l,V,w),T(_t,V,null),e(V,Ci),e(V,Zo),e(Zo,Zi),e(V,Wi),e(V,bt),e(bt,Gi),e(bt,Wo),e(Wo,Fi),e(bt,Bi),e(V,Ni),e(V,Q),T(vt,Q,null),e(Q,Vi),e(Q,Go),e(Go,Li),e(Q,Ai),T(ye,Q,null),Ko=!0},p(l,[w]){const yt={};w&2&&(yt.$$scope={dirty:w,ctx:l}),ae.$set(yt);const Fo={};w&2&&(Fo.$$scope={dirty:w,ctx:l}),le.$set(Fo);const Bo={};w&2&&(Bo.$$scope={dirty:w,ctx:l}),ce.$set(Bo);const No={};w&2&&(No.$$scope={dirty:w,ctx:l}),fe.$set(No);const wt={};w&2&&(wt.$$scope={dirty:w,ctx:l}),pe.$set(wt);const Vo={};w&2&&(Vo.$$scope={dirty:w,ctx:l}),ue.$set(Vo);const Lo={};w&2&&(Lo.$$scope={dirty:w,ctx:l}),me.$set(Lo);const Ao={};w&2&&(Ao.$$scope={dirty:w,ctx:l}),he.$set(Ao);const G={};w&2&&(G.$$scope={dirty:w,ctx:l}),ge.$set(G);const Ro={};w&2&&(Ro.$$scope={dirty:w,ctx:l}),ye.$set(Ro)},i(l){Ko||(D(r.$$.fragment,l),D(Me.$$.fragment,l),D(Re.$$.fragment,l),D(He.$$.fragment,l),D(ae.$$.fragment,l),D(Oe.$$.fragment,l),D(Ke.$$.fragment,l),D(tt.$$.fragment,l),D(ot.$$.fragment,l),D(at.$$.fragment,l),D(le.$$.fragment,l),D(st.$$.fragment,l),D(it.$$.fragment,l),D(lt.$$.fragment,l),D(dt.$$.fragment,l),D(ce.$$.fragment,l),D(fe.$$.fragment,l),D(pe.$$.fragment,l),D(ue.$$.fragment,l),D(ct.$$.fragment,l),D(me.$$.fragment,l),D(pt.$$.fragment,l),D(he.$$.fragment,l),D(ge.$$.fragment,l),D(mt.$$.fragment,l),D(ht.$$.fragment,l),D(gt.$$.fragment,l),D(_t.$$.fragment,l),D(vt.$$.fragment,l),D(ye.$$.fragment,l),Ko=!0)},o(l){S(r.$$.fragment,l),S(Me.$$.fragment,l),S(Re.$$.fragment,l),S(He.$$.fragment,l),S(ae.$$.fragment,l),S(Oe.$$.fragment,l),S(Ke.$$.fragment,l),S(tt.$$.fragment,l),S(ot.$$.fragment,l),S(at.$$.fragment,l),S(le.$$.fragment,l),S(st.$$.fragment,l),S(it.$$.fragment,l),S(lt.$$.fragment,l),S(dt.$$.fragment,l),S(ce.$$.fragment,l),S(fe.$$.fragment,l),S(pe.$$.fragment,l),S(ue.$$.fragment,l),S(ct.$$.fragment,l),S(me.$$.fragment,l),S(pt.$$.fragment,l),S(he.$$.fragment,l),S(ge.$$.fragment,l),S(mt.$$.fragment,l),S(ht.$$.fragment,l),S(gt.$$.fragment,l),S(_t.$$.fragment,l),S(vt.$$.fragment,l),S(ye.$$.fragment,l),Ko=!1},d(l){t(d),l&&t(v),l&&t(m),E(r),l&&t(x),l&&t(U),E(Me),l&&t(qo),l&&t(C),l&&t(Xo),l&&t($t),l&&t(zo),l&&t(ne),l&&t(Yo),l&&t(Mt),l&&t(Qo),l&&t(Z),l&&t(Ho),l&&t(g),E(Re),E(He),E(ae),E(Oe),E(Ke),E(tt),E(ot),E(at),E(le),E(st),E(it),E(lt),E(dt),E(ce),E(fe),E(pe),E(ue),E(ct),E(me),E(pt),E(he),E(ge),E(mt),E(ht),E(gt),l&&t(Oo),l&&t(V),E(_t),E(vt),E(ye)}}}const xr={local:"texttoimage-generation",sections:[{local:"diffusers.StableDiffusionPipeline",title:"StableDiffusionPipeline"}],title:"Text-to-Image Generation"};function $r(J){return cr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kr extends ir{constructor(d){super();lr(this,d,$r,wr,rr,{})}}export{kr as default,xr as metadata};
