import{S as yi,i as vi,s as wi,e as a,k as m,w as y,t as l,M as $i,c as i,d as t,m as u,a as r,x as v,h as d,b,G as e,g as U,y as w,q as $,o as M,B as x,v as Mi,L as De}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Go}from"../../../chunks/Tip-hf-doc-builder.js";import{D as W}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Ie}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as an}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ke}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function xi(P){let s,g,c,p,h,o,f,E,J,Z,G,B;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"),J=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"),G=l("Training"),B=l(" guides instead!"),this.h()},l(I){s=i(I,"P",{});var D=r(s);g=d(D,"Pipelines do not offer any training functionality. You\u2019ll notice PyTorch\u2019s autograd is disabled by decorating the "),c=i(D,"CODE",{});var q=r(c);p=d(q,"__call__()"),q.forEach(t),h=d(D," method with a "),o=i(D,"A",{href:!0,rel:!0});var C=r(o);f=i(C,"CODE",{});var vo=r(f);E=d(vo,"torch.no_grad"),vo.forEach(t),C.forEach(t),J=d(D," decorator because pipelines should not be used for training. If you\u2019re interested in training, please take a look at the "),Z=i(D,"A",{href:!0});var wo=r(Z);G=d(wo,"Training"),wo.forEach(t),B=d(D," guides instead!"),D.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(I,D){U(I,s,D),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(f,E),e(s,J),e(s,Z),e(Z,G),e(s,B)},d(I){I&&t(s)}}}function Ti(P){let s,g,c,p,h;return p=new Ie({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(),y(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function ji(P){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(J){s=i(J,"P",{});var Z=r(s);g=d(Z,"To use private or "),c=i(Z,"A",{href:!0,rel:!0});var G=r(c);p=d(G,"gated models"),G.forEach(t),h=d(Z,`, log-in with
`),o=i(Z,"CODE",{});var B=r(o);f=d(B,"huggingface-cli login"),B.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(J,Z){U(J,s,Z),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(s,E)},d(J){J&&t(s)}}}function Ui(P){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 Zi(P){let s,g,c,p,h;return p=new Ie({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(),y(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function Pi(P){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 Ji(P){let s,g,c,p,h;return p=new Ie({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(),y(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function Ei(P){let s,g,c,p,h;return p=new Ie({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(),y(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),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function ki(P){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(J){s=i(J,"P",{});var Z=r(s);g=d(Z,"To use private or "),c=i(Z,"A",{href:!0,rel:!0});var G=r(c);p=d(G,"gated"),G.forEach(t),h=d(Z,` models, log-in with
`),o=i(Z,"CODE",{});var B=r(o);f=d(B,"huggingface-cli login"),B.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(J,Z){U(J,s,Z),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(s,E)},d(J){J&&t(s)}}}function Di(P){let s,g,c,p,h;return p=new Ie({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(),y(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function Ii(P){let s,g,c,p,h;return p=new Ie({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(),y(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),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function Gi(P){let s,g,c,p,h,o,f,E,J,Z,G;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
`),J=a("a"),Z=l("\u201Coffline-mode\u201D"),G=l(` to use this method in a
firewalled environment.`),this.h()},l(B){s=i(B,"P",{});var I=r(s);g=d(I,"To use private or "),c=i(I,"A",{href:!0,rel:!0});var D=r(c);p=d(D,"gated models"),D.forEach(t),h=d(I,`, log-in with
`),o=i(I,"CODE",{});var q=r(o);f=d(q,"huggingface-cli login"),q.forEach(t),E=d(I,`. You can also activate the special
`),J=i(I,"A",{href:!0,rel:!0});var C=r(J);Z=d(C,"\u201Coffline-mode\u201D"),C.forEach(t),G=d(I,` to use this method in a
firewalled environment.`),I.forEach(t),this.h()},h(){b(c,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),b(c,"rel","nofollow"),b(J,"href","https://huggingface.co/diffusers/installation.html#offline-mode"),b(J,"rel","nofollow")},m(B,I){U(B,s,I),e(s,g),e(s,c),e(c,p),e(s,h),e(s,o),e(o,f),e(s,E),e(s,J),e(J,Z),e(s,G)},d(B){B&&t(s)}}}function Wi(P){let s,g,c,p,h;return p=new Ie({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(),y(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function Bi(P){let s,g,c,p,h;return p=new Ie({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMiUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC11bmV0JTIyLiUwQXVuZXQucHVzaF90b19odWIoJTIybXktZmluZXR1bmVkLXVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtdW5ldCUyMi4lMEF1bmV0LnB1c2hfdG9faHViKCUyMnlvdXItb3JnJTJGbXktZmluZXR1bmVkLXVuZXQlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

unet = UNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)

<span class="hljs-comment"># Push the \`unet\` to your namespace with the name &quot;my-finetuned-unet&quot;.</span>
unet.push_to_hub(<span class="hljs-string">&quot;my-finetuned-unet&quot;</span>)

<span class="hljs-comment"># Push the \`unet\` to an organization with the name &quot;my-finetuned-unet&quot;.</span>
unet.push_to_hub(<span class="hljs-string">&quot;your-org/my-finetuned-unet&quot;</span>)`}}),{c(){s=a("p"),g=l("Examples:"),c=m(),y(p.$$.fragment)},l(o){s=i(o,"P",{});var f=r(s);g=d(f,"Examples:"),f.forEach(t),c=u(o),v(p.$$.fragment,o)},m(o,f){U(o,s,f),e(s,g),U(o,c,f),w(p,o,f),h=!0},p:De,i(o){h||($(p.$$.fragment,o),h=!0)},o(o){M(p.$$.fragment,o),h=!1},d(o){o&&t(s),o&&t(c),x(p,o)}}}function Fi(P){let s,g,c,p,h,o,f,E,J,Z,G,B,I,D,q,C,vo,wo,Et,oe,kt,L,te,Wo,Ge,rn,Bo,ln,Dt,T,We,dn,Fo,pn,cn,$o,Mo,fn,mn,un,Be,No,hn,gn,Vo,bn,_n,Co,yn,vn,Fe,ne,Xo,wn,$n,So,Mn,xn,Tn,se,Ro,jn,Un,Ho,Zn,Pn,Jn,ae,Ne,En,Yo,kn,Dn,xo,Ve,In,To,Ce,Gn,X,Xe,Wn,Se,Bn,zo,Fn,Nn,Vn,Re,Cn,Ao,Xn,Sn,Rn,ie,Hn,re,He,Yn,Ye,zn,Qo,An,Qn,qn,le,ze,Ln,Ae,On,Qe,Kn,es,os,A,qe,ts,qo,ns,ss,de,as,S,Le,is,Lo,rs,ls,pe,ds,ce,ps,fe,Oe,cs,O,fs,Oo,ms,us,Ko,hs,gs,bs,R,Ke,_s,eo,ys,oo,vs,ws,$s,me,Ms,ue,xs,N,to,Ts,et,js,Us,no,Zs,ot,Ps,Js,Es,he,ks,ge,Ds,be,Is,_e,so,Gs,tt,Ws,Bs,ye,ao,Fs,io,Ns,jo,Vs,Cs,It,K,ve,nt,ro,Xs,st,Ss,Gt,k,lo,Rs,at,Hs,Ys,Uo,Zo,zs,As,Qs,it,rt,qs,Ls,lt,Os,Ks,dt,we,pt,ea,oa,ct,ta,na,sa,V,po,aa,ft,ia,ra,mt,la,da,$e,pa,Me,ca,xe,fa,Te,co,ma,ut,ua,ha,je,fo,ga,mo,ba,Po,_a,ya,Wt,ee,Ue,ht,uo,va,gt,wa,Bt,z,ho,$a,bt,Ma,xa,Q,go,Ta,_t,ja,Ua,Ze,Ft;return o=new an({}),oe=new Go({props:{warning:!0,$$slots:{default:[xi]},$$scope:{ctx:P}}}),Ge=new an({}),We=new W({props:{name:"class diffusers.DiffusionPipeline",anchor:"diffusers.DiffusionPipeline",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L475"}}),Ne=new W({props:{name:"__call__",anchor:"diffusers.DiffusionPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),Ve=new W({props:{name:"device",anchor:"diffusers.DiffusionPipeline.device",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L744",returnDescription:`
<p>The torch device on which the pipeline is located.</p>
`,returnType:`
<p><code>torch.device</code></p>
`}}),Ce=new W({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#L669"}}),Xe=new W({props:{name:"components",anchor:"diffusers.DiffusionPipeline.components",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1572"}}),ie=new ke({props:{anchor:"diffusers.DiffusionPipeline.components.example",$$slots:{default:[Ti]},$$scope:{ctx:P}}}),He=new W({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#L1734"}}),ze=new W({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#L1668"}}),qe=new W({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#L1242",returnDescription:`
<p>A path to the downloaded pipeline.</p>
`,returnType:`
<p><code>os.PathLike</code></p>
`}}),de=new Go({props:{$$slots:{default:[ji]},$$scope:{ctx:P}}}),Le=new W({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#L1694"}}),pe=new Go({props:{warning:!0,$$slots:{default:[Ui]},$$scope:{ctx:P}}}),ce=new ke({props:{anchor:"diffusers.DiffusionPipeline.enable_attention_slicing.example",$$slots:{default:[Zi]},$$scope:{ctx:P}}}),Oe=new W({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#L1208"}}),Ke=new W({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#L1633"}}),me=new Go({props:{warning:!0,$$slots:{default:[Pi]},$$scope:{ctx:P}}}),ue=new ke({props:{anchor:"diffusers.DiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Ji]},$$scope:{ctx:P}}}),to=new W({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#L759"}}),he=new ke({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example",$$slots:{default:[Ei]},$$scope:{ctx:P}}}),ge=new Go({props:{$$slots:{default:[ki]},$$scope:{ctx:P}}}),be=new ke({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example-2",$$slots:{default:[Di]},$$scope:{ctx:P}}}),so=new W({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#L1608"}}),ao=new W({props:{name:"save_pretrained",anchor:"diffusers.DiffusionPipeline.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"safe_serialization",val:": bool = True"},{name:"variant",val:": typing.Optional[str] = None"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],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>True</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"},{anchor:"diffusers.DiffusionPipeline.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"diffusers.DiffusionPipeline.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L556"}}),ro=new an({}),lo=new W({props:{name:"class diffusers.FlaxDiffusionPipeline",anchor:"diffusers.FlaxDiffusionPipeline",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_flax_utils.py#L101"}}),po=new W({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#L228"}}),$e=new ke({props:{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.example",$$slots:{default:[Ii]},$$scope:{ctx:P}}}),Me=new Go({props:{$$slots:{default:[Gi]},$$scope:{ctx:P}}}),xe=new ke({props:{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.example-2",$$slots:{default:[Wi]},$$scope:{ctx:P}}}),co=new W({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#L566"}}),fo=new W({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]"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],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"},{anchor:"diffusers.FlaxDiffusionPipeline.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"diffusers.FlaxDiffusionPipeline.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_flax_utils.py#L150"}}),uo=new an({}),ho=new W({props:{name:"class diffusers.utils.PushToHubMixin",anchor:"diffusers.utils.PushToHubMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/hub_utils.py#L373"}}),go=new W({props:{name:"push_to_hub",anchor:"diffusers.utils.PushToHubMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Optional[str] = None"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"variant",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your model, scheduler, or pipeline files to. It should
contain your organization name when pushing to an organization. <code>repo_id</code> can also be a path to a local
directory.`,name:"repo_id"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Default to <code>&quot;Upload {object}&quot;</code>.`,name:"commit_message"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. The token generated when running
<code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to convert the model weights to the <code>safetensors</code> format.`,name:"safe_serialization"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.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/utils/hub_utils.py#L402"}}),Ze=new ke({props:{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.example",$$slots:{default:[Bi]},$$scope:{ctx:P}}}),{c(){s=a("meta"),g=m(),c=a("h1"),p=a("a"),h=a("span"),y(o.$$.fragment),f=m(),E=a("span"),J=l("Pipelines"),Z=m(),G=a("p"),B=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."),I=m(),D=a("p"),q=l("All pipelines are built from the base "),C=a("a"),vo=l("DiffusionPipeline"),wo=l(" class which provides basic functionality for loading, downloading, and saving all the components."),Et=m(),y(oe.$$.fragment),kt=m(),L=a("h2"),te=a("a"),Wo=a("span"),y(Ge.$$.fragment),rn=m(),Bo=a("span"),ln=l("DiffusionPipeline"),Dt=m(),T=a("div"),y(We.$$.fragment),dn=m(),Fo=a("p"),pn=l("Base class for all pipelines."),cn=m(),$o=a("p"),Mo=a("a"),fn=l("DiffusionPipeline"),mn=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:`),un=m(),Be=a("ul"),No=a("li"),hn=l("move all PyTorch modules to the device of your choice"),gn=m(),Vo=a("li"),bn=l("enable/disable the progress bar for the denoising iteration"),_n=m(),Co=a("p"),yn=l("Class attributes:"),vn=m(),Fe=a("ul"),ne=a("li"),Xo=a("strong"),wn=l("config_name"),$n=l(" ("),So=a("code"),Mn=l("str"),xn=l(`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),Tn=m(),se=a("li"),Ro=a("strong"),jn=l("_optional_components"),Un=l(" ("),Ho=a("code"),Zn=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).`),Jn=m(),ae=a("div"),y(Ne.$$.fragment),En=m(),Yo=a("p"),kn=l("Call self as a function."),Dn=m(),xo=a("div"),y(Ve.$$.fragment),In=m(),To=a("div"),y(Ce.$$.fragment),Gn=m(),X=a("div"),y(Xe.$$.fragment),Wn=m(),Se=a("p"),Bn=l("The "),zo=a("code"),Fn=l("self.components"),Nn=l(` property can be useful to run different pipelines with the same weights and
configurations without reallocating additional memory.`),Vn=m(),Re=a("p"),Cn=l("Returns ("),Ao=a("code"),Xn=l("dict"),Sn=l(`):
A dictionary containing all the modules needed to initialize the pipeline.`),Rn=m(),y(ie.$$.fragment),Hn=m(),re=a("div"),y(He.$$.fragment),Yn=m(),Ye=a("p"),zn=l("Disable sliced attention computation. If "),Qo=a("code"),An=l("enable_attention_slicing"),Qn=l(` was previously called, attention is
computed in one step.`),qn=m(),le=a("div"),y(ze.$$.fragment),Ln=m(),Ae=a("p"),On=l("Disable memory efficient attention from "),Qe=a("a"),Kn=l("xFormers"),es=l("."),os=m(),A=a("div"),y(qe.$$.fragment),ts=m(),qo=a("p"),ns=l("Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights."),ss=m(),y(de.$$.fragment),as=m(),S=a("div"),y(Le.$$.fragment),is=m(),Lo=a("p"),rs=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.`),ls=m(),y(pe.$$.fragment),ds=m(),y(ce.$$.fragment),ps=m(),fe=a("div"),y(Oe.$$.fragment),cs=m(),O=a("p"),fs=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
`),Oo=a("code"),ms=l("torch.device('meta') and loaded to GPU only when their specific submodule has its "),us=l("forward"),Ko=a("code"),hs=l("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),gs=l("enable_model_cpu_offload`, but performance is lower."),bs=m(),R=a("div"),y(Ke.$$.fragment),_s=m(),eo=a("p"),ys=l("Enable memory efficient attention from "),oo=a("a"),vs=l("xFormers"),ws=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.`),$s=m(),y(me.$$.fragment),Ms=m(),y(ue.$$.fragment),xs=m(),N=a("div"),y(to.$$.fragment),Ts=m(),et=a("p"),js=l("Instantiate a PyTorch diffusion pipeline from pretrained pipeline weights."),Us=m(),no=a("p"),Zs=l("The pipeline is set in evaluation mode ("),ot=a("code"),Ps=l("model.eval()"),Js=l(") by default."),Es=m(),y(he.$$.fragment),ks=m(),y(ge.$$.fragment),Ds=m(),y(be.$$.fragment),Is=m(),_e=a("div"),y(so.$$.fragment),Gs=m(),tt=a("p"),Ws=l("Convert a NumPy image or a batch of images to a PIL image."),Bs=m(),ye=a("div"),y(ao.$$.fragment),Fs=m(),io=a("p"),Ns=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
`),jo=a("a"),Vs=l("from_pretrained()"),Cs=l(" class method."),It=m(),K=a("h2"),ve=a("a"),nt=a("span"),y(ro.$$.fragment),Xs=m(),st=a("span"),Ss=l("FlaxDiffusionPipeline"),Gt=m(),k=a("div"),y(lo.$$.fragment),Rs=m(),at=a("p"),Hs=l("Base class for Flax-based pipelines."),Ys=m(),Uo=a("p"),Zo=a("a"),zs=l("FlaxDiffusionPipeline"),As=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:`),Qs=m(),it=a("ul"),rt=a("li"),qs=l("enable/disable the progress bar for the denoising iteration"),Ls=m(),lt=a("p"),Os=l("Class attributes:"),Ks=m(),dt=a("ul"),we=a("li"),pt=a("strong"),ea=l("config_name"),oa=l(" ("),ct=a("code"),ta=l("str"),na=l(`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),sa=m(),V=a("div"),y(po.$$.fragment),aa=m(),ft=a("p"),ia=l("Instantiate a Flax-based diffusion pipeline from pretrained pipeline weights."),ra=m(),mt=a("p"),la=l("The pipeline is set in evaluation mode (`model.eval()) by default and dropout modules are deactivated."),da=m(),y($e.$$.fragment),pa=m(),y(Me.$$.fragment),ca=m(),y(xe.$$.fragment),fa=m(),Te=a("div"),y(co.$$.fragment),ma=m(),ut=a("p"),ua=l("Convert a NumPy image or a batch of images to a PIL image."),ha=m(),je=a("div"),y(fo.$$.fragment),ga=m(),mo=a("p"),ba=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
`),Po=a("a"),_a=l("from_pretrained()"),ya=l(" class method."),Wt=m(),ee=a("h2"),Ue=a("a"),ht=a("span"),y(uo.$$.fragment),va=m(),gt=a("span"),wa=l("PushToHubMixin"),Bt=m(),z=a("div"),y(ho.$$.fragment),$a=m(),bt=a("p"),Ma=l("A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub."),xa=m(),Q=a("div"),y(go.$$.fragment),Ta=m(),_t=a("p"),ja=l("Upload model, scheduler, or pipeline files to the \u{1F917} Hugging Face Hub."),Ua=m(),y(Ze.$$.fragment),this.h()},l(n){const _=$i('[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 bo=r(c);p=i(bo,"A",{id:!0,class:!0,href:!0});var yt=r(p);h=i(yt,"SPAN",{});var vt=r(h);v(o.$$.fragment,vt),vt.forEach(t),yt.forEach(t),f=u(bo),E=i(bo,"SPAN",{});var wt=r(E);J=d(wt,"Pipelines"),wt.forEach(t),bo.forEach(t),Z=u(n),G=i(n,"P",{});var $t=r(G);B=d($t,"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."),$t.forEach(t),I=u(n),D=i(n,"P",{});var _o=r(D);q=d(_o,"All pipelines are built from the base "),C=i(_o,"A",{href:!0});var Mt=r(C);vo=d(Mt,"DiffusionPipeline"),Mt.forEach(t),wo=d(_o," class which provides basic functionality for loading, downloading, and saving all the components."),_o.forEach(t),Et=u(n),v(oe.$$.fragment,n),kt=u(n),L=i(n,"H2",{class:!0});var yo=r(L);te=i(yo,"A",{id:!0,class:!0,href:!0});var xt=r(te);Wo=i(xt,"SPAN",{});var Tt=r(Wo);v(Ge.$$.fragment,Tt),Tt.forEach(t),xt.forEach(t),rn=u(yo),Bo=i(yo,"SPAN",{});var jt=r(Bo);ln=d(jt,"DiffusionPipeline"),jt.forEach(t),yo.forEach(t),Dt=u(n),T=i(n,"DIV",{class:!0});var j=r(T);v(We.$$.fragment,j),dn=u(j),Fo=i(j,"P",{});var Ut=r(Fo);pn=d(Ut,"Base class for all pipelines."),Ut.forEach(t),cn=u(j),$o=i(j,"P",{});var Jo=r($o);Mo=i(Jo,"A",{href:!0});var Pa=r(Mo);fn=d(Pa,"DiffusionPipeline"),Pa.forEach(t),mn=d(Jo,` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),Jo.forEach(t),un=u(j),Be=i(j,"UL",{});var Nt=r(Be);No=i(Nt,"LI",{});var Ja=r(No);hn=d(Ja,"move all PyTorch modules to the device of your choice"),Ja.forEach(t),gn=u(Nt),Vo=i(Nt,"LI",{});var Ea=r(Vo);bn=d(Ea,"enable/disable the progress bar for the denoising iteration"),Ea.forEach(t),Nt.forEach(t),_n=u(j),Co=i(j,"P",{});var ka=r(Co);yn=d(ka,"Class attributes:"),ka.forEach(t),vn=u(j),Fe=i(j,"UL",{});var Vt=r(Fe);ne=i(Vt,"LI",{});var Zt=r(ne);Xo=i(Zt,"STRONG",{});var Da=r(Xo);wn=d(Da,"config_name"),Da.forEach(t),$n=d(Zt," ("),So=i(Zt,"CODE",{});var Ia=r(So);Mn=d(Ia,"str"),Ia.forEach(t),xn=d(Zt,`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),Zt.forEach(t),Tn=u(Vt),se=i(Vt,"LI",{});var Pt=r(se);Ro=i(Pt,"STRONG",{});var Ga=r(Ro);jn=d(Ga,"_optional_components"),Ga.forEach(t),Un=d(Pt," ("),Ho=i(Pt,"CODE",{});var Wa=r(Ho);Zn=d(Wa,"List[str]"),Wa.forEach(t),Pn=d(Pt,`) \u2014 List of all optional components that don\u2019t have to be passed to the
pipeline to function (should be overridden by subclasses).`),Pt.forEach(t),Vt.forEach(t),Jn=u(j),ae=i(j,"DIV",{class:!0});var Ct=r(ae);v(Ne.$$.fragment,Ct),En=u(Ct),Yo=i(Ct,"P",{});var Ba=r(Yo);kn=d(Ba,"Call self as a function."),Ba.forEach(t),Ct.forEach(t),Dn=u(j),xo=i(j,"DIV",{class:!0});var Fa=r(xo);v(Ve.$$.fragment,Fa),Fa.forEach(t),In=u(j),To=i(j,"DIV",{class:!0});var Na=r(To);v(Ce.$$.fragment,Na),Na.forEach(t),Gn=u(j),X=i(j,"DIV",{class:!0});var Pe=r(X);v(Xe.$$.fragment,Pe),Wn=u(Pe),Se=i(Pe,"P",{});var Xt=r(Se);Bn=d(Xt,"The "),zo=i(Xt,"CODE",{});var Va=r(zo);Fn=d(Va,"self.components"),Va.forEach(t),Nn=d(Xt,` property can be useful to run different pipelines with the same weights and
configurations without reallocating additional memory.`),Xt.forEach(t),Vn=u(Pe),Re=i(Pe,"P",{});var St=r(Re);Cn=d(St,"Returns ("),Ao=i(St,"CODE",{});var Ca=r(Ao);Xn=d(Ca,"dict"),Ca.forEach(t),Sn=d(St,`):
A dictionary containing all the modules needed to initialize the pipeline.`),St.forEach(t),Rn=u(Pe),v(ie.$$.fragment,Pe),Pe.forEach(t),Hn=u(j),re=i(j,"DIV",{class:!0});var Rt=r(re);v(He.$$.fragment,Rt),Yn=u(Rt),Ye=i(Rt,"P",{});var Ht=r(Ye);zn=d(Ht,"Disable sliced attention computation. If "),Qo=i(Ht,"CODE",{});var Xa=r(Qo);An=d(Xa,"enable_attention_slicing"),Xa.forEach(t),Qn=d(Ht,` was previously called, attention is
computed in one step.`),Ht.forEach(t),Rt.forEach(t),qn=u(j),le=i(j,"DIV",{class:!0});var Yt=r(le);v(ze.$$.fragment,Yt),Ln=u(Yt),Ae=i(Yt,"P",{});var zt=r(Ae);On=d(zt,"Disable memory efficient attention from "),Qe=i(zt,"A",{href:!0,rel:!0});var Sa=r(Qe);Kn=d(Sa,"xFormers"),Sa.forEach(t),es=d(zt,"."),zt.forEach(t),Yt.forEach(t),os=u(j),A=i(j,"DIV",{class:!0});var Eo=r(A);v(qe.$$.fragment,Eo),ts=u(Eo),qo=i(Eo,"P",{});var Ra=r(qo);ns=d(Ra,"Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights."),Ra.forEach(t),ss=u(Eo),v(de.$$.fragment,Eo),Eo.forEach(t),as=u(j),S=i(j,"DIV",{class:!0});var Je=r(S);v(Le.$$.fragment,Je),is=u(Je),Lo=i(Je,"P",{});var Ha=r(Lo);rs=d(Ha,`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.`),Ha.forEach(t),ls=u(Je),v(pe.$$.fragment,Je),ds=u(Je),v(ce.$$.fragment,Je),Je.forEach(t),ps=u(j),fe=i(j,"DIV",{class:!0});var At=r(fe);v(Oe.$$.fragment,At),cs=u(At),O=i(At,"P",{});var ko=r(O);fs=d(ko,`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
`),Oo=i(ko,"CODE",{});var Ya=r(Oo);ms=d(Ya,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ya.forEach(t),us=d(ko,"forward"),Ko=i(ko,"CODE",{});var za=r(Ko);hs=d(za,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),za.forEach(t),gs=d(ko,"enable_model_cpu_offload`, but performance is lower."),ko.forEach(t),At.forEach(t),bs=u(j),R=i(j,"DIV",{class:!0});var Ee=r(R);v(Ke.$$.fragment,Ee),_s=u(Ee),eo=i(Ee,"P",{});var Qt=r(eo);ys=d(Qt,"Enable memory efficient attention from "),oo=i(Qt,"A",{href:!0,rel:!0});var Aa=r(oo);vs=d(Aa,"xFormers"),Aa.forEach(t),ws=d(Qt,`. 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.`),Qt.forEach(t),$s=u(Ee),v(me.$$.fragment,Ee),Ms=u(Ee),v(ue.$$.fragment,Ee),Ee.forEach(t),xs=u(j),N=i(j,"DIV",{class:!0});var H=r(N);v(to.$$.fragment,H),Ts=u(H),et=i(H,"P",{});var Qa=r(et);js=d(Qa,"Instantiate a PyTorch diffusion pipeline from pretrained pipeline weights."),Qa.forEach(t),Us=u(H),no=i(H,"P",{});var qt=r(no);Zs=d(qt,"The pipeline is set in evaluation mode ("),ot=i(qt,"CODE",{});var qa=r(ot);Ps=d(qa,"model.eval()"),qa.forEach(t),Js=d(qt,") by default."),qt.forEach(t),Es=u(H),v(he.$$.fragment,H),ks=u(H),v(ge.$$.fragment,H),Ds=u(H),v(be.$$.fragment,H),H.forEach(t),Is=u(j),_e=i(j,"DIV",{class:!0});var Lt=r(_e);v(so.$$.fragment,Lt),Gs=u(Lt),tt=i(Lt,"P",{});var La=r(tt);Ws=d(La,"Convert a NumPy image or a batch of images to a PIL image."),La.forEach(t),Lt.forEach(t),Bs=u(j),ye=i(j,"DIV",{class:!0});var Ot=r(ye);v(ao.$$.fragment,Ot),Fs=u(Ot),io=i(Ot,"P",{});var Kt=r(io);Ns=d(Kt,`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
`),jo=i(Kt,"A",{href:!0});var Oa=r(jo);Vs=d(Oa,"from_pretrained()"),Oa.forEach(t),Cs=d(Kt," class method."),Kt.forEach(t),Ot.forEach(t),j.forEach(t),It=u(n),K=i(n,"H2",{class:!0});var en=r(K);ve=i(en,"A",{id:!0,class:!0,href:!0});var Ka=r(ve);nt=i(Ka,"SPAN",{});var ei=r(nt);v(ro.$$.fragment,ei),ei.forEach(t),Ka.forEach(t),Xs=u(en),st=i(en,"SPAN",{});var oi=r(st);Ss=d(oi,"FlaxDiffusionPipeline"),oi.forEach(t),en.forEach(t),Gt=u(n),k=i(n,"DIV",{class:!0});var F=r(k);v(lo.$$.fragment,F),Rs=u(F),at=i(F,"P",{});var ti=r(at);Hs=d(ti,"Base class for Flax-based pipelines."),ti.forEach(t),Ys=u(F),Uo=i(F,"P",{});var Za=r(Uo);Zo=i(Za,"A",{href:!0});var ni=r(Zo);zs=d(ni,"FlaxDiffusionPipeline"),ni.forEach(t),As=d(Za,` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),Za.forEach(t),Qs=u(F),it=i(F,"UL",{});var si=r(it);rt=i(si,"LI",{});var ai=r(rt);qs=d(ai,"enable/disable the progress bar for the denoising iteration"),ai.forEach(t),si.forEach(t),Ls=u(F),lt=i(F,"P",{});var ii=r(lt);Os=d(ii,"Class attributes:"),ii.forEach(t),Ks=u(F),dt=i(F,"UL",{});var ri=r(dt);we=i(ri,"LI",{});var Jt=r(we);pt=i(Jt,"STRONG",{});var li=r(pt);ea=d(li,"config_name"),li.forEach(t),oa=d(Jt," ("),ct=i(Jt,"CODE",{});var di=r(ct);ta=d(di,"str"),di.forEach(t),na=d(Jt,`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),Jt.forEach(t),ri.forEach(t),sa=u(F),V=i(F,"DIV",{class:!0});var Y=r(V);v(po.$$.fragment,Y),aa=u(Y),ft=i(Y,"P",{});var pi=r(ft);ia=d(pi,"Instantiate a Flax-based diffusion pipeline from pretrained pipeline weights."),pi.forEach(t),ra=u(Y),mt=i(Y,"P",{});var ci=r(mt);la=d(ci,"The pipeline is set in evaluation mode (`model.eval()) by default and dropout modules are deactivated."),ci.forEach(t),da=u(Y),v($e.$$.fragment,Y),pa=u(Y),v(Me.$$.fragment,Y),ca=u(Y),v(xe.$$.fragment,Y),Y.forEach(t),fa=u(F),Te=i(F,"DIV",{class:!0});var on=r(Te);v(co.$$.fragment,on),ma=u(on),ut=i(on,"P",{});var fi=r(ut);ua=d(fi,"Convert a NumPy image or a batch of images to a PIL image."),fi.forEach(t),on.forEach(t),ha=u(F),je=i(F,"DIV",{class:!0});var tn=r(je);v(fo.$$.fragment,tn),ga=u(tn),mo=i(tn,"P",{});var nn=r(mo);ba=d(nn,`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
`),Po=i(nn,"A",{href:!0});var mi=r(Po);_a=d(mi,"from_pretrained()"),mi.forEach(t),ya=d(nn," class method."),nn.forEach(t),tn.forEach(t),F.forEach(t),Wt=u(n),ee=i(n,"H2",{class:!0});var sn=r(ee);Ue=i(sn,"A",{id:!0,class:!0,href:!0});var ui=r(Ue);ht=i(ui,"SPAN",{});var hi=r(ht);v(uo.$$.fragment,hi),hi.forEach(t),ui.forEach(t),va=u(sn),gt=i(sn,"SPAN",{});var gi=r(gt);wa=d(gi,"PushToHubMixin"),gi.forEach(t),sn.forEach(t),Bt=u(n),z=i(n,"DIV",{class:!0});var Do=r(z);v(ho.$$.fragment,Do),$a=u(Do),bt=i(Do,"P",{});var bi=r(bt);Ma=d(bi,"A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub."),bi.forEach(t),xa=u(Do),Q=i(Do,"DIV",{class:!0});var Io=r(Q);v(go.$$.fragment,Io),Ta=u(Io),_t=i(Io,"P",{});var _i=r(_t);ja=d(_i,"Upload model, scheduler, or pipeline files to the \u{1F917} Hugging Face Hub."),_i.forEach(t),Ua=u(Io),v(Ze.$$.fragment,Io),Io.forEach(t),Do.forEach(t),this.h()},h(){b(s,"name","hf:doc:metadata"),b(s,"content",JSON.stringify(Ni)),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(te,"id","diffusers.DiffusionPipeline"),b(te,"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(te,"href","#diffusers.DiffusionPipeline"),b(L,"class","relative group"),b(Mo,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),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(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(To,"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(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Qe,"href","https://facebookresearch.github.io/xformers/"),b(Qe,"rel","nofollow"),b(le,"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(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(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(oo,"href","https://facebookresearch.github.io/xformers/"),b(oo,"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(_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(jo,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained"),b(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(ve,"id","diffusers.FlaxDiffusionPipeline"),b(ve,"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(ve,"href","#diffusers.FlaxDiffusionPipeline"),b(K,"class","relative group"),b(Zo,"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(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(Po,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline.from_pretrained"),b(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Ue,"id","diffusers.utils.PushToHubMixin"),b(Ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),b(Ue,"href","#diffusers.utils.PushToHubMixin"),b(ee,"class","relative group"),b(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(z,"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),w(o,h,null),e(c,f),e(c,E),e(E,J),U(n,Z,_),U(n,G,_),e(G,B),U(n,I,_),U(n,D,_),e(D,q),e(D,C),e(C,vo),e(D,wo),U(n,Et,_),w(oe,n,_),U(n,kt,_),U(n,L,_),e(L,te),e(te,Wo),w(Ge,Wo,null),e(L,rn),e(L,Bo),e(Bo,ln),U(n,Dt,_),U(n,T,_),w(We,T,null),e(T,dn),e(T,Fo),e(Fo,pn),e(T,cn),e(T,$o),e($o,Mo),e(Mo,fn),e($o,mn),e(T,un),e(T,Be),e(Be,No),e(No,hn),e(Be,gn),e(Be,Vo),e(Vo,bn),e(T,_n),e(T,Co),e(Co,yn),e(T,vn),e(T,Fe),e(Fe,ne),e(ne,Xo),e(Xo,wn),e(ne,$n),e(ne,So),e(So,Mn),e(ne,xn),e(Fe,Tn),e(Fe,se),e(se,Ro),e(Ro,jn),e(se,Un),e(se,Ho),e(Ho,Zn),e(se,Pn),e(T,Jn),e(T,ae),w(Ne,ae,null),e(ae,En),e(ae,Yo),e(Yo,kn),e(T,Dn),e(T,xo),w(Ve,xo,null),e(T,In),e(T,To),w(Ce,To,null),e(T,Gn),e(T,X),w(Xe,X,null),e(X,Wn),e(X,Se),e(Se,Bn),e(Se,zo),e(zo,Fn),e(Se,Nn),e(X,Vn),e(X,Re),e(Re,Cn),e(Re,Ao),e(Ao,Xn),e(Re,Sn),e(X,Rn),w(ie,X,null),e(T,Hn),e(T,re),w(He,re,null),e(re,Yn),e(re,Ye),e(Ye,zn),e(Ye,Qo),e(Qo,An),e(Ye,Qn),e(T,qn),e(T,le),w(ze,le,null),e(le,Ln),e(le,Ae),e(Ae,On),e(Ae,Qe),e(Qe,Kn),e(Ae,es),e(T,os),e(T,A),w(qe,A,null),e(A,ts),e(A,qo),e(qo,ns),e(A,ss),w(de,A,null),e(T,as),e(T,S),w(Le,S,null),e(S,is),e(S,Lo),e(Lo,rs),e(S,ls),w(pe,S,null),e(S,ds),w(ce,S,null),e(T,ps),e(T,fe),w(Oe,fe,null),e(fe,cs),e(fe,O),e(O,fs),e(O,Oo),e(Oo,ms),e(O,us),e(O,Ko),e(Ko,hs),e(O,gs),e(T,bs),e(T,R),w(Ke,R,null),e(R,_s),e(R,eo),e(eo,ys),e(eo,oo),e(oo,vs),e(eo,ws),e(R,$s),w(me,R,null),e(R,Ms),w(ue,R,null),e(T,xs),e(T,N),w(to,N,null),e(N,Ts),e(N,et),e(et,js),e(N,Us),e(N,no),e(no,Zs),e(no,ot),e(ot,Ps),e(no,Js),e(N,Es),w(he,N,null),e(N,ks),w(ge,N,null),e(N,Ds),w(be,N,null),e(T,Is),e(T,_e),w(so,_e,null),e(_e,Gs),e(_e,tt),e(tt,Ws),e(T,Bs),e(T,ye),w(ao,ye,null),e(ye,Fs),e(ye,io),e(io,Ns),e(io,jo),e(jo,Vs),e(io,Cs),U(n,It,_),U(n,K,_),e(K,ve),e(ve,nt),w(ro,nt,null),e(K,Xs),e(K,st),e(st,Ss),U(n,Gt,_),U(n,k,_),w(lo,k,null),e(k,Rs),e(k,at),e(at,Hs),e(k,Ys),e(k,Uo),e(Uo,Zo),e(Zo,zs),e(Uo,As),e(k,Qs),e(k,it),e(it,rt),e(rt,qs),e(k,Ls),e(k,lt),e(lt,Os),e(k,Ks),e(k,dt),e(dt,we),e(we,pt),e(pt,ea),e(we,oa),e(we,ct),e(ct,ta),e(we,na),e(k,sa),e(k,V),w(po,V,null),e(V,aa),e(V,ft),e(ft,ia),e(V,ra),e(V,mt),e(mt,la),e(V,da),w($e,V,null),e(V,pa),w(Me,V,null),e(V,ca),w(xe,V,null),e(k,fa),e(k,Te),w(co,Te,null),e(Te,ma),e(Te,ut),e(ut,ua),e(k,ha),e(k,je),w(fo,je,null),e(je,ga),e(je,mo),e(mo,ba),e(mo,Po),e(Po,_a),e(mo,ya),U(n,Wt,_),U(n,ee,_),e(ee,Ue),e(Ue,ht),w(uo,ht,null),e(ee,va),e(ee,gt),e(gt,wa),U(n,Bt,_),U(n,z,_),w(ho,z,null),e(z,$a),e(z,bt),e(bt,Ma),e(z,xa),e(z,Q),w(go,Q,null),e(Q,Ta),e(Q,_t),e(_t,ja),e(Q,Ua),w(Ze,Q,null),Ft=!0},p(n,[_]){const bo={};_&2&&(bo.$$scope={dirty:_,ctx:n}),oe.$set(bo);const yt={};_&2&&(yt.$$scope={dirty:_,ctx:n}),ie.$set(yt);const vt={};_&2&&(vt.$$scope={dirty:_,ctx:n}),de.$set(vt);const wt={};_&2&&(wt.$$scope={dirty:_,ctx:n}),pe.$set(wt);const $t={};_&2&&($t.$$scope={dirty:_,ctx:n}),ce.$set($t);const _o={};_&2&&(_o.$$scope={dirty:_,ctx:n}),me.$set(_o);const Mt={};_&2&&(Mt.$$scope={dirty:_,ctx:n}),ue.$set(Mt);const yo={};_&2&&(yo.$$scope={dirty:_,ctx:n}),he.$set(yo);const xt={};_&2&&(xt.$$scope={dirty:_,ctx:n}),ge.$set(xt);const Tt={};_&2&&(Tt.$$scope={dirty:_,ctx:n}),be.$set(Tt);const jt={};_&2&&(jt.$$scope={dirty:_,ctx:n}),$e.$set(jt);const j={};_&2&&(j.$$scope={dirty:_,ctx:n}),Me.$set(j);const Ut={};_&2&&(Ut.$$scope={dirty:_,ctx:n}),xe.$set(Ut);const Jo={};_&2&&(Jo.$$scope={dirty:_,ctx:n}),Ze.$set(Jo)},i(n){Ft||($(o.$$.fragment,n),$(oe.$$.fragment,n),$(Ge.$$.fragment,n),$(We.$$.fragment,n),$(Ne.$$.fragment,n),$(Ve.$$.fragment,n),$(Ce.$$.fragment,n),$(Xe.$$.fragment,n),$(ie.$$.fragment,n),$(He.$$.fragment,n),$(ze.$$.fragment,n),$(qe.$$.fragment,n),$(de.$$.fragment,n),$(Le.$$.fragment,n),$(pe.$$.fragment,n),$(ce.$$.fragment,n),$(Oe.$$.fragment,n),$(Ke.$$.fragment,n),$(me.$$.fragment,n),$(ue.$$.fragment,n),$(to.$$.fragment,n),$(he.$$.fragment,n),$(ge.$$.fragment,n),$(be.$$.fragment,n),$(so.$$.fragment,n),$(ao.$$.fragment,n),$(ro.$$.fragment,n),$(lo.$$.fragment,n),$(po.$$.fragment,n),$($e.$$.fragment,n),$(Me.$$.fragment,n),$(xe.$$.fragment,n),$(co.$$.fragment,n),$(fo.$$.fragment,n),$(uo.$$.fragment,n),$(ho.$$.fragment,n),$(go.$$.fragment,n),$(Ze.$$.fragment,n),Ft=!0)},o(n){M(o.$$.fragment,n),M(oe.$$.fragment,n),M(Ge.$$.fragment,n),M(We.$$.fragment,n),M(Ne.$$.fragment,n),M(Ve.$$.fragment,n),M(Ce.$$.fragment,n),M(Xe.$$.fragment,n),M(ie.$$.fragment,n),M(He.$$.fragment,n),M(ze.$$.fragment,n),M(qe.$$.fragment,n),M(de.$$.fragment,n),M(Le.$$.fragment,n),M(pe.$$.fragment,n),M(ce.$$.fragment,n),M(Oe.$$.fragment,n),M(Ke.$$.fragment,n),M(me.$$.fragment,n),M(ue.$$.fragment,n),M(to.$$.fragment,n),M(he.$$.fragment,n),M(ge.$$.fragment,n),M(be.$$.fragment,n),M(so.$$.fragment,n),M(ao.$$.fragment,n),M(ro.$$.fragment,n),M(lo.$$.fragment,n),M(po.$$.fragment,n),M($e.$$.fragment,n),M(Me.$$.fragment,n),M(xe.$$.fragment,n),M(co.$$.fragment,n),M(fo.$$.fragment,n),M(uo.$$.fragment,n),M(ho.$$.fragment,n),M(go.$$.fragment,n),M(Ze.$$.fragment,n),Ft=!1},d(n){t(s),n&&t(g),n&&t(c),x(o),n&&t(Z),n&&t(G),n&&t(I),n&&t(D),n&&t(Et),x(oe,n),n&&t(kt),n&&t(L),x(Ge),n&&t(Dt),n&&t(T),x(We),x(Ne),x(Ve),x(Ce),x(Xe),x(ie),x(He),x(ze),x(qe),x(de),x(Le),x(pe),x(ce),x(Oe),x(Ke),x(me),x(ue),x(to),x(he),x(ge),x(be),x(so),x(ao),n&&t(It),n&&t(K),x(ro),n&&t(Gt),n&&t(k),x(lo),x(po),x($e),x(Me),x(xe),x(co),x(fo),n&&t(Wt),n&&t(ee),x(uo),n&&t(Bt),n&&t(z),x(ho),x(go),x(Ze)}}}const Ni={local:"pipelines",sections:[{local:"diffusers.DiffusionPipeline",title:"DiffusionPipeline"},{local:"diffusers.FlaxDiffusionPipeline",title:"FlaxDiffusionPipeline"},{local:"diffusers.utils.PushToHubMixin",title:"PushToHubMixin"}],title:"Pipelines"};function Vi(P){return Mi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zi extends yi{constructor(s){super();vi(this,s,Vi,Fi,wi,{})}}export{zi as default,Ni as metadata};
