import{S as Gs,i as Is,s as ks,e as r,k as m,w,t as i,M as Ws,c as l,d as o,m as u,a as d,x as $,h as a,b,G as e,g as P,y as x,q as T,o as M,B as j,v as Ns,L as Wo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Io}from"../../chunks/Tip-hf-doc-builder.js";import{D as W}from"../../chunks/Docstring-hf-doc-builder.js";import{C as No}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Js}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ko}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Vs(U){let s,g,p,c,h,t,f,Z,E,D,J;return{c(){s=r("p"),g=i("You shouldn\u2019t use the "),p=r("a"),c=i("DiffusionPipeline"),h=i(` class for training or finetuning a diffusion model. Individual
components (for example, `),t=r("a"),f=i("UNet2DModel"),Z=i(" and "),E=r("a"),D=i("UNet2DConditionModel"),J=i(") of diffusion pipelines are usually trained individually, so we suggest directly working with them instead."),this.h()},l(k){s=l(k,"P",{});var G=d(s);g=a(G,"You shouldn\u2019t use the "),p=l(G,"A",{href:!0});var Xe=d(p);c=a(Xe,"DiffusionPipeline"),Xe.forEach(o),h=a(G,` class for training or finetuning a diffusion model. Individual
components (for example, `),t=l(G,"A",{href:!0});var Ae=d(t);f=a(Ae,"UNet2DModel"),Ae.forEach(o),Z=a(G," and "),E=l(G,"A",{href:!0});var R=d(E);D=a(R,"UNet2DConditionModel"),R.forEach(o),J=a(G,") of diffusion pipelines are usually trained individually, so we suggest directly working with them instead."),G.forEach(o),this.h()},h(){b(p,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),b(t,"href","/docs/diffusers/main/en/api/models/unet2d#diffusers.UNet2DModel"),b(E,"href","/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel")},m(k,G){P(k,s,G),e(s,g),e(s,p),e(p,c),e(s,h),e(s,t),e(t,f),e(s,Z),e(s,E),e(E,D),e(s,J)},d(k){k&&o(s)}}}function Bs(U){let s,g,p,c,h;return c=new No({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=r("p"),g=i("Examples:"),p=m(),w(c.$$.fragment)},l(t){s=l(t,"P",{});var f=d(s);g=a(f,"Examples:"),f.forEach(o),p=u(t),$(c.$$.fragment,t)},m(t,f){P(t,s,f),e(s,g),P(t,p,f),x(c,t,f),h=!0},p:Wo,i(t){h||(T(c.$$.fragment,t),h=!0)},o(t){M(c.$$.fragment,t),h=!1},d(t){t&&o(s),t&&o(p),j(c,t)}}}function Cs(U){let s,g,p,c,h,t,f,Z;return{c(){s=r("p"),g=i("To use private or "),p=r("a"),c=i("gated models"),h=i(`, log-in with
`),t=r("code"),f=i("huggingface-cli login"),Z=i("."),this.h()},l(E){s=l(E,"P",{});var D=d(s);g=a(D,"To use private or "),p=l(D,"A",{href:!0,rel:!0});var J=d(p);c=a(J,"gated models"),J.forEach(o),h=a(D,`, log-in with
`),t=l(D,"CODE",{});var k=d(t);f=a(k,"huggingface-cli login"),k.forEach(o),Z=a(D,"."),D.forEach(o),this.h()},h(){b(p,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),b(p,"rel","nofollow")},m(E,D){P(E,s,D),e(s,g),e(s,p),e(p,c),e(s,h),e(s,t),e(t,f),e(s,Z)},d(E){E&&o(s)}}}function Fs(U){let s,g,p,c,h;return{c(){s=r("p"),g=i("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),p=r("code"),c=i("scaled_dot_product_attention"),h=i(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(t){s=l(t,"P",{});var f=d(s);g=a(f,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),p=l(f,"CODE",{});var Z=d(p);c=a(Z,"scaled_dot_product_attention"),Z.forEach(o),h=a(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(o)},m(t,f){P(t,s,f),e(s,g),e(s,p),e(p,c),e(s,h)},d(t){t&&o(s)}}}function Ss(U){let s,g,p,c,h;return c=new No({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=r("p"),g=i("Examples:"),p=m(),w(c.$$.fragment)},l(t){s=l(t,"P",{});var f=d(s);g=a(f,"Examples:"),f.forEach(o),p=u(t),$(c.$$.fragment,t)},m(t,f){P(t,s,f),e(s,g),P(t,p,f),x(c,t,f),h=!0},p:Wo,i(t){h||(T(c.$$.fragment,t),h=!0)},o(t){M(c.$$.fragment,t),h=!1},d(t){t&&o(s),t&&o(p),j(c,t)}}}function Rs(U){let s,g;return{c(){s=r("p"),g=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(p){s=l(p,"P",{});var c=d(s);g=a(c,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),c.forEach(o)},m(p,c){P(p,s,c),e(s,g)},d(p){p&&o(s)}}}function Xs(U){let s,g,p,c,h;return c=new No({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){s=r("p"),g=i("Examples:"),p=m(),w(c.$$.fragment)},l(t){s=l(t,"P",{});var f=d(s);g=a(f,"Examples:"),f.forEach(o),p=u(t),$(c.$$.fragment,t)},m(t,f){P(t,s,f),e(s,g),P(t,p,f),x(c,t,f),h=!0},p:Wo,i(t){h||(T(c.$$.fragment,t),h=!0)},o(t){M(c.$$.fragment,t),h=!1},d(t){t&&o(s),t&&o(p),j(c,t)}}}function As(U){let s,g,p,c,h;return c=new No({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=r("p"),g=i("If you get the error message below, you need to finetune the weights for your downstream task:"),p=m(),w(c.$$.fragment)},l(t){s=l(t,"P",{});var f=d(s);g=a(f,"If you get the error message below, you need to finetune the weights for your downstream task:"),f.forEach(o),p=u(t),$(c.$$.fragment,t)},m(t,f){P(t,s,f),e(s,g),P(t,p,f),x(c,t,f),h=!0},p:Wo,i(t){h||(T(c.$$.fragment,t),h=!0)},o(t){M(c.$$.fragment,t),h=!1},d(t){t&&o(s),t&&o(p),j(c,t)}}}function Ys(U){let s,g,p,c,h,t,f,Z;return{c(){s=r("p"),g=i("To use private or "),p=r("a"),c=i("gated"),h=i(` models, log-in with
`),t=r("code"),f=i("huggingface-cli login"),Z=i("."),this.h()},l(E){s=l(E,"P",{});var D=d(s);g=a(D,"To use private or "),p=l(D,"A",{href:!0,rel:!0});var J=d(p);c=a(J,"gated"),J.forEach(o),h=a(D,` models, log-in with
`),t=l(D,"CODE",{});var k=d(t);f=a(k,"huggingface-cli login"),k.forEach(o),Z=a(D,"."),D.forEach(o),this.h()},h(){b(p,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),b(p,"rel","nofollow")},m(E,D){P(E,s,D),e(s,g),e(s,p),e(p,c),e(s,h),e(s,t),e(t,f),e(s,Z)},d(E){E&&o(s)}}}function zs(U){let s,g,p,c,h;return c=new No({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=r("p"),g=i("Examples:"),p=m(),w(c.$$.fragment)},l(t){s=l(t,"P",{});var f=d(s);g=a(f,"Examples:"),f.forEach(o),p=u(t),$(c.$$.fragment,t)},m(t,f){P(t,s,f),e(s,g),P(t,p,f),x(c,t,f),h=!0},p:Wo,i(t){h||(T(c.$$.fragment,t),h=!0)},o(t){M(c.$$.fragment,t),h=!1},d(t){t&&o(s),t&&o(p),j(c,t)}}}function qs(U){let s,g,p,c,h,t,f,Z,E,D,J,k,G,Xe,Ae,R,rt,lt,Vo,q,Bo,N,dt,Ye,pt,ct,ze,ft,mt,to,ut,ht,Co,L,gt,qe,_t,bt,Fo,A,H,no,_e,yt,so,vt,So,_,be,wt,io,$t,xt,Le,He,Tt,Mt,jt,ye,ao,Pt,Dt,ro,Ut,Et,lo,Zt,Jt,ve,Q,po,Gt,It,co,kt,Wt,Nt,O,fo,Vt,Bt,mo,Ct,Ft,St,K,we,Rt,uo,Xt,At,Qe,$e,Yt,Oe,xe,zt,V,Te,qt,Me,Lt,ho,Ht,Qt,Ot,je,Kt,go,en,on,tn,ee,nn,oe,Pe,sn,De,an,_o,rn,ln,dn,te,Ue,pn,Ee,cn,Ze,fn,mn,un,X,Je,hn,bo,gn,_n,ne,bn,B,Ge,yn,yo,vn,wn,se,$n,ie,xn,ae,Ie,Tn,Y,Mn,vo,jn,Pn,wo,Dn,Un,En,C,ke,Zn,We,Jn,Ne,Gn,In,kn,re,Wn,le,Nn,I,Ve,Vn,$o,Bn,Cn,Be,Fn,xo,Sn,Rn,Xn,de,An,pe,Yn,ce,zn,fe,Ce,qn,To,Ln,Hn,me,Fe,Qn,Se,On,Ke,Kn,es,Ro;return t=new Js({}),q=new Io({props:{$$slots:{default:[Vs]},$$scope:{ctx:U}}}),_e=new Js({}),be=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"}}),we=new W({props:{name:"__call__",anchor:"diffusers.DiffusionPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),$e=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>
`}}),xe=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"}}),Te=new W({props:{name:"components",anchor:"diffusers.DiffusionPipeline.components",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1568"}}),ee=new ko({props:{anchor:"diffusers.DiffusionPipeline.components.example",$$slots:{default:[Bs]},$$scope:{ctx:U}}}),Pe=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#L1730"}}),Ue=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#L1664"}}),Je=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#L1238",returnDescription:`
<p>A path to the downloaded pipeline.</p>
`,returnType:`
<p><code>os.PathLike</code></p>
`}}),ne=new Io({props:{$$slots:{default:[Cs]},$$scope:{ctx:U}}}),Ge=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#L1690"}}),se=new Io({props:{warning:!0,$$slots:{default:[Fs]},$$scope:{ctx:U}}}),ie=new ko({props:{anchor:"diffusers.DiffusionPipeline.enable_attention_slicing.example",$$slots:{default:[Ss]},$$scope:{ctx:U}}}),Ie=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#L1204"}}),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#L1629"}}),re=new Io({props:{warning:!0,$$slots:{default:[Rs]},$$scope:{ctx:U}}}),le=new ko({props:{anchor:"diffusers.DiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Xs]},$$scope:{ctx:U}}}),Ve=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"}}),de=new ko({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example",$$slots:{default:[As]},$$scope:{ctx:U}}}),pe=new Io({props:{$$slots:{default:[Ys]},$$scope:{ctx:U}}}),ce=new ko({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example-2",$$slots:{default:[zs]},$$scope:{ctx:U}}}),Ce=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#L1604"}}),Fe=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"}}),{c(){s=r("meta"),g=m(),p=r("h1"),c=r("a"),h=r("span"),w(t.$$.fragment),f=m(),Z=r("span"),E=i("Pipelines"),D=m(),J=r("p"),k=i("The "),G=r("a"),Xe=i("DiffusionPipeline"),Ae=i(" is the quickest way to load any pretrained diffusion pipeline from the "),R=r("a"),rt=i("Hub"),lt=i(" for inference."),Vo=m(),w(q.$$.fragment),Bo=m(),N=r("p"),dt=i("The pipeline type (for example "),Ye=r("a"),pt=i("StableDiffusionPipeline"),ct=i(") of any diffusion pipeline loaded with "),ze=r("a"),ft=i("from_pretrained()"),mt=i(` is automatically
detected and pipeline components are loaded and passed to the `),to=r("code"),ut=i("__init__"),ht=i(" function of the pipeline."),Co=m(),L=r("p"),gt=i("Any pipeline object can be saved locally with "),qe=r("a"),_t=i("save_pretrained()"),bt=i("."),Fo=m(),A=r("h2"),H=r("a"),no=r("span"),w(_e.$$.fragment),yt=m(),so=r("span"),vt=i("DiffusionPipeline"),So=m(),_=r("div"),w(be.$$.fragment),wt=m(),io=r("p"),$t=i("Base class for all pipelines."),xt=m(),Le=r("p"),He=r("a"),Tt=i("DiffusionPipeline"),Mt=i(` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),jt=m(),ye=r("ul"),ao=r("li"),Pt=i("move all PyTorch modules to the device of your choice"),Dt=m(),ro=r("li"),Ut=i("enable/disable the progress bar for the denoising iteration"),Et=m(),lo=r("p"),Zt=i("Class attributes:"),Jt=m(),ve=r("ul"),Q=r("li"),po=r("strong"),Gt=i("config_name"),It=i(" ("),co=r("code"),kt=i("str"),Wt=i(`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),Nt=m(),O=r("li"),fo=r("strong"),Vt=i("_optional_components"),Bt=i(" ("),mo=r("code"),Ct=i("List[str]"),Ft=i(`) \u2014 List of all optional components that don\u2019t have to be passed to the
pipeline to function (should be overridden by subclasses).`),St=m(),K=r("div"),w(we.$$.fragment),Rt=m(),uo=r("p"),Xt=i("Call self as a function."),At=m(),Qe=r("div"),w($e.$$.fragment),Yt=m(),Oe=r("div"),w(xe.$$.fragment),zt=m(),V=r("div"),w(Te.$$.fragment),qt=m(),Me=r("p"),Lt=i("The "),ho=r("code"),Ht=i("self.components"),Qt=i(` property can be useful to run different pipelines with the same weights and
configurations without reallocating additional memory.`),Ot=m(),je=r("p"),Kt=i("Returns ("),go=r("code"),en=i("dict"),on=i(`):
A dictionary containing all the modules needed to initialize the pipeline.`),tn=m(),w(ee.$$.fragment),nn=m(),oe=r("div"),w(Pe.$$.fragment),sn=m(),De=r("p"),an=i("Disable sliced attention computation. If "),_o=r("code"),rn=i("enable_attention_slicing"),ln=i(` was previously called, attention is
computed in one step.`),dn=m(),te=r("div"),w(Ue.$$.fragment),pn=m(),Ee=r("p"),cn=i("Disable memory efficient attention from "),Ze=r("a"),fn=i("xFormers"),mn=i("."),un=m(),X=r("div"),w(Je.$$.fragment),hn=m(),bo=r("p"),gn=i("Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights."),_n=m(),w(ne.$$.fragment),bn=m(),B=r("div"),w(Ge.$$.fragment),yn=m(),yo=r("p"),vn=i(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),wn=m(),w(se.$$.fragment),$n=m(),w(ie.$$.fragment),xn=m(),ae=r("div"),w(Ie.$$.fragment),Tn=m(),Y=r("p"),Mn=i(`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
`),vo=r("code"),jn=i("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Pn=i("forward"),wo=r("code"),Dn=i("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Un=i("enable_model_cpu_offload`, but performance is lower."),En=m(),C=r("div"),w(ke.$$.fragment),Zn=m(),We=r("p"),Jn=i("Enable memory efficient attention from "),Ne=r("a"),Gn=i("xFormers"),In=i(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),kn=m(),w(re.$$.fragment),Wn=m(),w(le.$$.fragment),Nn=m(),I=r("div"),w(Ve.$$.fragment),Vn=m(),$o=r("p"),Bn=i("Instantiate a PyTorch diffusion pipeline from pretrained pipeline weights."),Cn=m(),Be=r("p"),Fn=i("The pipeline is set in evaluation mode ("),xo=r("code"),Sn=i("model.eval()"),Rn=i(") by default."),Xn=m(),w(de.$$.fragment),An=m(),w(pe.$$.fragment),Yn=m(),w(ce.$$.fragment),zn=m(),fe=r("div"),w(Ce.$$.fragment),qn=m(),To=r("p"),Ln=i("Convert a NumPy image or a batch of images to a PIL image."),Hn=m(),me=r("div"),w(Fe.$$.fragment),Qn=m(),Se=r("p"),On=i(`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
`),Ke=r("a"),Kn=i("from_pretrained()"),es=i(" class method."),this.h()},l(n){const y=Ws('[data-svelte="svelte-1phssyn"]',document.head);s=l(y,"META",{name:!0,content:!0}),y.forEach(o),g=u(n),p=l(n,"H1",{class:!0});var Re=d(p);c=l(Re,"A",{id:!0,class:!0,href:!0});var Mo=d(c);h=l(Mo,"SPAN",{});var jo=d(h);$(t.$$.fragment,jo),jo.forEach(o),Mo.forEach(o),f=u(Re),Z=l(Re,"SPAN",{});var Po=d(Z);E=a(Po,"Pipelines"),Po.forEach(o),Re.forEach(o),D=u(n),J=l(n,"P",{});var z=d(J);k=a(z,"The "),G=l(z,"A",{href:!0});var Do=d(G);Xe=a(Do,"DiffusionPipeline"),Do.forEach(o),Ae=a(z," is the quickest way to load any pretrained diffusion pipeline from the "),R=l(z,"A",{href:!0,rel:!0});var Uo=d(R);rt=a(Uo,"Hub"),Uo.forEach(o),lt=a(z," for inference."),z.forEach(o),Vo=u(n),$(q.$$.fragment,n),Bo=u(n),N=l(n,"P",{});var S=d(N);dt=a(S,"The pipeline type (for example "),Ye=l(S,"A",{href:!0});var Eo=d(Ye);pt=a(Eo,"StableDiffusionPipeline"),Eo.forEach(o),ct=a(S,") of any diffusion pipeline loaded with "),ze=l(S,"A",{href:!0});var Zo=d(ze);ft=a(Zo,"from_pretrained()"),Zo.forEach(o),mt=a(S,` is automatically
detected and pipeline components are loaded and passed to the `),to=l(S,"CODE",{});var ts=d(to);ut=a(ts,"__init__"),ts.forEach(o),ht=a(S," function of the pipeline."),S.forEach(o),Co=u(n),L=l(n,"P",{});var Xo=d(L);gt=a(Xo,"Any pipeline object can be saved locally with "),qe=l(Xo,"A",{href:!0});var ns=d(qe);_t=a(ns,"save_pretrained()"),ns.forEach(o),bt=a(Xo,"."),Xo.forEach(o),Fo=u(n),A=l(n,"H2",{class:!0});var Ao=d(A);H=l(Ao,"A",{id:!0,class:!0,href:!0});var ss=d(H);no=l(ss,"SPAN",{});var is=d(no);$(_e.$$.fragment,is),is.forEach(o),ss.forEach(o),yt=u(Ao),so=l(Ao,"SPAN",{});var as=d(so);vt=a(as,"DiffusionPipeline"),as.forEach(o),Ao.forEach(o),So=u(n),_=l(n,"DIV",{class:!0});var v=d(_);$(be.$$.fragment,v),wt=u(v),io=l(v,"P",{});var rs=d(io);$t=a(rs,"Base class for all pipelines."),rs.forEach(o),xt=u(v),Le=l(v,"P",{});var os=d(Le);He=l(os,"A",{href:!0});var ls=d(He);Tt=a(ls,"DiffusionPipeline"),ls.forEach(o),Mt=a(os,` stores all components (models, schedulers, and processors) for diffusion pipelines and
provides methods for loading, downloading and saving models. It also includes methods to:`),os.forEach(o),jt=u(v),ye=l(v,"UL",{});var Yo=d(ye);ao=l(Yo,"LI",{});var ds=d(ao);Pt=a(ds,"move all PyTorch modules to the device of your choice"),ds.forEach(o),Dt=u(Yo),ro=l(Yo,"LI",{});var ps=d(ro);Ut=a(ps,"enable/disable the progress bar for the denoising iteration"),ps.forEach(o),Yo.forEach(o),Et=u(v),lo=l(v,"P",{});var cs=d(lo);Zt=a(cs,"Class attributes:"),cs.forEach(o),Jt=u(v),ve=l(v,"UL",{});var zo=d(ve);Q=l(zo,"LI",{});var Jo=d(Q);po=l(Jo,"STRONG",{});var fs=d(po);Gt=a(fs,"config_name"),fs.forEach(o),It=a(Jo," ("),co=l(Jo,"CODE",{});var ms=d(co);kt=a(ms,"str"),ms.forEach(o),Wt=a(Jo,`) \u2014 The configuration filename that stores the class and module names of all the
diffusion pipeline\u2019s components.`),Jo.forEach(o),Nt=u(zo),O=l(zo,"LI",{});var Go=d(O);fo=l(Go,"STRONG",{});var us=d(fo);Vt=a(us,"_optional_components"),us.forEach(o),Bt=a(Go," ("),mo=l(Go,"CODE",{});var hs=d(mo);Ct=a(hs,"List[str]"),hs.forEach(o),Ft=a(Go,`) \u2014 List of all optional components that don\u2019t have to be passed to the
pipeline to function (should be overridden by subclasses).`),Go.forEach(o),zo.forEach(o),St=u(v),K=l(v,"DIV",{class:!0});var qo=d(K);$(we.$$.fragment,qo),Rt=u(qo),uo=l(qo,"P",{});var gs=d(uo);Xt=a(gs,"Call self as a function."),gs.forEach(o),qo.forEach(o),At=u(v),Qe=l(v,"DIV",{class:!0});var _s=d(Qe);$($e.$$.fragment,_s),_s.forEach(o),Yt=u(v),Oe=l(v,"DIV",{class:!0});var bs=d(Oe);$(xe.$$.fragment,bs),bs.forEach(o),zt=u(v),V=l(v,"DIV",{class:!0});var ue=d(V);$(Te.$$.fragment,ue),qt=u(ue),Me=l(ue,"P",{});var Lo=d(Me);Lt=a(Lo,"The "),ho=l(Lo,"CODE",{});var ys=d(ho);Ht=a(ys,"self.components"),ys.forEach(o),Qt=a(Lo,` property can be useful to run different pipelines with the same weights and
configurations without reallocating additional memory.`),Lo.forEach(o),Ot=u(ue),je=l(ue,"P",{});var Ho=d(je);Kt=a(Ho,"Returns ("),go=l(Ho,"CODE",{});var vs=d(go);en=a(vs,"dict"),vs.forEach(o),on=a(Ho,`):
A dictionary containing all the modules needed to initialize the pipeline.`),Ho.forEach(o),tn=u(ue),$(ee.$$.fragment,ue),ue.forEach(o),nn=u(v),oe=l(v,"DIV",{class:!0});var Qo=d(oe);$(Pe.$$.fragment,Qo),sn=u(Qo),De=l(Qo,"P",{});var Oo=d(De);an=a(Oo,"Disable sliced attention computation. If "),_o=l(Oo,"CODE",{});var ws=d(_o);rn=a(ws,"enable_attention_slicing"),ws.forEach(o),ln=a(Oo,` was previously called, attention is
computed in one step.`),Oo.forEach(o),Qo.forEach(o),dn=u(v),te=l(v,"DIV",{class:!0});var Ko=d(te);$(Ue.$$.fragment,Ko),pn=u(Ko),Ee=l(Ko,"P",{});var et=d(Ee);cn=a(et,"Disable memory efficient attention from "),Ze=l(et,"A",{href:!0,rel:!0});var $s=d(Ze);fn=a($s,"xFormers"),$s.forEach(o),mn=a(et,"."),et.forEach(o),Ko.forEach(o),un=u(v),X=l(v,"DIV",{class:!0});var eo=d(X);$(Je.$$.fragment,eo),hn=u(eo),bo=l(eo,"P",{});var xs=d(bo);gn=a(xs,"Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights."),xs.forEach(o),_n=u(eo),$(ne.$$.fragment,eo),eo.forEach(o),bn=u(v),B=l(v,"DIV",{class:!0});var he=d(B);$(Ge.$$.fragment,he),yn=u(he),yo=l(he,"P",{});var Ts=d(yo);vn=a(Ts,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Ts.forEach(o),wn=u(he),$(se.$$.fragment,he),$n=u(he),$(ie.$$.fragment,he),he.forEach(o),xn=u(v),ae=l(v,"DIV",{class:!0});var ot=d(ae);$(Ie.$$.fragment,ot),Tn=u(ot),Y=l(ot,"P",{});var oo=d(Y);Mn=a(oo,`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
`),vo=l(oo,"CODE",{});var Ms=d(vo);jn=a(Ms,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ms.forEach(o),Pn=a(oo,"forward"),wo=l(oo,"CODE",{});var js=d(wo);Dn=a(js,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),js.forEach(o),Un=a(oo,"enable_model_cpu_offload`, but performance is lower."),oo.forEach(o),ot.forEach(o),En=u(v),C=l(v,"DIV",{class:!0});var ge=d(C);$(ke.$$.fragment,ge),Zn=u(ge),We=l(ge,"P",{});var tt=d(We);Jn=a(tt,"Enable memory efficient attention from "),Ne=l(tt,"A",{href:!0,rel:!0});var Ps=d(Ne);Gn=a(Ps,"xFormers"),Ps.forEach(o),In=a(tt,`. 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.`),tt.forEach(o),kn=u(ge),$(re.$$.fragment,ge),Wn=u(ge),$(le.$$.fragment,ge),ge.forEach(o),Nn=u(v),I=l(v,"DIV",{class:!0});var F=d(I);$(Ve.$$.fragment,F),Vn=u(F),$o=l(F,"P",{});var Ds=d($o);Bn=a(Ds,"Instantiate a PyTorch diffusion pipeline from pretrained pipeline weights."),Ds.forEach(o),Cn=u(F),Be=l(F,"P",{});var nt=d(Be);Fn=a(nt,"The pipeline is set in evaluation mode ("),xo=l(nt,"CODE",{});var Us=d(xo);Sn=a(Us,"model.eval()"),Us.forEach(o),Rn=a(nt,") by default."),nt.forEach(o),Xn=u(F),$(de.$$.fragment,F),An=u(F),$(pe.$$.fragment,F),Yn=u(F),$(ce.$$.fragment,F),F.forEach(o),zn=u(v),fe=l(v,"DIV",{class:!0});var st=d(fe);$(Ce.$$.fragment,st),qn=u(st),To=l(st,"P",{});var Es=d(To);Ln=a(Es,"Convert a NumPy image or a batch of images to a PIL image."),Es.forEach(o),st.forEach(o),Hn=u(v),me=l(v,"DIV",{class:!0});var it=d(me);$(Fe.$$.fragment,it),Qn=u(it),Se=l(it,"P",{});var at=d(Se);On=a(at,`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
`),Ke=l(at,"A",{href:!0});var Zs=d(Ke);Kn=a(Zs,"from_pretrained()"),Zs.forEach(o),es=a(at," class method."),at.forEach(o),it.forEach(o),v.forEach(o),this.h()},h(){b(s,"name","hf:doc:metadata"),b(s,"content",JSON.stringify(Ls)),b(c,"id","pipelines"),b(c,"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(c,"href","#pipelines"),b(p,"class","relative group"),b(G,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),b(R,"href","https://huggingface.co/models?library=diffusers"),b(R,"rel","nofollow"),b(Ye,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),b(ze,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained"),b(qe,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained"),b(H,"id","diffusers.DiffusionPipeline"),b(H,"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(H,"href","#diffusers.DiffusionPipeline"),b(A,"class","relative group"),b(He,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),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(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Ze,"href","https://facebookresearch.github.io/xformers/"),b(Ze,"rel","nofollow"),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(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(B,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Ne,"href","https://facebookresearch.github.io/xformers/"),b(Ne,"rel","nofollow"),b(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(I,"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(Ke,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.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(_,"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,y){e(document.head,s),P(n,g,y),P(n,p,y),e(p,c),e(c,h),x(t,h,null),e(p,f),e(p,Z),e(Z,E),P(n,D,y),P(n,J,y),e(J,k),e(J,G),e(G,Xe),e(J,Ae),e(J,R),e(R,rt),e(J,lt),P(n,Vo,y),x(q,n,y),P(n,Bo,y),P(n,N,y),e(N,dt),e(N,Ye),e(Ye,pt),e(N,ct),e(N,ze),e(ze,ft),e(N,mt),e(N,to),e(to,ut),e(N,ht),P(n,Co,y),P(n,L,y),e(L,gt),e(L,qe),e(qe,_t),e(L,bt),P(n,Fo,y),P(n,A,y),e(A,H),e(H,no),x(_e,no,null),e(A,yt),e(A,so),e(so,vt),P(n,So,y),P(n,_,y),x(be,_,null),e(_,wt),e(_,io),e(io,$t),e(_,xt),e(_,Le),e(Le,He),e(He,Tt),e(Le,Mt),e(_,jt),e(_,ye),e(ye,ao),e(ao,Pt),e(ye,Dt),e(ye,ro),e(ro,Ut),e(_,Et),e(_,lo),e(lo,Zt),e(_,Jt),e(_,ve),e(ve,Q),e(Q,po),e(po,Gt),e(Q,It),e(Q,co),e(co,kt),e(Q,Wt),e(ve,Nt),e(ve,O),e(O,fo),e(fo,Vt),e(O,Bt),e(O,mo),e(mo,Ct),e(O,Ft),e(_,St),e(_,K),x(we,K,null),e(K,Rt),e(K,uo),e(uo,Xt),e(_,At),e(_,Qe),x($e,Qe,null),e(_,Yt),e(_,Oe),x(xe,Oe,null),e(_,zt),e(_,V),x(Te,V,null),e(V,qt),e(V,Me),e(Me,Lt),e(Me,ho),e(ho,Ht),e(Me,Qt),e(V,Ot),e(V,je),e(je,Kt),e(je,go),e(go,en),e(je,on),e(V,tn),x(ee,V,null),e(_,nn),e(_,oe),x(Pe,oe,null),e(oe,sn),e(oe,De),e(De,an),e(De,_o),e(_o,rn),e(De,ln),e(_,dn),e(_,te),x(Ue,te,null),e(te,pn),e(te,Ee),e(Ee,cn),e(Ee,Ze),e(Ze,fn),e(Ee,mn),e(_,un),e(_,X),x(Je,X,null),e(X,hn),e(X,bo),e(bo,gn),e(X,_n),x(ne,X,null),e(_,bn),e(_,B),x(Ge,B,null),e(B,yn),e(B,yo),e(yo,vn),e(B,wn),x(se,B,null),e(B,$n),x(ie,B,null),e(_,xn),e(_,ae),x(Ie,ae,null),e(ae,Tn),e(ae,Y),e(Y,Mn),e(Y,vo),e(vo,jn),e(Y,Pn),e(Y,wo),e(wo,Dn),e(Y,Un),e(_,En),e(_,C),x(ke,C,null),e(C,Zn),e(C,We),e(We,Jn),e(We,Ne),e(Ne,Gn),e(We,In),e(C,kn),x(re,C,null),e(C,Wn),x(le,C,null),e(_,Nn),e(_,I),x(Ve,I,null),e(I,Vn),e(I,$o),e($o,Bn),e(I,Cn),e(I,Be),e(Be,Fn),e(Be,xo),e(xo,Sn),e(Be,Rn),e(I,Xn),x(de,I,null),e(I,An),x(pe,I,null),e(I,Yn),x(ce,I,null),e(_,zn),e(_,fe),x(Ce,fe,null),e(fe,qn),e(fe,To),e(To,Ln),e(_,Hn),e(_,me),x(Fe,me,null),e(me,Qn),e(me,Se),e(Se,On),e(Se,Ke),e(Ke,Kn),e(Se,es),Ro=!0},p(n,[y]){const Re={};y&2&&(Re.$$scope={dirty:y,ctx:n}),q.$set(Re);const Mo={};y&2&&(Mo.$$scope={dirty:y,ctx:n}),ee.$set(Mo);const jo={};y&2&&(jo.$$scope={dirty:y,ctx:n}),ne.$set(jo);const Po={};y&2&&(Po.$$scope={dirty:y,ctx:n}),se.$set(Po);const z={};y&2&&(z.$$scope={dirty:y,ctx:n}),ie.$set(z);const Do={};y&2&&(Do.$$scope={dirty:y,ctx:n}),re.$set(Do);const Uo={};y&2&&(Uo.$$scope={dirty:y,ctx:n}),le.$set(Uo);const S={};y&2&&(S.$$scope={dirty:y,ctx:n}),de.$set(S);const Eo={};y&2&&(Eo.$$scope={dirty:y,ctx:n}),pe.$set(Eo);const Zo={};y&2&&(Zo.$$scope={dirty:y,ctx:n}),ce.$set(Zo)},i(n){Ro||(T(t.$$.fragment,n),T(q.$$.fragment,n),T(_e.$$.fragment,n),T(be.$$.fragment,n),T(we.$$.fragment,n),T($e.$$.fragment,n),T(xe.$$.fragment,n),T(Te.$$.fragment,n),T(ee.$$.fragment,n),T(Pe.$$.fragment,n),T(Ue.$$.fragment,n),T(Je.$$.fragment,n),T(ne.$$.fragment,n),T(Ge.$$.fragment,n),T(se.$$.fragment,n),T(ie.$$.fragment,n),T(Ie.$$.fragment,n),T(ke.$$.fragment,n),T(re.$$.fragment,n),T(le.$$.fragment,n),T(Ve.$$.fragment,n),T(de.$$.fragment,n),T(pe.$$.fragment,n),T(ce.$$.fragment,n),T(Ce.$$.fragment,n),T(Fe.$$.fragment,n),Ro=!0)},o(n){M(t.$$.fragment,n),M(q.$$.fragment,n),M(_e.$$.fragment,n),M(be.$$.fragment,n),M(we.$$.fragment,n),M($e.$$.fragment,n),M(xe.$$.fragment,n),M(Te.$$.fragment,n),M(ee.$$.fragment,n),M(Pe.$$.fragment,n),M(Ue.$$.fragment,n),M(Je.$$.fragment,n),M(ne.$$.fragment,n),M(Ge.$$.fragment,n),M(se.$$.fragment,n),M(ie.$$.fragment,n),M(Ie.$$.fragment,n),M(ke.$$.fragment,n),M(re.$$.fragment,n),M(le.$$.fragment,n),M(Ve.$$.fragment,n),M(de.$$.fragment,n),M(pe.$$.fragment,n),M(ce.$$.fragment,n),M(Ce.$$.fragment,n),M(Fe.$$.fragment,n),Ro=!1},d(n){o(s),n&&o(g),n&&o(p),j(t),n&&o(D),n&&o(J),n&&o(Vo),j(q,n),n&&o(Bo),n&&o(N),n&&o(Co),n&&o(L),n&&o(Fo),n&&o(A),j(_e),n&&o(So),n&&o(_),j(be),j(we),j($e),j(xe),j(Te),j(ee),j(Pe),j(Ue),j(Je),j(ne),j(Ge),j(se),j(ie),j(Ie),j(ke),j(re),j(le),j(Ve),j(de),j(pe),j(ce),j(Ce),j(Fe)}}}const Ls={local:"pipelines",sections:[{local:"diffusers.DiffusionPipeline",title:"DiffusionPipeline"}],title:"Pipelines"};function Hs(U){return Ns(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ni extends Gs{constructor(s){super();Is(this,s,Hs,qs,ks,{})}}export{ni as default,Ls as metadata};
