import{S as fs,i as cs,s as ms,e as n,k as d,w,t as a,M as us,c as o,d as i,m as p,a as s,x as P,h as r,b as c,G as e,g as $,y as D,q as E,o as x,B as k,v as hs,L as vo}from"../../chunks/vendor-hf-doc-builder.js";import{T as go}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as bo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as hi}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _o}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function gs(S){let f;return{c(){f=a("One should not use the Diffusion Pipeline class for training or fine-tuning a diffusion model. Individual \n	components of diffusion pipelines are usually trained individually, so we suggest to directly work \n	with `UNetModel` and `UNetConditionModel`.")},l(b){f=r(b,"One should not use the Diffusion Pipeline class for training or fine-tuning a diffusion model. Individual \n	components of diffusion pipelines are usually trained individually, so we suggest to directly work \n	with `UNetModel` and `UNetConditionModel`.")},m(b,m){$(b,f,m)},d(b){b&&i(f)}}}function _s(S){let f,b,m,u,y;return u=new bo({props:{code:`from diffusers import (
    StableDiffusionPipeline,
    StableDiffusionImg2ImgPipeline,
    StableDiffusionInpaintPipeline,
)

text2img = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
inpaint = StableDiffusionInpaintPipeline(**text2img.components)`,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(){f=n("p"),b=a("Examples:"),m=d(),w(u.$$.fragment)},l(l){f=o(l,"P",{});var _=s(f);b=r(_,"Examples:"),_.forEach(i),m=p(l),P(u.$$.fragment,l)},m(l,_){$(l,f,_),e(f,b),$(l,m,_),D(u,l,_),y=!0},p:vo,i(l){y||(E(u.$$.fragment,l),y=!0)},o(l){x(u.$$.fragment,l),y=!1},d(l){l&&i(f),l&&i(m),k(u,l)}}}function vs(S){let f,b,m,u,y;return u=new bo({props:{code:`import torch
from diffusers import DiffusionPipeline
from xformers.ops import MemoryEfficientAttentionFlashAttentionOp

pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
# Workaround for not accepting attention shape using VAE for Flash Attention
pipe.vae.enable_xformers_memory_efficient_attention(attention_op=None)`,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(){f=n("p"),b=a("Examples:"),m=d(),w(u.$$.fragment)},l(l){f=o(l,"P",{});var _=s(f);b=r(_,"Examples:"),_.forEach(i),m=p(l),P(u.$$.fragment,l)},m(l,_){$(l,f,_),e(f,b),$(l,m,_),D(u,l,_),y=!0},p:vo,i(l){y||(E(u.$$.fragment,l),y=!0)},o(l){x(u.$$.fragment,l),y=!1},d(l){l&&i(f),l&&i(m),k(u,l)}}}function bs(S){let f,b,m,u,y,l,_,N,F,Q,T,U,M;return{c(){f=n("p"),b=a("It is required to be logged in ("),m=n("code"),u=a("huggingface-cli login"),y=a(") when you want to use private or "),l=n("a"),_=a(`gated
models`),N=a(", "),F=n("em"),Q=a("e.g."),T=d(),U=n("code"),M=a('"runwayml/stable-diffusion-v1-5"'),this.h()},l(H){f=o(H,"P",{});var O=s(f);b=r(O,"It is required to be logged in ("),m=o(O,"CODE",{});var z=s(m);u=r(z,"huggingface-cli login"),z.forEach(i),y=r(O,") when you want to use private or "),l=o(O,"A",{href:!0,rel:!0});var Fe=s(l);_=r(Fe,`gated
models`),Fe.forEach(i),N=r(O,", "),F=o(O,"EM",{});var Ue=s(F);Q=r(Ue,"e.g."),Ue.forEach(i),T=p(O),U=o(O,"CODE",{});var ge=s(U);M=r(ge,'"runwayml/stable-diffusion-v1-5"'),ge.forEach(i),O.forEach(i),this.h()},h(){c(l,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),c(l,"rel","nofollow")},m(H,O){$(H,f,O),e(f,b),e(f,m),e(m,u),e(f,y),e(f,l),e(l,_),e(f,N),e(f,F),e(F,Q),e(f,T),e(f,U),e(U,M)},d(H){H&&i(f)}}}function $s(S){let f,b,m,u,y;return{c(){f=n("p"),b=a("Activate the special "),m=n("a"),u=a("\u201Coffline-mode\u201D"),y=a(` to use
this method in a firewalled environment.`),this.h()},l(l){f=o(l,"P",{});var _=s(f);b=r(_,"Activate the special "),m=o(_,"A",{href:!0,rel:!0});var N=s(m);u=r(N,"\u201Coffline-mode\u201D"),N.forEach(i),y=r(_,` to use
this method in a firewalled environment.`),_.forEach(i),this.h()},h(){c(m,"href","https://huggingface.co/diffusers/installation.html#offline-mode"),c(m,"rel","nofollow")},m(l,_){$(l,f,_),e(f,b),e(f,m),e(m,u),e(f,y)},d(l){l&&i(f)}}}function ys(S){let f,b,m,u,y;return u=new bo({props:{code:`from diffusers import DiffusionPipeline

# Download pipeline from huggingface.co and cache.
pipeline = DiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")

# Download pipeline that requires an authorization token
# For more information on access tokens, please refer to this section
# of the documentation](https://huggingface.co/docs/hub/security-tokens)
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")

# Use a different scheduler
from diffusers import LMSDiscreteScheduler

scheduler = LMSDiscreteScheduler.from_config(pipeline.scheduler.config)
pipeline.scheduler = scheduler`,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(){f=n("p"),b=a("Examples:"),m=d(),w(u.$$.fragment)},l(l){f=o(l,"P",{});var _=s(f);b=r(_,"Examples:"),_.forEach(i),m=p(l),P(u.$$.fragment,l)},m(l,_){$(l,f,_),e(f,b),$(l,m,_),D(u,l,_),y=!0},p:vo,i(l){y||(E(u.$$.fragment,l),y=!0)},o(l){x(u.$$.fragment,l),y=!1},d(l){l&&i(f),l&&i(m),k(u,l)}}}function ws(S){let f,b,m,u,y,l,_,N,F,Q,T,U,M,H,O,z,Fe,Ue,ge,Z,Vt,A,gi,He,_i,vi,et,bi,$i,Ye,yi,wi,tt,Pi,Di,it,Ei,xi,nt,ki,Ii,Wt,ee,Ai,Be,ji,Oi,Ft,Y,te,ot,_e,Si,st,Ti,Ut,h,ve,Li,at,qi,Ci,Ge,Re,Ni,Mi,zi,be,rt,Xi,Vi,lt,Wi,Fi,dt,Ui,Hi,$e,ie,pt,Yi,Bi,ft,Gi,Ri,Ji,ne,ct,Ki,Qi,mt,Zi,en,tn,oe,ye,nn,ut,on,sn,Je,we,an,Ke,Pe,rn,X,De,ln,Ee,dn,ht,pn,fn,cn,se,mn,ae,xe,un,ke,hn,gt,gn,_n,vn,re,Ie,bn,_t,$n,yn,V,Ae,wn,vt,Pn,Dn,bt,En,xn,L,je,kn,$t,In,An,yt,jn,On,wt,Sn,Tn,le,Ln,I,Oe,qn,Pt,Cn,Nn,Se,Mn,Dt,zn,Xn,Vn,Te,Wn,Et,Fn,Un,Hn,Le,Yn,xt,Bn,Gn,Rn,de,Jn,pe,Kn,fe,Qn,ce,qe,Zn,kt,eo,to,me,Ce,io,Ne,no,It,oo,so,Ht,B,ue,At,Me,ao,jt,ro,Yt,G,ze,lo,Ot,po,Bt,R,he,St,Xe,fo,Tt,co,Gt,J,Ve,mo,Lt,uo,Rt;return l=new hi({}),Z=new go({props:{$$slots:{default:[gs]},$$scope:{ctx:S}}}),_e=new hi({}),ve=new C({props:{name:"class diffusers.DiffusionPipeline",anchor:"diffusers.DiffusionPipeline",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L184"}}),ye=new C({props:{name:"__call__",anchor:"diffusers.DiffusionPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),we=new C({props:{name:"device",anchor:"diffusers.DiffusionPipeline.device",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L325",returnDescription:`
<p>The torch device on which the pipeline is located.</p>
`,returnType:`
<p><code>torch.device</code></p>
`}}),Pe=new C({props:{name:"to",anchor:"diffusers.DiffusionPipeline.to",parameters:[{name:"torch_device",val:": typing.Union[str, torch.device, NoneType] = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L306"}}),De=new C({props:{name:"components",anchor:"diffusers.DiffusionPipeline.components",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L905",returnDescription:`
<p>A dictionary containing all the modules needed to initialize the pipeline.</p>
`}}),se=new _o({props:{anchor:"diffusers.DiffusionPipeline.components.example",$$slots:{default:[_s]},$$scope:{ctx:S}}}),xe=new C({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#L1049"}}),Ie=new C({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#L1008"}}),Ae=new C({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>, maxium 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#L1033"}}),je=new C({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#L976"}}),le=new _o({props:{anchor:"diffusers.DiffusionPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[vs]},$$scope:{ctx:S}}}),Oe=new C({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> of a pretrained pipeline hosted inside a model repo on
<a href="https://huggingface.co/" rel="nofollow">https://huggingface.co/</a> Valid repo ids have to be located under a user or organization name, like
<code>CompVis/ldm-text2im-large-256</code>.</li>
<li>A path to a <em>directory</em> containing pipeline weights saved using
<a href="/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a>, e.g., <code>./my_pipeline_directory/</code>.</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 under this dtype. If <code>&quot;auto&quot;</code> is passed the dtype
will be automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.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>This is an experimental feature and is likely to change in the future.</p>

					</div>
<p>Can be either:</p>
<ul>
<li>
<p>A string, the <em>repo id</em> of a custom pipeline hosted inside a model repo on
<a href="https://huggingface.co/" rel="nofollow">https://huggingface.co/</a>. Valid repo ids have to be located under a user or organization name,
like <code>hf-internal-testing/diffusers-dummy-pipeline</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>It is required that the model repo has a file, called <code>pipeline.py</code> that defines the custom
pipeline.</p>

					</div>
</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">https://github.com/huggingface/diffusers/tree/main/examples/community</a>. Valid file names have to
match exactly the file name without <code>.py</code> located under the above link, <em>e.g.</em>
<code>clip_guided_stable_diffusion</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Community pipelines are always loaded from the current <code>main</code> branch of GitHub.</p>

					</div>
</li>
<li>
<p>A path to a <em>directory</em> containing a custom pipeline, e.g., <code>./my_pipeline_directory/</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>It is required that the directory has a file, called <code>pipeline.py</code> that defines the custom
pipeline.</p>

					</div>
</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.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.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, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.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(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.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>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.custom_revision",description:`<strong>custom_revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code> when loading from the Hub and to local version of <code>diffusers</code> when loading from GitHub) &#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 diffusers version when loading a
custom pipeline from GitHub.`,name:"custom_revision"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information. specify the folder name here.`,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 refined to each
parameter/buffer name, once a given module name is inside, every submodule of it will be sent to the
same device.</p>
<p>To have Accelerate compute the most optimized <code>device_map</code> automatically, set <code>device_map=&quot;auto&quot;</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.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 by not initializing the weights and only loading the pre-trained weights. This
also tries to not use more than 1x model size in CPU memory (including peak memory) while loading the
model. This is only supported when torch version &gt;= 1.9.0. If you are using an older version of torch,
setting this argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.return_cached_folder",description:`<strong>return_cached_folder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If set to <code>True</code>, path to downloaded cached folder will be returned in addition to loaded pipeline.`,name:"return_cached_folder"},{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 - <em>i.e.</em> the pipeline components - of the
specific pipeline class. The overwritten components are then directly passed to the pipelines
<code>__init__</code> method. See example below for more information.`,name:"kwargs"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If specified load weights from <code>variant</code> filename, <em>e.g.</em> pytorch_model.<variant>.bin. <code>variant</code> is
ignored when using <code>from_flax</code>.</variant>`,name:"variant"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L338"}}),de=new go({props:{$$slots:{default:[bs]},$$scope:{ctx:S}}}),pe=new go({props:{$$slots:{default:[$s]},$$scope:{ctx:S}}}),fe=new _o({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example",$$slots:{default:[ys]},$$scope:{ctx:S}}}),qe=new C({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#L942"}}),Ce=new C({props:{name:"save_pretrained",anchor:"diffusers.DiffusionPipeline.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"safe_serialization",val:": bool = False"},{name:"variant",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.DiffusionPipeline.save_pretrained.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way (that uses <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 pytorch_model.<variant>.bin.</variant>`,name:"variant"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L237"}}),Me=new hi({}),ze=new C({props:{name:"class diffusers.ImagePipelineOutput",anchor:"diffusers.ImagePipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"}],parametersDescription:[{anchor:"diffusers.ImagePipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or numpy array of shape <code>(batch_size, height, width, num_channels)</code>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L104"}}),Xe=new hi({}),Ve=new C({props:{name:"class diffusers.AudioPipelineOutput",anchor:"diffusers.AudioPipelineOutput",parameters:[{name:"audios",val:": ndarray"}],parametersDescription:[{anchor:"diffusers.AudioPipelineOutput.audios",description:`<strong>audios</strong> (<code>np.ndarray</code>) &#x2014;
List of denoised samples of shape <code>(batch_size, num_channels, sample_rate)</code>. Numpy array present the
denoised audio samples of the diffusion pipeline.`,name:"audios"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L118"}}),{c(){f=n("meta"),b=d(),m=n("h1"),u=n("a"),y=n("span"),w(l.$$.fragment),_=d(),N=n("span"),F=a("Pipelines"),Q=d(),T=n("p"),U=a("The "),M=n("a"),H=a("DiffusionPipeline"),O=a(" is the easiest way to load any pretrained diffusion pipeline from the "),z=n("a"),Fe=a("Hub"),Ue=a(" and to use it in inference."),ge=d(),w(Z.$$.fragment),Vt=d(),A=n("p"),gi=a("Any diffusion pipeline that is loaded with "),He=n("a"),_i=a("from_pretrained()"),vi=a(` will automatically
detect the pipeline type, `),et=n("em"),bi=a("e.g."),$i=d(),Ye=n("a"),yi=a("StableDiffusionPipeline"),wi=a(` and consequently load each component of the
pipeline and pass them into the `),tt=n("code"),Pi=a("__init__"),Di=a(" function of the pipeline, "),it=n("em"),Ei=a("e.g."),xi=d(),nt=n("code"),ki=a("__init__()"),Ii=a("."),Wt=d(),ee=n("p"),Ai=a("Any pipeline object can be saved locally with "),Be=n("a"),ji=a("save_pretrained()"),Oi=a("."),Ft=d(),Y=n("h2"),te=n("a"),ot=n("span"),w(_e.$$.fragment),Si=d(),st=n("span"),Ti=a("DiffusionPipeline"),Ut=d(),h=n("div"),w(ve.$$.fragment),Li=d(),at=n("p"),qi=a("Base class for all models."),Ci=d(),Ge=n("p"),Re=n("a"),Ni=a("DiffusionPipeline"),Mi=a(` takes care of storing all components (models, schedulers, processors) for diffusion pipelines
and handles methods for loading, downloading and saving models as well as a few methods common to all pipelines to:`),zi=d(),be=n("ul"),rt=n("li"),Xi=a("move all PyTorch modules to the device of your choice"),Vi=d(),lt=n("li"),Wi=a("enabling/disabling the progress bar for the denoising iteration"),Fi=d(),dt=n("p"),Ui=a("Class attributes:"),Hi=d(),$e=n("ul"),ie=n("li"),pt=n("strong"),Yi=a("config_name"),Bi=a(" ("),ft=n("code"),Gi=a("str"),Ri=a(`) \u2014 name of the config file that will store the class and module names of all
components of the diffusion pipeline.`),Ji=d(),ne=n("li"),ct=n("strong"),Ki=a("_optional_components"),Qi=a(" (List"),mt=n("code"),Zi=a("str"),en=a(`) \u2014 list of all components that are optional so they don\u2019t have to be
passed for the pipeline to function (should be overridden by subclasses).`),tn=d(),oe=n("div"),w(ye.$$.fragment),nn=d(),ut=n("p"),on=a("Call self as a function."),sn=d(),Je=n("div"),w(we.$$.fragment),an=d(),Ke=n("div"),w(Pe.$$.fragment),rn=d(),X=n("div"),w(De.$$.fragment),ln=d(),Ee=n("p"),dn=a("The "),ht=n("code"),pn=a("self.components"),fn=a(` property can be useful to run different pipelines with the same weights and
configurations to not have to re-allocate memory.`),cn=d(),w(se.$$.fragment),mn=d(),ae=n("div"),w(xe.$$.fragment),un=d(),ke=n("p"),hn=a("Disable sliced attention computation. If "),gt=n("code"),gn=a("enable_attention_slicing"),_n=a(` was previously invoked, this method will go
back to computing attention in one step.`),vn=d(),re=n("div"),w(Ie.$$.fragment),bn=d(),_t=n("p"),$n=a("Disable memory efficient attention as implemented in xformers."),yn=d(),V=n("div"),w(Ae.$$.fragment),wn=d(),vt=n("p"),Pn=a("Enable sliced attention computation."),Dn=d(),bt=n("p"),En=a(`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),xn=d(),L=n("div"),w(je.$$.fragment),kn=d(),$t=n("p"),In=a("Enable memory efficient attention as implemented in xformers."),An=d(),yt=n("p"),jn=a(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),On=d(),wt=n("p"),Sn=a(`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Tn=d(),w(le.$$.fragment),Ln=d(),I=n("div"),w(Oe.$$.fragment),qn=d(),Pt=n("p"),Cn=a("Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights."),Nn=d(),Se=n("p"),Mn=a("The pipeline is set in evaluation mode by default using "),Dt=n("code"),zn=a("model.eval()"),Xn=a(" (Dropout modules are deactivated)."),Vn=d(),Te=n("p"),Wn=a("The warning "),Et=n("em"),Fn=a("Weights from XXX not initialized from pretrained model"),Un=a(` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),Hn=d(),Le=n("p"),Yn=a("The warning "),xt=n("em"),Bn=a("Weights from XXX not used in YYY"),Gn=a(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),Rn=d(),w(de.$$.fragment),Jn=d(),w(pe.$$.fragment),Kn=d(),w(fe.$$.fragment),Qn=d(),ce=n("div"),w(qe.$$.fragment),Zn=d(),kt=n("p"),eo=a("Convert a numpy image or a batch of images to a PIL image."),to=d(),me=n("div"),w(Ce.$$.fragment),io=d(),Ne=n("p"),no=a(`Save all variables of the pipeline that can be saved and loaded as well as the pipelines configuration file to
a directory. A pipeline variable can be saved and loaded if its class implements both a save and loading
method. The pipeline can easily be re-loaded using the `),It=n("code"),oo=a("[from_pretrained()](/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained)"),so=a(" class method."),Ht=d(),B=n("h2"),ue=n("a"),At=n("span"),w(Me.$$.fragment),ao=d(),jt=n("span"),ro=a("ImagePipelineOutput"),Yt=a(`

By default diffusion pipelines return an object of class
`),G=n("div"),w(ze.$$.fragment),lo=d(),Ot=n("p"),po=a("Output class for image pipelines."),Bt=d(),R=n("h2"),he=n("a"),St=n("span"),w(Xe.$$.fragment),fo=d(),Tt=n("span"),co=a("AudioPipelineOutput"),Gt=a(`

By default diffusion pipelines return an object of class
`),J=n("div"),w(Ve.$$.fragment),mo=d(),Lt=n("p"),uo=a("Output class for audio pipelines."),this.h()},l(t){const g=us('[data-svelte="svelte-1phssyn"]',document.head);f=o(g,"META",{name:!0,content:!0}),g.forEach(i),b=p(t),m=o(t,"H1",{class:!0});var We=s(m);u=o(We,"A",{id:!0,class:!0,href:!0});var qt=s(u);y=o(qt,"SPAN",{});var Ct=s(y);P(l.$$.fragment,Ct),Ct.forEach(i),qt.forEach(i),_=p(We),N=o(We,"SPAN",{});var Nt=s(N);F=r(Nt,"Pipelines"),Nt.forEach(i),We.forEach(i),Q=p(t),T=o(t,"P",{});var K=s(T);U=r(K,"The "),M=o(K,"A",{href:!0});var Mt=s(M);H=r(Mt,"DiffusionPipeline"),Mt.forEach(i),O=r(K," is the easiest way to load any pretrained diffusion pipeline from the "),z=o(K,"A",{href:!0,rel:!0});var $o=s(z);Fe=r($o,"Hub"),$o.forEach(i),Ue=r(K," and to use it in inference."),K.forEach(i),ge=p(t),P(Z.$$.fragment,t),Vt=p(t),A=o(t,"P",{});var q=s(A);gi=r(q,"Any diffusion pipeline that is loaded with "),He=o(q,"A",{href:!0});var yo=s(He);_i=r(yo,"from_pretrained()"),yo.forEach(i),vi=r(q,` will automatically
detect the pipeline type, `),et=o(q,"EM",{});var wo=s(et);bi=r(wo,"e.g."),wo.forEach(i),$i=p(q),Ye=o(q,"A",{href:!0});var Po=s(Ye);yi=r(Po,"StableDiffusionPipeline"),Po.forEach(i),wi=r(q,` and consequently load each component of the
pipeline and pass them into the `),tt=o(q,"CODE",{});var Do=s(tt);Pi=r(Do,"__init__"),Do.forEach(i),Di=r(q," function of the pipeline, "),it=o(q,"EM",{});var Eo=s(it);Ei=r(Eo,"e.g."),Eo.forEach(i),xi=p(q),nt=o(q,"CODE",{});var xo=s(nt);ki=r(xo,"__init__()"),xo.forEach(i),Ii=r(q,"."),q.forEach(i),Wt=p(t),ee=o(t,"P",{});var Jt=s(ee);Ai=r(Jt,"Any pipeline object can be saved locally with "),Be=o(Jt,"A",{href:!0});var ko=s(Be);ji=r(ko,"save_pretrained()"),ko.forEach(i),Oi=r(Jt,"."),Jt.forEach(i),Ft=p(t),Y=o(t,"H2",{class:!0});var Kt=s(Y);te=o(Kt,"A",{id:!0,class:!0,href:!0});var Io=s(te);ot=o(Io,"SPAN",{});var Ao=s(ot);P(_e.$$.fragment,Ao),Ao.forEach(i),Io.forEach(i),Si=p(Kt),st=o(Kt,"SPAN",{});var jo=s(st);Ti=r(jo,"DiffusionPipeline"),jo.forEach(i),Kt.forEach(i),Ut=p(t),h=o(t,"DIV",{class:!0});var v=s(h);P(ve.$$.fragment,v),Li=p(v),at=o(v,"P",{});var Oo=s(at);qi=r(Oo,"Base class for all models."),Oo.forEach(i),Ci=p(v),Ge=o(v,"P",{});var ho=s(Ge);Re=o(ho,"A",{href:!0});var So=s(Re);Ni=r(So,"DiffusionPipeline"),So.forEach(i),Mi=r(ho,` takes care of storing all components (models, schedulers, processors) for diffusion pipelines
and handles methods for loading, downloading and saving models as well as a few methods common to all pipelines to:`),ho.forEach(i),zi=p(v),be=o(v,"UL",{});var Qt=s(be);rt=o(Qt,"LI",{});var To=s(rt);Xi=r(To,"move all PyTorch modules to the device of your choice"),To.forEach(i),Vi=p(Qt),lt=o(Qt,"LI",{});var Lo=s(lt);Wi=r(Lo,"enabling/disabling the progress bar for the denoising iteration"),Lo.forEach(i),Qt.forEach(i),Fi=p(v),dt=o(v,"P",{});var qo=s(dt);Ui=r(qo,"Class attributes:"),qo.forEach(i),Hi=p(v),$e=o(v,"UL",{});var Zt=s($e);ie=o(Zt,"LI",{});var zt=s(ie);pt=o(zt,"STRONG",{});var Co=s(pt);Yi=r(Co,"config_name"),Co.forEach(i),Bi=r(zt," ("),ft=o(zt,"CODE",{});var No=s(ft);Gi=r(No,"str"),No.forEach(i),Ri=r(zt,`) \u2014 name of the config file that will store the class and module names of all
components of the diffusion pipeline.`),zt.forEach(i),Ji=p(Zt),ne=o(Zt,"LI",{});var Xt=s(ne);ct=o(Xt,"STRONG",{});var Mo=s(ct);Ki=r(Mo,"_optional_components"),Mo.forEach(i),Qi=r(Xt," (List"),mt=o(Xt,"CODE",{});var zo=s(mt);Zi=r(zo,"str"),zo.forEach(i),en=r(Xt,`) \u2014 list of all components that are optional so they don\u2019t have to be
passed for the pipeline to function (should be overridden by subclasses).`),Xt.forEach(i),Zt.forEach(i),tn=p(v),oe=o(v,"DIV",{class:!0});var ei=s(oe);P(ye.$$.fragment,ei),nn=p(ei),ut=o(ei,"P",{});var Xo=s(ut);on=r(Xo,"Call self as a function."),Xo.forEach(i),ei.forEach(i),sn=p(v),Je=o(v,"DIV",{class:!0});var Vo=s(Je);P(we.$$.fragment,Vo),Vo.forEach(i),an=p(v),Ke=o(v,"DIV",{class:!0});var Wo=s(Ke);P(Pe.$$.fragment,Wo),Wo.forEach(i),rn=p(v),X=o(v,"DIV",{class:!0});var Qe=s(X);P(De.$$.fragment,Qe),ln=p(Qe),Ee=o(Qe,"P",{});var ti=s(Ee);dn=r(ti,"The "),ht=o(ti,"CODE",{});var Fo=s(ht);pn=r(Fo,"self.components"),Fo.forEach(i),fn=r(ti,` property can be useful to run different pipelines with the same weights and
configurations to not have to re-allocate memory.`),ti.forEach(i),cn=p(Qe),P(se.$$.fragment,Qe),Qe.forEach(i),mn=p(v),ae=o(v,"DIV",{class:!0});var ii=s(ae);P(xe.$$.fragment,ii),un=p(ii),ke=o(ii,"P",{});var ni=s(ke);hn=r(ni,"Disable sliced attention computation. If "),gt=o(ni,"CODE",{});var Uo=s(gt);gn=r(Uo,"enable_attention_slicing"),Uo.forEach(i),_n=r(ni,` was previously invoked, this method will go
back to computing attention in one step.`),ni.forEach(i),ii.forEach(i),vn=p(v),re=o(v,"DIV",{class:!0});var oi=s(re);P(Ie.$$.fragment,oi),bn=p(oi),_t=o(oi,"P",{});var Ho=s(_t);$n=r(Ho,"Disable memory efficient attention as implemented in xformers."),Ho.forEach(i),oi.forEach(i),yn=p(v),V=o(v,"DIV",{class:!0});var Ze=s(V);P(Ae.$$.fragment,Ze),wn=p(Ze),vt=o(Ze,"P",{});var Yo=s(vt);Pn=r(Yo,"Enable sliced attention computation."),Yo.forEach(i),Dn=p(Ze),bt=o(Ze,"P",{});var Bo=s(bt);En=r(Bo,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),Bo.forEach(i),Ze.forEach(i),xn=p(v),L=o(v,"DIV",{class:!0});var W=s(L);P(je.$$.fragment,W),kn=p(W),$t=o(W,"P",{});var Go=s($t);In=r(Go,"Enable memory efficient attention as implemented in xformers."),Go.forEach(i),An=p(W),yt=o(W,"P",{});var Ro=s(yt);jn=r(Ro,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),Ro.forEach(i),On=p(W),wt=o(W,"P",{});var Jo=s(wt);Sn=r(Jo,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Jo.forEach(i),Tn=p(W),P(le.$$.fragment,W),W.forEach(i),Ln=p(v),I=o(v,"DIV",{class:!0});var j=s(I);P(Oe.$$.fragment,j),qn=p(j),Pt=o(j,"P",{});var Ko=s(Pt);Cn=r(Ko,"Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights."),Ko.forEach(i),Nn=p(j),Se=o(j,"P",{});var si=s(Se);Mn=r(si,"The pipeline is set in evaluation mode by default using "),Dt=o(si,"CODE",{});var Qo=s(Dt);zn=r(Qo,"model.eval()"),Qo.forEach(i),Xn=r(si," (Dropout modules are deactivated)."),si.forEach(i),Vn=p(j),Te=o(j,"P",{});var ai=s(Te);Wn=r(ai,"The warning "),Et=o(ai,"EM",{});var Zo=s(Et);Fn=r(Zo,"Weights from XXX not initialized from pretrained model"),Zo.forEach(i),Un=r(ai,` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),ai.forEach(i),Hn=p(j),Le=o(j,"P",{});var ri=s(Le);Yn=r(ri,"The warning "),xt=o(ri,"EM",{});var es=s(xt);Bn=r(es,"Weights from XXX not used in YYY"),es.forEach(i),Gn=r(ri,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),ri.forEach(i),Rn=p(j),P(de.$$.fragment,j),Jn=p(j),P(pe.$$.fragment,j),Kn=p(j),P(fe.$$.fragment,j),j.forEach(i),Qn=p(v),ce=o(v,"DIV",{class:!0});var li=s(ce);P(qe.$$.fragment,li),Zn=p(li),kt=o(li,"P",{});var ts=s(kt);eo=r(ts,"Convert a numpy image or a batch of images to a PIL image."),ts.forEach(i),li.forEach(i),to=p(v),me=o(v,"DIV",{class:!0});var di=s(me);P(Ce.$$.fragment,di),io=p(di),Ne=o(di,"P",{});var pi=s(Ne);no=r(pi,`Save all variables of the pipeline that can be saved and loaded as well as the pipelines configuration file to
a directory. A pipeline variable can be saved and loaded if its class implements both a save and loading
method. The pipeline can easily be re-loaded using the `),It=o(pi,"CODE",{});var is=s(It);oo=r(is,"[from_pretrained()](/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained)"),is.forEach(i),so=r(pi," class method."),pi.forEach(i),di.forEach(i),v.forEach(i),Ht=p(t),B=o(t,"H2",{class:!0});var fi=s(B);ue=o(fi,"A",{id:!0,class:!0,href:!0});var ns=s(ue);At=o(ns,"SPAN",{});var os=s(At);P(Me.$$.fragment,os),os.forEach(i),ns.forEach(i),ao=p(fi),jt=o(fi,"SPAN",{});var ss=s(jt);ro=r(ss,"ImagePipelineOutput"),ss.forEach(i),fi.forEach(i),Yt=r(t,`

By default diffusion pipelines return an object of class
`),G=o(t,"DIV",{class:!0});var ci=s(G);P(ze.$$.fragment,ci),lo=p(ci),Ot=o(ci,"P",{});var as=s(Ot);po=r(as,"Output class for image pipelines."),as.forEach(i),ci.forEach(i),Bt=p(t),R=o(t,"H2",{class:!0});var mi=s(R);he=o(mi,"A",{id:!0,class:!0,href:!0});var rs=s(he);St=o(rs,"SPAN",{});var ls=s(St);P(Xe.$$.fragment,ls),ls.forEach(i),rs.forEach(i),fo=p(mi),Tt=o(mi,"SPAN",{});var ds=s(Tt);co=r(ds,"AudioPipelineOutput"),ds.forEach(i),mi.forEach(i),Gt=r(t,`

By default diffusion pipelines return an object of class
`),J=o(t,"DIV",{class:!0});var ui=s(J);P(Ve.$$.fragment,ui),mo=p(ui),Lt=o(ui,"P",{});var ps=s(Lt);uo=r(ps,"Output class for audio pipelines."),ps.forEach(i),ui.forEach(i),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(Ps)),c(u,"id","pipelines"),c(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(u,"href","#pipelines"),c(m,"class","relative group"),c(M,"href","/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(z,"href","https://huggingface.co/models?library=diffusers"),c(z,"rel","nofollow"),c(He,"href","/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained"),c(Ye,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),c(Be,"href","/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.save_pretrained"),c(te,"id","diffusers.DiffusionPipeline"),c(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"),c(te,"href","#diffusers.DiffusionPipeline"),c(Y,"class","relative group"),c(Re,"href","/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ue,"id","diffusers.ImagePipelineOutput"),c(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"),c(ue,"href","#diffusers.ImagePipelineOutput"),c(B,"class","relative group"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(he,"id","diffusers.AudioPipelineOutput"),c(he,"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"),c(he,"href","#diffusers.AudioPipelineOutput"),c(R,"class","relative group"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,f),$(t,b,g),$(t,m,g),e(m,u),e(u,y),D(l,y,null),e(m,_),e(m,N),e(N,F),$(t,Q,g),$(t,T,g),e(T,U),e(T,M),e(M,H),e(T,O),e(T,z),e(z,Fe),e(T,Ue),$(t,ge,g),D(Z,t,g),$(t,Vt,g),$(t,A,g),e(A,gi),e(A,He),e(He,_i),e(A,vi),e(A,et),e(et,bi),e(A,$i),e(A,Ye),e(Ye,yi),e(A,wi),e(A,tt),e(tt,Pi),e(A,Di),e(A,it),e(it,Ei),e(A,xi),e(A,nt),e(nt,ki),e(A,Ii),$(t,Wt,g),$(t,ee,g),e(ee,Ai),e(ee,Be),e(Be,ji),e(ee,Oi),$(t,Ft,g),$(t,Y,g),e(Y,te),e(te,ot),D(_e,ot,null),e(Y,Si),e(Y,st),e(st,Ti),$(t,Ut,g),$(t,h,g),D(ve,h,null),e(h,Li),e(h,at),e(at,qi),e(h,Ci),e(h,Ge),e(Ge,Re),e(Re,Ni),e(Ge,Mi),e(h,zi),e(h,be),e(be,rt),e(rt,Xi),e(be,Vi),e(be,lt),e(lt,Wi),e(h,Fi),e(h,dt),e(dt,Ui),e(h,Hi),e(h,$e),e($e,ie),e(ie,pt),e(pt,Yi),e(ie,Bi),e(ie,ft),e(ft,Gi),e(ie,Ri),e($e,Ji),e($e,ne),e(ne,ct),e(ct,Ki),e(ne,Qi),e(ne,mt),e(mt,Zi),e(ne,en),e(h,tn),e(h,oe),D(ye,oe,null),e(oe,nn),e(oe,ut),e(ut,on),e(h,sn),e(h,Je),D(we,Je,null),e(h,an),e(h,Ke),D(Pe,Ke,null),e(h,rn),e(h,X),D(De,X,null),e(X,ln),e(X,Ee),e(Ee,dn),e(Ee,ht),e(ht,pn),e(Ee,fn),e(X,cn),D(se,X,null),e(h,mn),e(h,ae),D(xe,ae,null),e(ae,un),e(ae,ke),e(ke,hn),e(ke,gt),e(gt,gn),e(ke,_n),e(h,vn),e(h,re),D(Ie,re,null),e(re,bn),e(re,_t),e(_t,$n),e(h,yn),e(h,V),D(Ae,V,null),e(V,wn),e(V,vt),e(vt,Pn),e(V,Dn),e(V,bt),e(bt,En),e(h,xn),e(h,L),D(je,L,null),e(L,kn),e(L,$t),e($t,In),e(L,An),e(L,yt),e(yt,jn),e(L,On),e(L,wt),e(wt,Sn),e(L,Tn),D(le,L,null),e(h,Ln),e(h,I),D(Oe,I,null),e(I,qn),e(I,Pt),e(Pt,Cn),e(I,Nn),e(I,Se),e(Se,Mn),e(Se,Dt),e(Dt,zn),e(Se,Xn),e(I,Vn),e(I,Te),e(Te,Wn),e(Te,Et),e(Et,Fn),e(Te,Un),e(I,Hn),e(I,Le),e(Le,Yn),e(Le,xt),e(xt,Bn),e(Le,Gn),e(I,Rn),D(de,I,null),e(I,Jn),D(pe,I,null),e(I,Kn),D(fe,I,null),e(h,Qn),e(h,ce),D(qe,ce,null),e(ce,Zn),e(ce,kt),e(kt,eo),e(h,to),e(h,me),D(Ce,me,null),e(me,io),e(me,Ne),e(Ne,no),e(Ne,It),e(It,oo),e(Ne,so),$(t,Ht,g),$(t,B,g),e(B,ue),e(ue,At),D(Me,At,null),e(B,ao),e(B,jt),e(jt,ro),$(t,Yt,g),$(t,G,g),D(ze,G,null),e(G,lo),e(G,Ot),e(Ot,po),$(t,Bt,g),$(t,R,g),e(R,he),e(he,St),D(Xe,St,null),e(R,fo),e(R,Tt),e(Tt,co),$(t,Gt,g),$(t,J,g),D(Ve,J,null),e(J,mo),e(J,Lt),e(Lt,uo),Rt=!0},p(t,[g]){const We={};g&2&&(We.$$scope={dirty:g,ctx:t}),Z.$set(We);const qt={};g&2&&(qt.$$scope={dirty:g,ctx:t}),se.$set(qt);const Ct={};g&2&&(Ct.$$scope={dirty:g,ctx:t}),le.$set(Ct);const Nt={};g&2&&(Nt.$$scope={dirty:g,ctx:t}),de.$set(Nt);const K={};g&2&&(K.$$scope={dirty:g,ctx:t}),pe.$set(K);const Mt={};g&2&&(Mt.$$scope={dirty:g,ctx:t}),fe.$set(Mt)},i(t){Rt||(E(l.$$.fragment,t),E(Z.$$.fragment,t),E(_e.$$.fragment,t),E(ve.$$.fragment,t),E(ye.$$.fragment,t),E(we.$$.fragment,t),E(Pe.$$.fragment,t),E(De.$$.fragment,t),E(se.$$.fragment,t),E(xe.$$.fragment,t),E(Ie.$$.fragment,t),E(Ae.$$.fragment,t),E(je.$$.fragment,t),E(le.$$.fragment,t),E(Oe.$$.fragment,t),E(de.$$.fragment,t),E(pe.$$.fragment,t),E(fe.$$.fragment,t),E(qe.$$.fragment,t),E(Ce.$$.fragment,t),E(Me.$$.fragment,t),E(ze.$$.fragment,t),E(Xe.$$.fragment,t),E(Ve.$$.fragment,t),Rt=!0)},o(t){x(l.$$.fragment,t),x(Z.$$.fragment,t),x(_e.$$.fragment,t),x(ve.$$.fragment,t),x(ye.$$.fragment,t),x(we.$$.fragment,t),x(Pe.$$.fragment,t),x(De.$$.fragment,t),x(se.$$.fragment,t),x(xe.$$.fragment,t),x(Ie.$$.fragment,t),x(Ae.$$.fragment,t),x(je.$$.fragment,t),x(le.$$.fragment,t),x(Oe.$$.fragment,t),x(de.$$.fragment,t),x(pe.$$.fragment,t),x(fe.$$.fragment,t),x(qe.$$.fragment,t),x(Ce.$$.fragment,t),x(Me.$$.fragment,t),x(ze.$$.fragment,t),x(Xe.$$.fragment,t),x(Ve.$$.fragment,t),Rt=!1},d(t){i(f),t&&i(b),t&&i(m),k(l),t&&i(Q),t&&i(T),t&&i(ge),k(Z,t),t&&i(Vt),t&&i(A),t&&i(Wt),t&&i(ee),t&&i(Ft),t&&i(Y),k(_e),t&&i(Ut),t&&i(h),k(ve),k(ye),k(we),k(Pe),k(De),k(se),k(xe),k(Ie),k(Ae),k(je),k(le),k(Oe),k(de),k(pe),k(fe),k(qe),k(Ce),t&&i(Ht),t&&i(B),k(Me),t&&i(Yt),t&&i(G),k(ze),t&&i(Bt),t&&i(R),k(Xe),t&&i(Gt),t&&i(J),k(Ve)}}}const Ps={local:"pipelines",sections:[{local:"diffusers.DiffusionPipeline",title:"DiffusionPipeline"},{local:"diffusers.ImagePipelineOutput",title:"ImagePipelineOutput"},{local:"diffusers.AudioPipelineOutput",title:"AudioPipelineOutput"}],title:"Pipelines"};function Ds(S){return hs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Os extends fs{constructor(f){super();cs(this,f,Ds,ws,ms,{})}}export{Os as default,Ps as metadata};
