import{S as Xa,i as Ra,s as Ya,e as a,k as m,w,t as l,M as za,c as i,d as t,m as u,a as r,x as $,h as d,b,G as e,g as U,y as M,q as x,o as j,B as T,v as Aa,L as po}from"../../../chunks/vendor-hf-doc-builder.js";import{T as xo}from"../../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as co}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as na}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as lo}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Qa(J){let s,g,c,p,h,o,f,E,P,Z,k,W;return{c(){s=a("p"),g=l("Pipelines do not offer any training functionality. You\u2019ll notice PyTorch\u2019s autograd is disabled by decorating the "),c=a("code"),p=l("__call__()"),h=l(" method with a "),o=a("a"),f=a("code"),E=l("torch.no_grad"),P=l(" decorator because pipelines should not be used for training. If you\u2019re interested in training, please take a look at the "),Z=a("a"),k=l("Training"),W=l(" guides instead!"),this.h()},l(G){s=i(G,"P",{});var I=r(s);g=d(I,"Pipelines do not offer any training functionality. You\u2019ll notice PyTorch\u2019s autograd is disabled by decorating the "),c=i(I,"CODE",{});var Q=r(c);p=d(Q,"__call__()"),Q.forEach(t),h=d(I," method with a "),o=i(I,"A",{href:!0,rel:!0});var C=r(o);f=i(C,"CODE",{});var fo=r(f);E=d(fo,"torch.no_grad"),fo.forEach(t),C.forEach(t),P=d(I," decorator because pipelines should not be used for training. If you\u2019re interested in training, please take a look at the "),Z=i(I,"A",{href:!0});var mo=r(Z);k=d(mo,"Training"),mo.forEach(t),W=d(I," guides instead!"),I.forEach(t),this.h()},h(){b(o,"href","https://pytorch.org/docs/stable/generated/torch.no_grad.html"),b(o,"rel","nofollow"),b(Z,"href","../traininig/overview")},m(G,I){U(G,s,I),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(f,E),e(s,P),e(s,Z),e(Z,k),e(s,W)},d(G){G&&t(s)}}}function Ha(J){let s,g,c,p,h;return p=new co({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZSUyQyUwQSUyMCUyMCUyMCUyMFN0YWJsZURpZmZ1c2lvbkltZzJJbWdQaXBlbGluZSUyQyUwQSUyMCUyMCUyMCUyMFN0YWJsZURpZmZ1c2lvbklucGFpbnRQaXBlbGluZSUyQyUwQSklMEElMEF0ZXh0MmltZyUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiklMEFpbWcyaW1nJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lKCoqdGV4dDJpbWcuY29tcG9uZW50cyklMEFpbnBhaW50JTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uSW5wYWludFBpcGVsaW5lKCoqdGV4dDJpbWcuY29tcG9uZW50cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    StableDiffusionPipeline,
<span class="hljs-meta">... </span>    StableDiffusionImg2ImgPipeline,
<span class="hljs-meta">... </span>    StableDiffusionInpaintPipeline,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text2img = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
<span class="hljs-meta">&gt;&gt;&gt; </span>inpaint = StableDiffusionInpaintPipeline(**text2img.components)`}}),{c(){s=a("p"),g=l("Examples:"),c=m(),w(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),$(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),M(p,o,f),h=!0},p:po,i(o){h||(x(p.$$.fragment,o),h=!0)},o(o){j(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),T(p,o)}}}function qa(J){let s,g,c,p,h,o,f,E;return{c(){s=a("p"),g=l("To use private or "),c=a("a"),p=l("gated models"),h=l(`, log-in with
`),o=a("code"),f=l("huggingface-cli login"),E=l("."),this.h()},l(P){s=i(P,"P",{});var Z=r(s);g=d(Z,"To use private or "),c=i(Z,"A",{href:!0,rel:!0});var k=r(c);p=d(k,"gated models"),k.forEach(t),h=d(Z,`, log-in with
`),o=i(Z,"CODE",{});var W=r(o);f=d(W,"huggingface-cli login"),W.forEach(t),E=d(Z,"."),Z.forEach(t),this.h()},h(){b(c,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),b(c,"rel","nofollow")},m(P,Z){U(P,s,Z),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(s,E)},d(P){P&&t(s)}}}function La(J){let s,g,c,p,h;return{c(){s=a("p"),g=l("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),c=a("code"),p=l("scaled_dot_product_attention"),h=l(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),c=i(f,"CODE",{});var E=r(c);p=d(E,"scaled_dot_product_attention"),E.forEach(t),h=d(f,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),f.forEach(t)},m(o,f){U(o,s,f),e(s,g),e(s,c),e(c,p),e(s,h)},d(o){o&&t(s)}}}function Oa(J){let s,g,c,p,h;return p=new co({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){s=a("p"),g=l("Examples:"),c=m(),w(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),$(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),M(p,o,f),h=!0},p:po,i(o){h||(x(p.$$.fragment,o),h=!0)},o(o){j(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),T(p,o)}}}function Ka(J){let s,g;return{c(){s=a("p"),g=l(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(c){s=i(c,"P",{});var p=r(s);g=d(p,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),p.forEach(t)},m(c,p){U(c,s,p),e(s,g)},d(c){c&&t(s)}}}function ei(J){let s,g,c,p,h;return p=new co({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(){s=a("p"),g=l("Examples:"),c=m(),w(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),$(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),M(p,o,f),h=!0},p:po,i(o){h||(x(p.$$.fragment,o),h=!0)},o(o){j(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),T(p,o)}}}function oi(J){let s,g,c,p,h;return p=new co({props:{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTIwd2VyZSUyMG5vdCUyMGluaXRpYWxpemVkJTIwZnJvbSUyMHRoZSUyMG1vZGVsJTIwY2hlY2twb2ludCUyMGF0JTIwcnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjBhbmQlMjBhcmUlMjBuZXdseSUyMGluaXRpYWxpemVkJTIwYmVjYXVzZSUyMHRoZSUyMHNoYXBlcyUyMGRpZCUyMG5vdCUyMG1hdGNoJTNBJTBBLSUyMGNvbnZfaW4ud2VpZ2h0JTNBJTIwZm91bmQlMjBzaGFwZSUyMHRvcmNoLlNpemUoJTVCMzIwJTJDJTIwNCUyQyUyMDMlMkMlMjAzJTVEKSUyMGluJTIwdGhlJTIwY2hlY2twb2ludCUyMGFuZCUyMHRvcmNoLlNpemUoJTVCMzIwJTJDJTIwOSUyQyUyMDMlMkMlMjAzJTVEKSUyMGluJTIwdGhlJTIwbW9kZWwlMjBpbnN0YW50aWF0ZWQlMEFZb3UlMjBzaG91bGQlMjBwcm9iYWJseSUyMFRSQUlOJTIwdGhpcyUyMG1vZGVsJTIwb24lMjBhJTIwZG93bi1zdHJlYW0lMjB0YXNrJTIwdG8lMjBiZSUyMGFibGUlMjB0byUyMHVzZSUyMGl0JTIwZm9yJTIwcHJlZGljdGlvbnMlMjBhbmQlMjBpbmZlcmVuY2Uu",highlighted:`<span class="hljs-comment">Some</span> <span class="hljs-comment">weights</span> <span class="hljs-comment">of</span> <span class="hljs-comment">UNet2DConditionModel were not initialized from the model checkpoint at</span> <span class="hljs-comment">runwayml/stable</span><span class="hljs-literal">-</span><span class="hljs-comment">diffusion</span><span class="hljs-literal">-</span><span class="hljs-comment">v1</span><span class="hljs-literal">-</span><span class="hljs-comment">5 and are newly initialized because the shapes did</span> <span class="hljs-comment">not</span> <span class="hljs-comment">match:</span>
<span class="hljs-literal">-</span> <span class="hljs-comment">conv_in</span><span class="hljs-string">.</span><span class="hljs-comment">weight:</span> <span class="hljs-comment">found</span> <span class="hljs-comment">shape</span> <span class="hljs-comment">torch</span><span class="hljs-string">.</span><span class="hljs-comment">Size(</span><span class="hljs-title">[</span><span class="hljs-comment">320</span><span class="hljs-string">,</span> <span class="hljs-comment">4</span><span class="hljs-string">,</span> <span class="hljs-comment">3</span><span class="hljs-string">,</span> <span class="hljs-comment">3</span><span class="hljs-title">]</span><span class="hljs-comment">) in the checkpoint and</span> <span class="hljs-comment">torch</span><span class="hljs-string">.</span><span class="hljs-comment">Size(</span><span class="hljs-title">[</span><span class="hljs-comment">320</span><span class="hljs-string">,</span> <span class="hljs-comment">9</span><span class="hljs-string">,</span> <span class="hljs-comment">3</span><span class="hljs-string">,</span> <span class="hljs-comment">3</span><span class="hljs-title">]</span><span class="hljs-comment">) in the model instantiated</span>
<span class="hljs-comment">You</span> <span class="hljs-comment">should</span> <span class="hljs-comment">probably</span> <span class="hljs-comment">TRAIN this model on a down-stream task to be able to use it for predictions and inference</span><span class="hljs-string">.</span>`}}),{c(){s=a("p"),g=l("If you get the error message below, you need to finetune the weights for your downstream task:"),c=m(),w(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"If you get the error message below, you need to finetune the weights for your downstream task:"),f.forEach(t),c=u(o),$(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),M(p,o,f),h=!0},p:po,i(o){h||(x(p.$$.fragment,o),h=!0)},o(o){j(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),T(p,o)}}}function ti(J){let s,g,c,p,h,o,f,E;return{c(){s=a("p"),g=l("To use private or "),c=a("a"),p=l("gated"),h=l(` models, log-in with
`),o=a("code"),f=l("huggingface-cli login"),E=l("."),this.h()},l(P){s=i(P,"P",{});var Z=r(s);g=d(Z,"To use private or "),c=i(Z,"A",{href:!0,rel:!0});var k=r(c);p=d(k,"gated"),k.forEach(t),h=d(Z,` models, log-in with
`),o=i(Z,"CODE",{});var W=r(o);f=d(W,"huggingface-cli login"),W.forEach(t),E=d(Z,"."),Z.forEach(t),this.h()},h(){b(c,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),b(c,"rel","nofollow")},m(P,Z){U(P,s,Z),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(s,E)},d(P){P&&t(s)}}}function ni(J){let s,g,c,p,h;return p=new co({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMkNvbXBWaXMlMkZsZG0tdGV4dDJpbS1sYXJnZS0yNTYlMjIpJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMHRoYXQlMjByZXF1aXJlcyUyMGFuJTIwYXV0aG9yaXphdGlvbiUyMHRva2VuJTBBJTIzJTIwRm9yJTIwbW9yZSUyMGluZm9ybWF0aW9uJTIwb24lMjBhY2Nlc3MlMjB0b2tlbnMlMkMlMjBwbGVhc2UlMjByZWZlciUyMHRvJTIwdGhpcyUyMHNlY3Rpb24lMEElMjMlMjBvZiUyMHRoZSUyMGRvY3VtZW50YXRpb24lNUQoaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRvY3MlMkZodWIlMkZzZWN1cml0eS10b2tlbnMpJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIpJTBBJTBBJTIzJTIwVXNlJTIwYSUyMGRpZmZlcmVudCUyMHNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBMTVNEaXNjcmV0ZVNjaGVkdWxlciUwQSUwQXNjaGVkdWxlciUyMCUzRCUyMExNU0Rpc2NyZXRlU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwc2NoZWR1bGVy",highlighted:`<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-comment"># Download pipeline from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline that requires an authorization token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># For more information on access tokens, please refer to this section</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># of the documentation](https://huggingface.co/docs/hub/security-tokens)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Use a different scheduler</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LMSDiscreteScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = LMSDiscreteScheduler.from_config(pipeline.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.scheduler = scheduler`}}),{c(){s=a("p"),g=l("Examples:"),c=m(),w(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),$(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),M(p,o,f),h=!0},p:po,i(o){h||(x(p.$$.fragment,o),h=!0)},o(o){j(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),T(p,o)}}}function si(J){let s,g,c,p,h;return p=new co({props:{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMEZsYXhVTmV0MkRDb25kaXRpb25Nb2RlbCUyMHdlcmUlMjBub3QlMjBpbml0aWFsaXplZCUyMGZyb20lMjB0aGUlMjBtb2RlbCUyMGNoZWNrcG9pbnQlMjBhdCUyMHJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIwYW5kJTIwYXJlJTIwbmV3bHklMjBpbml0aWFsaXplZCUyMGJlY2F1c2UlMjB0aGUlMjBzaGFwZXMlMjBkaWQlMjBub3QlMjBtYXRjaCUzQQ==",highlighted:'<span class="hljs-comment">Some</span> <span class="hljs-comment">weights</span> <span class="hljs-comment">of</span> <span class="hljs-comment">FlaxUNet2DConditionModel were not initialized from the model checkpoint at</span> <span class="hljs-comment">runwayml/stable</span><span class="hljs-literal">-</span><span class="hljs-comment">diffusion</span><span class="hljs-literal">-</span><span class="hljs-comment">v1</span><span class="hljs-literal">-</span><span class="hljs-comment">5 and are newly initialized because the shapes did</span> <span class="hljs-comment">not</span> <span class="hljs-comment">match:</span>'}}),{c(){s=a("p"),g=l("If you get the error message below, you need to finetune the weights for your downstream task:"),c=m(),w(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"If you get the error message below, you need to finetune the weights for your downstream task:"),f.forEach(t),c=u(o),$(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),M(p,o,f),h=!0},p:po,i(o){h||(x(p.$$.fragment,o),h=!0)},o(o){j(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),T(p,o)}}}function ai(J){let s,g,c,p,h,o,f,E,P,Z,k;return{c(){s=a("p"),g=l("To use private or "),c=a("a"),p=l("gated models"),h=l(`, log-in with
`),o=a("code"),f=l("huggingface-cli login"),E=l(`. You can also activate the special
`),P=a("a"),Z=l("\u201Coffline-mode\u201D"),k=l(` to use this method in a
firewalled environment.`),this.h()},l(W){s=i(W,"P",{});var G=r(s);g=d(G,"To use private or "),c=i(G,"A",{href:!0,rel:!0});var I=r(c);p=d(I,"gated models"),I.forEach(t),h=d(G,`, log-in with
`),o=i(G,"CODE",{});var Q=r(o);f=d(Q,"huggingface-cli login"),Q.forEach(t),E=d(G,`. You can also activate the special
`),P=i(G,"A",{href:!0,rel:!0});var C=r(P);Z=d(C,"\u201Coffline-mode\u201D"),C.forEach(t),k=d(G,` to use this method in a
firewalled environment.`),G.forEach(t),this.h()},h(){b(c,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),b(c,"rel","nofollow"),b(P,"href","https://huggingface.co/diffusers/installation.html#offline-mode"),b(P,"rel","nofollow")},m(W,G){U(W,s,G),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(s,E),e(s,P),e(P,Z),e(s,k)},d(W){W&&t(s)}}}function ii(J){let s,g,c,p,h;return p=new co({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhEaWZmdXNpb25QaXBlbGluZSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwaHVnZ2luZ2ZhY2UuY28lMjBhbmQlMjBjYWNoZS4lMEElMjMlMjBSZXF1aXJlcyUyMHRvJTIwYmUlMjBsb2dnZWQlMjBpbiUyMHRvJTIwSHVnZ2luZyUyMEZhY2UlMjBodWIlMkMlMEElMjMlMjBzZWUlMjBtb3JlJTIwaW4lMjAlNUJ0aGUlMjBkb2N1bWVudGF0aW9uJTVEKGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkb2NzJTJGaHViJTJGc2VjdXJpdHktdG9rZW5zKSUwQXBpcGVsaW5lJTJDJTIwcGFyYW1zJTIwJTNEJTIwRmxheERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUwQSUyMCUyMCUyMCUyMHJldmlzaW9uJTNEJTIyYmYxNiUyMiUyQyUwQSUyMCUyMCUyMCUyMGR0eXBlJTNEam5wLmJmbG9hdDE2JTJDJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMkMlMjBidXQlMjB1c2UlMjBhJTIwZGlmZmVyZW50JTIwc2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIlMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZHBtcHAlMkMlMjBkcG1wcF9zdGF0ZSUyMCUzRCUyMEZsYXhEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lkJTJDJTBBJTIwJTIwJTIwJTIwc3ViZm9sZGVyJTNEJTIyc2NoZWR1bGVyJTIyJTJDJTBBKSUwQSUwQWRwbV9waXBlJTJDJTIwZHBtX3BhcmFtcyUyMCUzRCUyMEZsYXhTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlMkMlMjByZXZpc2lvbiUzRCUyMmJmMTYlMjIlMkMlMjBkdHlwZSUzRGpucC5iZmxvYXQxNiUyQyUyMHNjaGVkdWxlciUzRGRwbXBwJTBBKSUwQWRwbV9wYXJhbXMlNUIlMjJzY2hlZHVsZXIlMjIlNUQlMjAlM0QlMjBkcG1wcF9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxDiffusionPipeline

<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><span class="hljs-comment"># Requires to be logged in to Hugging Face hub,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># see more in [the documentation](https://huggingface.co/docs/hub/security-tokens)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline, params = FlaxDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    revision=<span class="hljs-string">&quot;bf16&quot;</span>,
<span class="hljs-meta">... </span>    dtype=jnp.bfloat16,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline, but use a different scheduler</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxDPMSolverMultistepScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>dpmpp, dpmpp_state = FlaxDPMSolverMultistepScheduler.from_pretrained(
<span class="hljs-meta">... </span>    model_id,
<span class="hljs-meta">... </span>    subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>dpm_pipe, dpm_params = FlaxStableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    model_id, revision=<span class="hljs-string">&quot;bf16&quot;</span>, dtype=jnp.bfloat16, scheduler=dpmpp
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dpm_params[<span class="hljs-string">&quot;scheduler&quot;</span>] = dpmpp_state`}}),{c(){s=a("p"),g=l("Examples:"),c=m(),w(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),$(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),M(p,o,f),h=!0},p:po,i(o){h||(x(p.$$.fragment,o),h=!0)},o(o){j(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),T(p,o)}}}function ri(J){let s,g,c,p,h,o,f,E,P,Z,k,W,G,I,Q,C,fo,mo,gt,O,bt,H,K,jo,Ue,Ct,To,St,_t,y,Ze,Xt,Uo,Rt,Yt,uo,ho,zt,At,Qt,Je,Zo,Ht,qt,Jo,Lt,Ot,Po,Kt,en,Pe,ee,Eo,on,tn,Do,nn,sn,an,oe,Io,rn,ln,Go,dn,pn,cn,te,Ee,fn,ko,mn,un,go,De,hn,bo,Ie,gn,S,Ge,bn,ke,_n,Wo,yn,vn,wn,We,$n,Bo,Mn,xn,jn,ne,Tn,se,Be,Un,Fe,Zn,Fo,Jn,Pn,En,ae,Ne,Dn,Ve,In,Ce,Gn,kn,Wn,A,Se,Bn,No,Fn,Nn,ie,Vn,X,Xe,Cn,Vo,Sn,Xn,re,Rn,le,Yn,de,Re,zn,q,An,Co,Qn,Hn,So,qn,Ln,On,R,Ye,Kn,ze,es,Ae,os,ts,ns,pe,ss,ce,as,N,Qe,is,Xo,rs,ls,He,ds,Ro,ps,cs,fs,fe,ms,me,us,ue,hs,he,qe,gs,Yo,bs,_s,ge,Le,ys,Oe,vs,_o,ws,$s,yt,L,be,zo,Ke,Ms,Ao,xs,vt,D,eo,js,Qo,Ts,Us,yo,vo,Zs,Js,Ps,Ho,qo,Es,Ds,Lo,Is,Gs,Oo,_e,Ko,ks,Ws,et,Bs,Fs,Ns,V,oo,Vs,ot,Cs,Ss,tt,Xs,Rs,ye,Ys,ve,zs,we,As,$e,to,Qs,nt,Hs,qs,Me,no,Ls,so,Os,wo,Ks,ea,wt;return o=new na({}),O=new xo({props:{warning:!0,$$slots:{default:[Qa]},$$scope:{ctx:J}}}),Ue=new na({}),Ze=new F({props:{name:"class diffusers.DiffusionPipeline",anchor:"diffusers.DiffusionPipeline",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L475"}}),Ee=new F({props:{name:"__call__",anchor:"diffusers.DiffusionPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),De=new F({props:{name:"device",anchor:"diffusers.DiffusionPipeline.device",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L719",returnDescription:`
<p>The torch device on which the pipeline is located.</p>
`,returnType:`
<p><code>torch.device</code></p>
`}}),Ie=new F({props:{name:"to",anchor:"diffusers.DiffusionPipeline.to",parameters:[{name:"torch_device",val:": typing.Union[str, torch.device, NoneType] = None"},{name:"torch_dtype",val:": typing.Optional[torch.dtype] = None"},{name:"silence_dtype_warnings",val:": bool = False"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L644"}}),Ge=new F({props:{name:"components",anchor:"diffusers.DiffusionPipeline.components",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1541"}}),ne=new lo({props:{anchor:"diffusers.DiffusionPipeline.components.example",$$slots:{default:[Ha]},$$scope:{ctx:J}}}),Be=new F({props:{name:"disable_attention_slicing",anchor:"diffusers.DiffusionPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1703"}}),Ne=new F({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.DiffusionPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1637"}}),Se=new F({props:{name:"download",anchor:"diffusers.DiffusionPipeline.download",parameters:[{name:"pretrained_model_name",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.download.pretrained_model_name",description:`<strong>pretrained_model_name</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
A string, the <em>repository id</em> (for example <code>CompVis/ldm-text2im-large-256</code>) of a pretrained pipeline
hosted on the Hub.`,name:"pretrained_model_name"},{anchor:"diffusers.DiffusionPipeline.download.custom_pipeline",description:`<strong>custom_pipeline</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>
<p>A string, the <em>repository id</em> (for example <code>CompVis/ldm-text2im-large-256</code>) of a pretrained
pipeline hosted on the Hub. The repository must contain a file called <code>pipeline.py</code> that defines
the custom pipeline.</p>
</li>
<li>
<p>A string, the <em>file name</em> of a community pipeline hosted on GitHub under
<a href="https://github.com/huggingface/diffusers/tree/main/examples/community" rel="nofollow">Community</a>. Valid file
names must match the file name and not the pipeline script (<code>clip_guided_stable_diffusion</code>
instead of <code>clip_guided_stable_diffusion.py</code>). Community pipelines are always loaded from the
current <code>main</code> branch of GitHub.</p>
</li>
<li>
<p>A path to a <em>directory</em> (<code>./my_pipeline_directory/</code>) containing a custom pipeline. The directory
must contain a file called <code>pipeline.py</code> that defines the custom pipeline.</p>
</li>
</ul>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>&#x1F9EA; This is an experimental feature and may change in the future.</p>

					</div>
<p>For more information on how to load and create custom pipelines, take a look at <a href="https://huggingface.co/docs/diffusers/main/en/using-diffusers/contribute_pipeline" rel="nofollow">How to contribute a
community pipeline</a>.`,name:"custom_pipeline"},{anchor:"diffusers.DiffusionPipeline.download.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.DiffusionPipeline.download.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.DiffusionPipeline.download.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.DiffusionPipeline.download.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.DiffusionPipeline.download.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.DiffusionPipeline.download.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.DiffusionPipeline.download.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.DiffusionPipeline.download.custom_revision",description:`<strong>custom_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 similar to
<code>revision</code> when loading a custom pipeline from the Hub. It can be a &#x1F917; Diffusers version when loading a
custom pipeline from GitHub, otherwise it defaults to <code>&quot;main&quot;</code> when loading from the Hub.`,name:"custom_revision"},{anchor:"diffusers.DiffusionPipeline.download.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"},{anchor:"diffusers.DiffusionPipeline.download.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Load weights from a specified variant filename such as <code>&quot;fp16&quot;</code> or <code>&quot;ema&quot;</code>. This is ignored when
loading <code>from_flax</code>.`,name:"variant"},{anchor:"diffusers.DiffusionPipeline.download.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.DiffusionPipeline.download.use_onnx",description:`<strong>use_onnx</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If set to <code>True</code>, ONNX weights will always be downloaded if present. If set to <code>False</code>, ONNX weights
will never be downloaded. By default <code>use_onnx</code> defaults to the <code>_is_onnx</code> class attribute which is
<code>False</code> for non-ONNX pipelines and <code>True</code> for ONNX pipelines. ONNX weights include both files ending
with <code>.onnx</code> and <code>.pb</code>.`,name:"use_onnx"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1211",returnDescription:`
<p>A path to the downloaded pipeline.</p>
`,returnType:`
<p><code>os.PathLike</code></p>
`}}),ie=new xo({props:{$$slots:{default:[qa]},$$scope:{ctx:J}}}),Xe=new F({props:{name:"enable_attention_slicing",anchor:"diffusers.DiffusionPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1663"}}),re=new xo({props:{warning:!0,$$slots:{default:[La]},$$scope:{ctx:J}}}),le=new lo({props:{anchor:"diffusers.DiffusionPipeline.enable_attention_slicing.example",$$slots:{default:[Oa]},$$scope:{ctx:J}}}),Re=new F({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.DiffusionPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:": int = 0"},{name:"device",val:": typing.Union[torch.device, str] = 'cuda'"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1177"}}),Ye=new F({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.DiffusionPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1602"}}),pe=new xo({props:{warning:!0,$$slots:{default:[Ka]},$$scope:{ctx:J}}}),ce=new lo({props:{anchor:"diffusers.DiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[ei]},$$scope:{ctx:J}}}),Qe=new F({props:{name:"from_pretrained",anchor:"diffusers.DiffusionPipeline.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike, NoneType]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>repo id</em> (for example <code>CompVis/ldm-text2im-large-256</code>) of a pretrained pipeline
hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_pipeline_directory/</code>) containing pipeline weights
saved using
<a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If &#x201C;auto&#x201D; is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.custom_pipeline",description:`<strong>custom_pipeline</strong> (<code>str</code>, <em>optional</em>) &#x2014;</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>&#x1F9EA; This is an experimental feature and may change in the future.</p>

					</div>
<p>Can be either:</p>
<ul>
<li>A string, the <em>repo id</em> (for example <code>hf-internal-testing/diffusers-dummy-pipeline</code>) of a custom
pipeline hosted on the Hub. The repository must contain a file called pipeline.py that defines
the custom pipeline.</li>
<li>A string, the <em>file name</em> of a community pipeline hosted on GitHub under
<a href="https://github.com/huggingface/diffusers/tree/main/examples/community" rel="nofollow">Community</a>. Valid file
names must match the file name and not the pipeline script (<code>clip_guided_stable_diffusion</code>
instead of <code>clip_guided_stable_diffusion.py</code>). Community pipelines are always loaded from the
current main branch of GitHub.</li>
<li>A path to a directory (<code>./my_pipeline_directory/</code>) containing a custom pipeline. The directory
must contain a file called <code>pipeline.py</code> that defines the custom pipeline.</li>
</ul>
<p>For more information on how to load and create custom pipelines, please have a look at <a href="https://huggingface.co/docs/diffusers/using-diffusers/custom_pipeline_overview" rel="nofollow">Loading and
Adding Custom
Pipelines</a>`,name:"custom_pipeline"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.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.DiffusionPipeline.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.custom_revision",description:`<strong>custom_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 similar to
<code>revision</code> when loading a custom pipeline from the Hub. It can be a &#x1F917; Diffusers version when loading a
custom pipeline from GitHub, otherwise it defaults to <code>&quot;main&quot;</code> when loading from the Hub.`,name:"custom_revision"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>Dict[str, Union[int, str, torch.device]]</code>, <em>optional</em>) &#x2014;
A map that specifies where each submodule should go. It doesn&#x2019;t need to be defined for each
parameter/buffer name; once a given module name is inside, every submodule of it will be sent to the
same device.</p>
<p>Set <code>device_map=&quot;auto&quot;</code> to have &#x1F917; Accelerate automatically compute the most optimized <code>device_map</code>. For
more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device
map</a>.`,name:"device_map"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.max_memory",description:`<strong>max_memory</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
A dictionary device identifier for the maximum memory. Will default to the maximum memory available for
each GPU and the available CPU RAM if unset.`,name:"max_memory"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.offload_folder",description:`<strong>offload_folder</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
The path to offload weights if device_map contains the value <code>&quot;disk&quot;</code>.`,name:"offload_folder"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.offload_state_dict",description:`<strong>offload_state_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, temporarily offloads the CPU state dict to the hard drive to avoid running out of CPU RAM if
the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to <code>True</code>
when there is some disk offload.`,name:"offload_state_dict"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading only loading the pretrained weights and not initializing the weights. This also
tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
Only supported for PyTorch &gt;= 1.9.0. If you are using an older version of PyTorch, setting this
argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.use_onnx",description:`<strong>use_onnx</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>True</code>, ONNX weights will always be downloaded if present. If set to <code>False</code>, ONNX weights
will never be downloaded. By default <code>use_onnx</code> defaults to the <code>_is_onnx</code> class attribute which is
<code>False</code> for non-ONNX pipelines and <code>True</code> for ONNX pipelines. ONNX weights include both files ending
with <code>.onnx</code> and <code>.pb</code>.`,name:"use_onnx"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline
class). The overwritten components are passed directly to the pipelines <code>__init__</code> method. See example
below for more information.`,name:"kwargs"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Load weights from a specified variant filename such as <code>&quot;fp16&quot;</code> or <code>&quot;ema&quot;</code>. This is ignored when
loading <code>from_flax</code>.`,name:"variant"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L734"}}),fe=new lo({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example",$$slots:{default:[oi]},$$scope:{ctx:J}}}),me=new xo({props:{$$slots:{default:[ti]},$$scope:{ctx:J}}}),ue=new lo({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example-2",$$slots:{default:[ni]},$$scope:{ctx:J}}}),qe=new F({props:{name:"numpy_to_pil",anchor:"diffusers.DiffusionPipeline.numpy_to_pil",parameters:[{name:"images",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1577"}}),Le=new F({props:{name:"save_pretrained",anchor:"diffusers.DiffusionPipeline.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"safe_serialization",val:": bool = False"},{name:"variant",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save a pipeline to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.DiffusionPipeline.save_pretrained.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way with <code>pickle</code>.`,name:"safe_serialization"},{anchor:"diffusers.DiffusionPipeline.save_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If specified, weights are saved in the format <code>pytorch_model.&lt;variant&gt;.bin</code>.`,name:"variant"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L556"}}),Ke=new na({}),eo=new F({props:{name:"class diffusers.FlaxDiffusionPipeline",anchor:"diffusers.FlaxDiffusionPipeline",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_flax_utils.py#L93"}}),oo=new F({props:{name:"from_pretrained",anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike, NoneType]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>repo id</em> (for example <code>runwayml/stable-diffusion-v1-5</code>) of a pretrained pipeline
hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_model_directory</code>) containing the model weights saved
using <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline.save_pretrained">save_pretrained()</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>str</code> or <code>jnp.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>jnp.dtype</code> and load the model under this dtype. If <code>&quot;auto&quot;</code>, the dtype is
automatically derived from the model&#x2019;s weights.`,name:"dtype"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.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.FlaxDiffusionPipeline.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (the pipeline components) of the specific pipeline
class. The overwritten components are passed directly to the pipelines <code>__init__</code> method.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_flax_utils.py#L191"}}),ye=new lo({props:{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.example",$$slots:{default:[si]},$$scope:{ctx:J}}}),ve=new xo({props:{$$slots:{default:[ai]},$$scope:{ctx:J}}}),we=new lo({props:{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.example-2",$$slots:{default:[ii]},$$scope:{ctx:J}}}),to=new F({props:{name:"numpy_to_pil",anchor:"diffusers.FlaxDiffusionPipeline.numpy_to_pil",parameters:[{name:"images",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_flax_utils.py#L529"}}),no=new F({props:{name:"save_pretrained",anchor:"diffusers.FlaxDiffusionPipeline.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"}],parametersDescription:[{anchor:"diffusers.FlaxDiffusionPipeline.save_pretrained.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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_flax_utils.py#L142"}}),{c(){s=a("meta"),g=m(),c=a("h1"),p=a("a"),h=a("span"),w(o.$$.fragment),f=m(),E=a("span"),P=l("Pipelines"),Z=m(),k=a("p"),W=l("Pipelines provide a simple way to run state-of-the-art diffusion models in inference by bundling all of the necessary components (multiple independently-trained models, schedulers, and processors) into a single end-to-end class. Pipelines are flexible and they can be adapted to use different scheduler or even model components."),G=m(),I=a("p"),Q=l("All pipelines are built from the base "),C=a("a"),fo=l("DiffusionPipeline"),mo=l(" class which provides basic functionality for loading, downloading, and saving all the components."),gt=m(),w(O.$$.fragment),bt=m(),H=a("h2"),K=a("a"),jo=a("span"),w(Ue.$$.fragment),Ct=m(),To=a("span"),St=l("DiffusionPipeline"),_t=m(),y=a("div"),w(Ze.$$.fragment),Xt=m(),Uo=a("p"),Rt=l("Base class for all pipelines."),Yt=m(),uo=a("p"),ho=a("a"),zt=l("DiffusionPipeline"),At=l(` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),Qt=m(),Je=a("ul"),Zo=a("li"),Ht=l("move all PyTorch modules to the device of your choice"),qt=m(),Jo=a("li"),Lt=l("enable/disable the progress bar for the denoising iteration"),Ot=m(),Po=a("p"),Kt=l("Class attributes:"),en=m(),Pe=a("ul"),ee=a("li"),Eo=a("strong"),on=l("config_name"),tn=l(" ("),Do=a("code"),nn=l("str"),sn=l(`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),an=m(),oe=a("li"),Io=a("strong"),rn=l("_optional_components"),ln=l(" ("),Go=a("code"),dn=l("List[str]"),pn=l(`) \u2014 List of all optional components that don\u2019t have to be passed to the
pipeline to function (should be overridden by subclasses).`),cn=m(),te=a("div"),w(Ee.$$.fragment),fn=m(),ko=a("p"),mn=l("Call self as a function."),un=m(),go=a("div"),w(De.$$.fragment),hn=m(),bo=a("div"),w(Ie.$$.fragment),gn=m(),S=a("div"),w(Ge.$$.fragment),bn=m(),ke=a("p"),_n=l("The "),Wo=a("code"),yn=l("self.components"),vn=l(` property can be useful to run different pipelines with the same weights and
configurations without reallocating additional memory.`),wn=m(),We=a("p"),$n=l("Returns ("),Bo=a("code"),Mn=l("dict"),xn=l(`):
A dictionary containing all the modules needed to initialize the pipeline.`),jn=m(),w(ne.$$.fragment),Tn=m(),se=a("div"),w(Be.$$.fragment),Un=m(),Fe=a("p"),Zn=l("Disable sliced attention computation. If "),Fo=a("code"),Jn=l("enable_attention_slicing"),Pn=l(` was previously called, attention is
computed in one step.`),En=m(),ae=a("div"),w(Ne.$$.fragment),Dn=m(),Ve=a("p"),In=l("Disable memory efficient attention from "),Ce=a("a"),Gn=l("xFormers"),kn=l("."),Wn=m(),A=a("div"),w(Se.$$.fragment),Bn=m(),No=a("p"),Fn=l("Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights."),Nn=m(),w(ie.$$.fragment),Vn=m(),X=a("div"),w(Xe.$$.fragment),Cn=m(),Vo=a("p"),Sn=l(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Xn=m(),w(re.$$.fragment),Rn=m(),w(le.$$.fragment),Yn=m(),de=a("div"),w(Re.$$.fragment),zn=m(),q=a("p"),An=l(`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
`),Co=a("code"),Qn=l("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Hn=l("forward"),So=a("code"),qn=l("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Ln=l("enable_model_cpu_offload`, but performance is lower."),On=m(),R=a("div"),w(Ye.$$.fragment),Kn=m(),ze=a("p"),es=l("Enable memory efficient attention from "),Ae=a("a"),os=l("xFormers"),ts=l(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),ns=m(),w(pe.$$.fragment),ss=m(),w(ce.$$.fragment),as=m(),N=a("div"),w(Qe.$$.fragment),is=m(),Xo=a("p"),rs=l("Instantiate a PyTorch diffusion pipeline from pretrained pipeline weights."),ls=m(),He=a("p"),ds=l("The pipeline is set in evaluation mode ("),Ro=a("code"),ps=l("model.eval()"),cs=l(") by default."),fs=m(),w(fe.$$.fragment),ms=m(),w(me.$$.fragment),us=m(),w(ue.$$.fragment),hs=m(),he=a("div"),w(qe.$$.fragment),gs=m(),Yo=a("p"),bs=l("Convert a NumPy image or a batch of images to a PIL image."),_s=m(),ge=a("div"),w(Le.$$.fragment),ys=m(),Oe=a("p"),vs=l(`Save all saveable variables of the pipeline to a directory. A pipeline variable can be saved and loaded if its
class implements both a save and loading method. The pipeline is easily reloaded using the
`),_o=a("a"),ws=l("from_pretrained()"),$s=l(" class method."),yt=m(),L=a("h2"),be=a("a"),zo=a("span"),w(Ke.$$.fragment),Ms=m(),Ao=a("span"),xs=l("FlaxDiffusionPipeline"),vt=m(),D=a("div"),w(eo.$$.fragment),js=m(),Qo=a("p"),Ts=l("Base class for Flax-based pipelines."),Us=m(),yo=a("p"),vo=a("a"),Zs=l("FlaxDiffusionPipeline"),Js=l(` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),Ps=m(),Ho=a("ul"),qo=a("li"),Es=l("enable/disable the progress bar for the denoising iteration"),Ds=m(),Lo=a("p"),Is=l("Class attributes:"),Gs=m(),Oo=a("ul"),_e=a("li"),Ko=a("strong"),ks=l("config_name"),Ws=l(" ("),et=a("code"),Bs=l("str"),Fs=l(`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),Ns=m(),V=a("div"),w(oo.$$.fragment),Vs=m(),ot=a("p"),Cs=l("Instantiate a Flax-based diffusion pipeline from pretrained pipeline weights."),Ss=m(),tt=a("p"),Xs=l("The pipeline is set in evaluation mode (`model.eval()) by default and dropout modules are deactivated."),Rs=m(),w(ye.$$.fragment),Ys=m(),w(ve.$$.fragment),zs=m(),w(we.$$.fragment),As=m(),$e=a("div"),w(to.$$.fragment),Qs=m(),nt=a("p"),Hs=l("Convert a NumPy image or a batch of images to a PIL image."),qs=m(),Me=a("div"),w(no.$$.fragment),Ls=m(),so=a("p"),Os=l(`Save all saveable variables of the pipeline to a directory. A pipeline variable can be saved and loaded if its
class implements both a save and loading method. The pipeline is easily reloaded using the
`),wo=a("a"),Ks=l("from_pretrained()"),ea=l(" class method."),this.h()},l(n){const _=za('[data-svelte="svelte-1phssyn"]',document.head);s=i(_,"META",{name:!0,content:!0}),_.forEach(t),g=u(n),c=i(n,"H1",{class:!0});var ao=r(c);p=i(ao,"A",{id:!0,class:!0,href:!0});var st=r(p);h=i(st,"SPAN",{});var at=r(h);$(o.$$.fragment,at),at.forEach(t),st.forEach(t),f=u(ao),E=i(ao,"SPAN",{});var it=r(E);P=d(it,"Pipelines"),it.forEach(t),ao.forEach(t),Z=u(n),k=i(n,"P",{});var rt=r(k);W=d(rt,"Pipelines provide a simple way to run state-of-the-art diffusion models in inference by bundling all of the necessary components (multiple independently-trained models, schedulers, and processors) into a single end-to-end class. Pipelines are flexible and they can be adapted to use different scheduler or even model components."),rt.forEach(t),G=u(n),I=i(n,"P",{});var io=r(I);Q=d(io,"All pipelines are built from the base "),C=i(io,"A",{href:!0});var lt=r(C);fo=d(lt,"DiffusionPipeline"),lt.forEach(t),mo=d(io," class which provides basic functionality for loading, downloading, and saving all the components."),io.forEach(t),gt=u(n),$(O.$$.fragment,n),bt=u(n),H=i(n,"H2",{class:!0});var ro=r(H);K=i(ro,"A",{id:!0,class:!0,href:!0});var dt=r(K);jo=i(dt,"SPAN",{});var pt=r(jo);$(Ue.$$.fragment,pt),pt.forEach(t),dt.forEach(t),Ct=u(ro),To=i(ro,"SPAN",{});var ct=r(To);St=d(ct,"DiffusionPipeline"),ct.forEach(t),ro.forEach(t),_t=u(n),y=i(n,"DIV",{class:!0});var v=r(y);$(Ze.$$.fragment,v),Xt=u(v),Uo=i(v,"P",{});var ft=r(Uo);Rt=d(ft,"Base class for all pipelines."),ft.forEach(t),Yt=u(v),uo=i(v,"P",{});var oa=r(uo);ho=i(oa,"A",{href:!0});var sa=r(ho);zt=d(sa,"DiffusionPipeline"),sa.forEach(t),At=d(oa,` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),oa.forEach(t),Qt=u(v),Je=i(v,"UL",{});var $t=r(Je);Zo=i($t,"LI",{});var aa=r(Zo);Ht=d(aa,"move all PyTorch modules to the device of your choice"),aa.forEach(t),qt=u($t),Jo=i($t,"LI",{});var ia=r(Jo);Lt=d(ia,"enable/disable the progress bar for the denoising iteration"),ia.forEach(t),$t.forEach(t),Ot=u(v),Po=i(v,"P",{});var ra=r(Po);Kt=d(ra,"Class attributes:"),ra.forEach(t),en=u(v),Pe=i(v,"UL",{});var Mt=r(Pe);ee=i(Mt,"LI",{});var mt=r(ee);Eo=i(mt,"STRONG",{});var la=r(Eo);on=d(la,"config_name"),la.forEach(t),tn=d(mt," ("),Do=i(mt,"CODE",{});var da=r(Do);nn=d(da,"str"),da.forEach(t),sn=d(mt,`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),mt.forEach(t),an=u(Mt),oe=i(Mt,"LI",{});var ut=r(oe);Io=i(ut,"STRONG",{});var pa=r(Io);rn=d(pa,"_optional_components"),pa.forEach(t),ln=d(ut," ("),Go=i(ut,"CODE",{});var ca=r(Go);dn=d(ca,"List[str]"),ca.forEach(t),pn=d(ut,`) \u2014 List of all optional components that don\u2019t have to be passed to the
pipeline to function (should be overridden by subclasses).`),ut.forEach(t),Mt.forEach(t),cn=u(v),te=i(v,"DIV",{class:!0});var xt=r(te);$(Ee.$$.fragment,xt),fn=u(xt),ko=i(xt,"P",{});var fa=r(ko);mn=d(fa,"Call self as a function."),fa.forEach(t),xt.forEach(t),un=u(v),go=i(v,"DIV",{class:!0});var ma=r(go);$(De.$$.fragment,ma),ma.forEach(t),hn=u(v),bo=i(v,"DIV",{class:!0});var ua=r(bo);$(Ie.$$.fragment,ua),ua.forEach(t),gn=u(v),S=i(v,"DIV",{class:!0});var xe=r(S);$(Ge.$$.fragment,xe),bn=u(xe),ke=i(xe,"P",{});var jt=r(ke);_n=d(jt,"The "),Wo=i(jt,"CODE",{});var ha=r(Wo);yn=d(ha,"self.components"),ha.forEach(t),vn=d(jt,` property can be useful to run different pipelines with the same weights and
configurations without reallocating additional memory.`),jt.forEach(t),wn=u(xe),We=i(xe,"P",{});var Tt=r(We);$n=d(Tt,"Returns ("),Bo=i(Tt,"CODE",{});var ga=r(Bo);Mn=d(ga,"dict"),ga.forEach(t),xn=d(Tt,`):
A dictionary containing all the modules needed to initialize the pipeline.`),Tt.forEach(t),jn=u(xe),$(ne.$$.fragment,xe),xe.forEach(t),Tn=u(v),se=i(v,"DIV",{class:!0});var Ut=r(se);$(Be.$$.fragment,Ut),Un=u(Ut),Fe=i(Ut,"P",{});var Zt=r(Fe);Zn=d(Zt,"Disable sliced attention computation. If "),Fo=i(Zt,"CODE",{});var ba=r(Fo);Jn=d(ba,"enable_attention_slicing"),ba.forEach(t),Pn=d(Zt,` was previously called, attention is
computed in one step.`),Zt.forEach(t),Ut.forEach(t),En=u(v),ae=i(v,"DIV",{class:!0});var Jt=r(ae);$(Ne.$$.fragment,Jt),Dn=u(Jt),Ve=i(Jt,"P",{});var Pt=r(Ve);In=d(Pt,"Disable memory efficient attention from "),Ce=i(Pt,"A",{href:!0,rel:!0});var _a=r(Ce);Gn=d(_a,"xFormers"),_a.forEach(t),kn=d(Pt,"."),Pt.forEach(t),Jt.forEach(t),Wn=u(v),A=i(v,"DIV",{class:!0});var $o=r(A);$(Se.$$.fragment,$o),Bn=u($o),No=i($o,"P",{});var ya=r(No);Fn=d(ya,"Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights."),ya.forEach(t),Nn=u($o),$(ie.$$.fragment,$o),$o.forEach(t),Vn=u(v),X=i(v,"DIV",{class:!0});var je=r(X);$(Xe.$$.fragment,je),Cn=u(je),Vo=i(je,"P",{});var va=r(Vo);Sn=d(va,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),va.forEach(t),Xn=u(je),$(re.$$.fragment,je),Rn=u(je),$(le.$$.fragment,je),je.forEach(t),Yn=u(v),de=i(v,"DIV",{class:!0});var Et=r(de);$(Re.$$.fragment,Et),zn=u(Et),q=i(Et,"P",{});var Mo=r(q);An=d(Mo,`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
`),Co=i(Mo,"CODE",{});var wa=r(Co);Qn=d(wa,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),wa.forEach(t),Hn=d(Mo,"forward"),So=i(Mo,"CODE",{});var $a=r(So);qn=d($a,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),$a.forEach(t),Ln=d(Mo,"enable_model_cpu_offload`, but performance is lower."),Mo.forEach(t),Et.forEach(t),On=u(v),R=i(v,"DIV",{class:!0});var Te=r(R);$(Ye.$$.fragment,Te),Kn=u(Te),ze=i(Te,"P",{});var Dt=r(ze);es=d(Dt,"Enable memory efficient attention from "),Ae=i(Dt,"A",{href:!0,rel:!0});var Ma=r(Ae);os=d(Ma,"xFormers"),Ma.forEach(t),ts=d(Dt,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Dt.forEach(t),ns=u(Te),$(pe.$$.fragment,Te),ss=u(Te),$(ce.$$.fragment,Te),Te.forEach(t),as=u(v),N=i(v,"DIV",{class:!0});var Y=r(N);$(Qe.$$.fragment,Y),is=u(Y),Xo=i(Y,"P",{});var xa=r(Xo);rs=d(xa,"Instantiate a PyTorch diffusion pipeline from pretrained pipeline weights."),xa.forEach(t),ls=u(Y),He=i(Y,"P",{});var It=r(He);ds=d(It,"The pipeline is set in evaluation mode ("),Ro=i(It,"CODE",{});var ja=r(Ro);ps=d(ja,"model.eval()"),ja.forEach(t),cs=d(It,") by default."),It.forEach(t),fs=u(Y),$(fe.$$.fragment,Y),ms=u(Y),$(me.$$.fragment,Y),us=u(Y),$(ue.$$.fragment,Y),Y.forEach(t),hs=u(v),he=i(v,"DIV",{class:!0});var Gt=r(he);$(qe.$$.fragment,Gt),gs=u(Gt),Yo=i(Gt,"P",{});var Ta=r(Yo);bs=d(Ta,"Convert a NumPy image or a batch of images to a PIL image."),Ta.forEach(t),Gt.forEach(t),_s=u(v),ge=i(v,"DIV",{class:!0});var kt=r(ge);$(Le.$$.fragment,kt),ys=u(kt),Oe=i(kt,"P",{});var Wt=r(Oe);vs=d(Wt,`Save all saveable variables of the pipeline to a directory. A pipeline variable can be saved and loaded if its
class implements both a save and loading method. The pipeline is easily reloaded using the
`),_o=i(Wt,"A",{href:!0});var Ua=r(_o);ws=d(Ua,"from_pretrained()"),Ua.forEach(t),$s=d(Wt," class method."),Wt.forEach(t),kt.forEach(t),v.forEach(t),yt=u(n),L=i(n,"H2",{class:!0});var Bt=r(L);be=i(Bt,"A",{id:!0,class:!0,href:!0});var Za=r(be);zo=i(Za,"SPAN",{});var Ja=r(zo);$(Ke.$$.fragment,Ja),Ja.forEach(t),Za.forEach(t),Ms=u(Bt),Ao=i(Bt,"SPAN",{});var Pa=r(Ao);xs=d(Pa,"FlaxDiffusionPipeline"),Pa.forEach(t),Bt.forEach(t),vt=u(n),D=i(n,"DIV",{class:!0});var B=r(D);$(eo.$$.fragment,B),js=u(B),Qo=i(B,"P",{});var Ea=r(Qo);Ts=d(Ea,"Base class for Flax-based pipelines."),Ea.forEach(t),Us=u(B),yo=i(B,"P",{});var ta=r(yo);vo=i(ta,"A",{href:!0});var Da=r(vo);Zs=d(Da,"FlaxDiffusionPipeline"),Da.forEach(t),Js=d(ta,` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),ta.forEach(t),Ps=u(B),Ho=i(B,"UL",{});var Ia=r(Ho);qo=i(Ia,"LI",{});var Ga=r(qo);Es=d(Ga,"enable/disable the progress bar for the denoising iteration"),Ga.forEach(t),Ia.forEach(t),Ds=u(B),Lo=i(B,"P",{});var ka=r(Lo);Is=d(ka,"Class attributes:"),ka.forEach(t),Gs=u(B),Oo=i(B,"UL",{});var Wa=r(Oo);_e=i(Wa,"LI",{});var ht=r(_e);Ko=i(ht,"STRONG",{});var Ba=r(Ko);ks=d(Ba,"config_name"),Ba.forEach(t),Ws=d(ht," ("),et=i(ht,"CODE",{});var Fa=r(et);Bs=d(Fa,"str"),Fa.forEach(t),Fs=d(ht,`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),ht.forEach(t),Wa.forEach(t),Ns=u(B),V=i(B,"DIV",{class:!0});var z=r(V);$(oo.$$.fragment,z),Vs=u(z),ot=i(z,"P",{});var Na=r(ot);Cs=d(Na,"Instantiate a Flax-based diffusion pipeline from pretrained pipeline weights."),Na.forEach(t),Ss=u(z),tt=i(z,"P",{});var Va=r(tt);Xs=d(Va,"The pipeline is set in evaluation mode (`model.eval()) by default and dropout modules are deactivated."),Va.forEach(t),Rs=u(z),$(ye.$$.fragment,z),Ys=u(z),$(ve.$$.fragment,z),zs=u(z),$(we.$$.fragment,z),z.forEach(t),As=u(B),$e=i(B,"DIV",{class:!0});var Ft=r($e);$(to.$$.fragment,Ft),Qs=u(Ft),nt=i(Ft,"P",{});var Ca=r(nt);Hs=d(Ca,"Convert a NumPy image or a batch of images to a PIL image."),Ca.forEach(t),Ft.forEach(t),qs=u(B),Me=i(B,"DIV",{class:!0});var Nt=r(Me);$(no.$$.fragment,Nt),Ls=u(Nt),so=i(Nt,"P",{});var Vt=r(so);Os=d(Vt,`Save all saveable variables of the pipeline to a directory. A pipeline variable can be saved and loaded if its
class implements both a save and loading method. The pipeline is easily reloaded using the
`),wo=i(Vt,"A",{href:!0});var Sa=r(wo);Ks=d(Sa,"from_pretrained()"),Sa.forEach(t),ea=d(Vt," class method."),Vt.forEach(t),Nt.forEach(t),B.forEach(t),this.h()},h(){b(s,"name","hf:doc:metadata"),b(s,"content",JSON.stringify(li)),b(p,"id","pipelines"),b(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"),b(p,"href","#pipelines"),b(c,"class","relative group"),b(C,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),b(K,"id","diffusers.DiffusionPipeline"),b(K,"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"),b(K,"href","#diffusers.DiffusionPipeline"),b(H,"class","relative group"),b(ho,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),b(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Ce,"href","https://facebookresearch.github.io/xformers/"),b(Ce,"rel","nofollow"),b(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Ae,"href","https://facebookresearch.github.io/xformers/"),b(Ae,"rel","nofollow"),b(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(_o,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained"),b(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(be,"id","diffusers.FlaxDiffusionPipeline"),b(be,"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"),b(be,"href","#diffusers.FlaxDiffusionPipeline"),b(L,"class","relative group"),b(vo,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),b(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(wo,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline.from_pretrained"),b(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,_){e(document.head,s),U(n,g,_),U(n,c,_),e(c,p),e(p,h),M(o,h,null),e(c,f),e(c,E),e(E,P),U(n,Z,_),U(n,k,_),e(k,W),U(n,G,_),U(n,I,_),e(I,Q),e(I,C),e(C,fo),e(I,mo),U(n,gt,_),M(O,n,_),U(n,bt,_),U(n,H,_),e(H,K),e(K,jo),M(Ue,jo,null),e(H,Ct),e(H,To),e(To,St),U(n,_t,_),U(n,y,_),M(Ze,y,null),e(y,Xt),e(y,Uo),e(Uo,Rt),e(y,Yt),e(y,uo),e(uo,ho),e(ho,zt),e(uo,At),e(y,Qt),e(y,Je),e(Je,Zo),e(Zo,Ht),e(Je,qt),e(Je,Jo),e(Jo,Lt),e(y,Ot),e(y,Po),e(Po,Kt),e(y,en),e(y,Pe),e(Pe,ee),e(ee,Eo),e(Eo,on),e(ee,tn),e(ee,Do),e(Do,nn),e(ee,sn),e(Pe,an),e(Pe,oe),e(oe,Io),e(Io,rn),e(oe,ln),e(oe,Go),e(Go,dn),e(oe,pn),e(y,cn),e(y,te),M(Ee,te,null),e(te,fn),e(te,ko),e(ko,mn),e(y,un),e(y,go),M(De,go,null),e(y,hn),e(y,bo),M(Ie,bo,null),e(y,gn),e(y,S),M(Ge,S,null),e(S,bn),e(S,ke),e(ke,_n),e(ke,Wo),e(Wo,yn),e(ke,vn),e(S,wn),e(S,We),e(We,$n),e(We,Bo),e(Bo,Mn),e(We,xn),e(S,jn),M(ne,S,null),e(y,Tn),e(y,se),M(Be,se,null),e(se,Un),e(se,Fe),e(Fe,Zn),e(Fe,Fo),e(Fo,Jn),e(Fe,Pn),e(y,En),e(y,ae),M(Ne,ae,null),e(ae,Dn),e(ae,Ve),e(Ve,In),e(Ve,Ce),e(Ce,Gn),e(Ve,kn),e(y,Wn),e(y,A),M(Se,A,null),e(A,Bn),e(A,No),e(No,Fn),e(A,Nn),M(ie,A,null),e(y,Vn),e(y,X),M(Xe,X,null),e(X,Cn),e(X,Vo),e(Vo,Sn),e(X,Xn),M(re,X,null),e(X,Rn),M(le,X,null),e(y,Yn),e(y,de),M(Re,de,null),e(de,zn),e(de,q),e(q,An),e(q,Co),e(Co,Qn),e(q,Hn),e(q,So),e(So,qn),e(q,Ln),e(y,On),e(y,R),M(Ye,R,null),e(R,Kn),e(R,ze),e(ze,es),e(ze,Ae),e(Ae,os),e(ze,ts),e(R,ns),M(pe,R,null),e(R,ss),M(ce,R,null),e(y,as),e(y,N),M(Qe,N,null),e(N,is),e(N,Xo),e(Xo,rs),e(N,ls),e(N,He),e(He,ds),e(He,Ro),e(Ro,ps),e(He,cs),e(N,fs),M(fe,N,null),e(N,ms),M(me,N,null),e(N,us),M(ue,N,null),e(y,hs),e(y,he),M(qe,he,null),e(he,gs),e(he,Yo),e(Yo,bs),e(y,_s),e(y,ge),M(Le,ge,null),e(ge,ys),e(ge,Oe),e(Oe,vs),e(Oe,_o),e(_o,ws),e(Oe,$s),U(n,yt,_),U(n,L,_),e(L,be),e(be,zo),M(Ke,zo,null),e(L,Ms),e(L,Ao),e(Ao,xs),U(n,vt,_),U(n,D,_),M(eo,D,null),e(D,js),e(D,Qo),e(Qo,Ts),e(D,Us),e(D,yo),e(yo,vo),e(vo,Zs),e(yo,Js),e(D,Ps),e(D,Ho),e(Ho,qo),e(qo,Es),e(D,Ds),e(D,Lo),e(Lo,Is),e(D,Gs),e(D,Oo),e(Oo,_e),e(_e,Ko),e(Ko,ks),e(_e,Ws),e(_e,et),e(et,Bs),e(_e,Fs),e(D,Ns),e(D,V),M(oo,V,null),e(V,Vs),e(V,ot),e(ot,Cs),e(V,Ss),e(V,tt),e(tt,Xs),e(V,Rs),M(ye,V,null),e(V,Ys),M(ve,V,null),e(V,zs),M(we,V,null),e(D,As),e(D,$e),M(to,$e,null),e($e,Qs),e($e,nt),e(nt,Hs),e(D,qs),e(D,Me),M(no,Me,null),e(Me,Ls),e(Me,so),e(so,Os),e(so,wo),e(wo,Ks),e(so,ea),wt=!0},p(n,[_]){const ao={};_&2&&(ao.$$scope={dirty:_,ctx:n}),O.$set(ao);const st={};_&2&&(st.$$scope={dirty:_,ctx:n}),ne.$set(st);const at={};_&2&&(at.$$scope={dirty:_,ctx:n}),ie.$set(at);const it={};_&2&&(it.$$scope={dirty:_,ctx:n}),re.$set(it);const rt={};_&2&&(rt.$$scope={dirty:_,ctx:n}),le.$set(rt);const io={};_&2&&(io.$$scope={dirty:_,ctx:n}),pe.$set(io);const lt={};_&2&&(lt.$$scope={dirty:_,ctx:n}),ce.$set(lt);const ro={};_&2&&(ro.$$scope={dirty:_,ctx:n}),fe.$set(ro);const dt={};_&2&&(dt.$$scope={dirty:_,ctx:n}),me.$set(dt);const pt={};_&2&&(pt.$$scope={dirty:_,ctx:n}),ue.$set(pt);const ct={};_&2&&(ct.$$scope={dirty:_,ctx:n}),ye.$set(ct);const v={};_&2&&(v.$$scope={dirty:_,ctx:n}),ve.$set(v);const ft={};_&2&&(ft.$$scope={dirty:_,ctx:n}),we.$set(ft)},i(n){wt||(x(o.$$.fragment,n),x(O.$$.fragment,n),x(Ue.$$.fragment,n),x(Ze.$$.fragment,n),x(Ee.$$.fragment,n),x(De.$$.fragment,n),x(Ie.$$.fragment,n),x(Ge.$$.fragment,n),x(ne.$$.fragment,n),x(Be.$$.fragment,n),x(Ne.$$.fragment,n),x(Se.$$.fragment,n),x(ie.$$.fragment,n),x(Xe.$$.fragment,n),x(re.$$.fragment,n),x(le.$$.fragment,n),x(Re.$$.fragment,n),x(Ye.$$.fragment,n),x(pe.$$.fragment,n),x(ce.$$.fragment,n),x(Qe.$$.fragment,n),x(fe.$$.fragment,n),x(me.$$.fragment,n),x(ue.$$.fragment,n),x(qe.$$.fragment,n),x(Le.$$.fragment,n),x(Ke.$$.fragment,n),x(eo.$$.fragment,n),x(oo.$$.fragment,n),x(ye.$$.fragment,n),x(ve.$$.fragment,n),x(we.$$.fragment,n),x(to.$$.fragment,n),x(no.$$.fragment,n),wt=!0)},o(n){j(o.$$.fragment,n),j(O.$$.fragment,n),j(Ue.$$.fragment,n),j(Ze.$$.fragment,n),j(Ee.$$.fragment,n),j(De.$$.fragment,n),j(Ie.$$.fragment,n),j(Ge.$$.fragment,n),j(ne.$$.fragment,n),j(Be.$$.fragment,n),j(Ne.$$.fragment,n),j(Se.$$.fragment,n),j(ie.$$.fragment,n),j(Xe.$$.fragment,n),j(re.$$.fragment,n),j(le.$$.fragment,n),j(Re.$$.fragment,n),j(Ye.$$.fragment,n),j(pe.$$.fragment,n),j(ce.$$.fragment,n),j(Qe.$$.fragment,n),j(fe.$$.fragment,n),j(me.$$.fragment,n),j(ue.$$.fragment,n),j(qe.$$.fragment,n),j(Le.$$.fragment,n),j(Ke.$$.fragment,n),j(eo.$$.fragment,n),j(oo.$$.fragment,n),j(ye.$$.fragment,n),j(ve.$$.fragment,n),j(we.$$.fragment,n),j(to.$$.fragment,n),j(no.$$.fragment,n),wt=!1},d(n){t(s),n&&t(g),n&&t(c),T(o),n&&t(Z),n&&t(k),n&&t(G),n&&t(I),n&&t(gt),T(O,n),n&&t(bt),n&&t(H),T(Ue),n&&t(_t),n&&t(y),T(Ze),T(Ee),T(De),T(Ie),T(Ge),T(ne),T(Be),T(Ne),T(Se),T(ie),T(Xe),T(re),T(le),T(Re),T(Ye),T(pe),T(ce),T(Qe),T(fe),T(me),T(ue),T(qe),T(Le),n&&t(yt),n&&t(L),T(Ke),n&&t(vt),n&&t(D),T(eo),T(oo),T(ye),T(ve),T(we),T(to),T(no)}}}const li={local:"pipelines",sections:[{local:"diffusers.DiffusionPipeline",title:"DiffusionPipeline"},{local:"diffusers.FlaxDiffusionPipeline",title:"FlaxDiffusionPipeline"}],title:"Pipelines"};function di(J){return Aa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gi extends Xa{constructor(s){super();Ra(this,s,di,ri,Ya,{})}}export{gi as default,li as metadata};
