import{S as Jn,i as Ln,s as Nn,e as a,k as l,w as v,t as o,M as Vn,c as n,d as i,m as d,a as s,x as w,h as r,b as f,G as e,g as c,y as P,q as y,o as D,B as S,v as On,L as jn}from"../../../chunks/vendor-hf-doc-builder.js";import{T as qn}from"../../../chunks/Tip-hf-doc-builder.js";import{D as oe}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Bn}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ht}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Zn}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function zn(Ee){let m,I,_,b,E,u,$,V;return{c(){m=a("p"),I=o("Make sure to check out the Schedulers "),_=a("a"),b=o("guide"),E=o(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),u=a("a"),$=o("reuse components across pipelines"),V=o(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(O){m=n(O,"P",{});var T=s(m);I=r(T,"Make sure to check out the Schedulers "),_=n(T,"A",{href:!0});var U=s(_);b=r(U,"guide"),U.forEach(i),E=r(T," to learn how to explore the tradeoff between scheduler speed and quality, and see the "),u=n(T,"A",{href:!0});var A=s(u);$=r(A,"reuse components across pipelines"),A.forEach(i),V=r(T," section to learn how to efficiently load the same components into multiple pipelines."),T.forEach(i),this.h()},h(){f(_,"href","/using-diffusers/schedulers"),f(u,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(O,T){c(O,m,T),e(m,I),e(m,_),e(_,b),e(m,E),e(m,u),e(u,$),e(m,V)},d(O){O&&i(m)}}}function Fn(Ee){let m,I,_,b,E;return b=new Bn({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRERQTVBhcmFsbGVsU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBhcmFkaWdtc1BpcGVsaW5lJTBBJTBBc2NoZWR1bGVyJTIwJTNEJTIwRERQTVBhcmFsbGVsU2NoZWR1bGVyLmZyb21fcHJldHJhaW5lZCglMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnNjaGVkdWxlciUyMiklMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGFyYWRpZ21zUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBbmdwdSUyQyUyMGJhdGNoX3Blcl9kZXZpY2UlMjAlM0QlMjB0b3JjaC5jdWRhLmRldmljZV9jb3VudCgpJTJDJTIwNSUwQXBpcGUud3JhcHBlZF91bmV0JTIwJTNEJTIwdG9yY2gubm4uRGF0YVBhcmFsbGVsKHBpcGUudW5ldCUyQyUyMGRldmljZV9pZHMlM0QlNUJkJTIwZm9yJTIwZCUyMGluJTIwcmFuZ2UobmdwdSklNUQpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMG9uJTIwbWFycyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBwYXJhbGxlbCUzRG5ncHUlMjAqJTIwYmF0Y2hfcGVyX2RldmljZSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QxMDAwKS5pbWFnZXMlNUIwJTVE",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> DDPMParallelScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionParadigmsPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionParadigmsPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, scheduler=scheduler, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<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>ngpu, batch_per_device = torch.cuda.device_count(), <span class="hljs-number">5</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.wrapped_unet = torch.nn.DataParallel(pipe.unet, device_ids=[d <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(ngpu)])

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt, parallel=ngpu * batch_per_device, num_inference_steps=<span class="hljs-number">1000</span>).images[<span class="hljs-number">0</span>]`}}),{c(){m=a("p"),I=o("Examples:"),_=l(),v(b.$$.fragment)},l(u){m=n(u,"P",{});var $=s(m);I=r($,"Examples:"),$.forEach(i),_=d(u),w(b.$$.fragment,u)},m(u,$){c(u,m,$),e(m,I),c(u,_,$),P(b,u,$),E=!0},p:jn,i(u){E||(y(b.$$.fragment,u),E=!0)},o(u){D(b.$$.fragment,u),E=!1},d(u){u&&i(m),u&&i(_),S(b,u)}}}function Rn(Ee){let m,I,_,b,E,u,$,V,O,T,U,A,Yt,Qt,wt,$e,Xt,Pt,xe,Fe,Kt,yt,G,ei,re,ti,ii,le,ai,ni,Dt,j,F,Re,de,si,We,oi,St,Te,ri,Et,C,li,He,di,fi,Ye,pi,ci,$t,R,q,ui,Qe,mi,hi,Xe,gi,_i,bi,fe,vi,Ke,wi,Pi,xt,x,yi,Ie,Di,Si,ke,Ei,$i,et,xi,Ti,tt,Ii,ki,Tt,J,Mi,Me,Ui,Ai,Ue,Gi,Ci,It,W,kt,B,H,it,pe,Ji,at,Li,Mt,h,ce,Ni,nt,Vi,Oi,ue,ji,Ae,qi,Bi,Zi,st,zi,Fi,k,Ge,Ce,Ri,Wi,Hi,Je,Le,Yi,Qi,Xi,Ne,Ve,Ki,ea,ta,Y,Oe,ia,aa,ot,na,sa,oa,L,me,ra,rt,la,da,Q,fa,X,he,pa,ge,ca,lt,ua,ma,ha,K,_e,ga,be,_a,dt,ba,va,wa,ee,ve,Pa,M,ya,ft,Da,Sa,pt,Ea,$a,ct,xa,Ta,Ia,te,we,ka,ut,Ma,Ua,ie,Pe,Aa,mt,Ga,Ut,Z,ae,ht,ye,Ca,gt,Ja,At,z,De,La,_t,Na,Gt;return u=new Ht({}),de=new Ht({}),W=new qn({props:{$$slots:{default:[zn]},$$scope:{ctx:Ee}}}),pe=new Ht({}),ce=new oe({props:{name:"class diffusers.StableDiffusionParadigmsPipeline",anchor:"diffusers.StableDiffusionParadigmsPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionParadigmsPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L62"}}),me=new oe({props:{name:"__call__",anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"parallel",val:": int = 10"},{name:"tolerance",val:": float = 0.1"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"debug",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.parallel",description:`<strong>parallel</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
The batch size to use when doing parallel sampling. More parallelism may lead to faster inference but
requires higher memory usage and can also require more total FLOPs.`,name:"parallel"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.tolerance",description:`<strong>tolerance</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The error tolerance for determining when to slide the batch window forward for parallel sampling. Lower
tolerance usually leads to less or no degradation. Higher tolerance is faster but can risk degradation
of sample quality. The tolerance is specified as a ratio of the scheduler&#x2019;s noise magnitude.`,name:"tolerance"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.debug",description:`<strong>debug</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to run in debug mode. In debug mode, <code>torch.cumsum</code> is evaluated using the CPU.`,name:"debug"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L467",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Q=new Zn({props:{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.example",$$slots:{default:[Fn]},$$scope:{ctx:Ee}}}),he=new oe({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionParadigmsPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L152"}}),_e=new oe({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionParadigmsPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L169"}}),ve=new oe({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionParadigmsPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L177"}}),we=new oe({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionParadigmsPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L144"}}),Pe=new oe({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionParadigmsPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L160"}}),ye=new Ht({}),De=new oe({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.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>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),{c(){m=a("meta"),I=l(),_=a("h1"),b=a("a"),E=a("span"),v(u.$$.fragment),$=l(),V=a("span"),O=o("Parallel Sampling of Diffusion Models"),T=l(),U=a("p"),A=a("a"),Yt=o("Parallel Sampling of Diffusion Models"),Qt=o(" is by Andy Shih, Suneel Belkhale, Stefano Ermon, Dorsa Sadigh, Nima Anari."),wt=l(),$e=a("p"),Xt=o("The abstract from the paper is:"),Pt=l(),xe=a("p"),Fe=a("em"),Kt=o("Diffusion models are powerful generative models but suffer from slow sampling, often taking 1000 sequential denoising steps for one sample. As a result, considerable efforts have been directed toward reducing the number of denoising steps, but these methods hurt sample quality. Instead of reducing the number of denoising steps (trading quality for speed), in this paper we explore an orthogonal approach: can we run the denoising steps in parallel (trading compute for speed)? In spite of the sequential nature of the denoising steps, we show that surprisingly it is possible to parallelize sampling via Picard iterations, by guessing the solution of future denoising steps and iteratively refining until convergence. With this insight, we present ParaDiGMS, a novel method to accelerate the sampling of pretrained diffusion models by denoising multiple steps in parallel. ParaDiGMS is the first diffusion sampling method that enables trading compute for speed and is even compatible with existing fast sampling techniques such as DDIM and DPMSolver. Using ParaDiGMS, we improve sampling speed by 2-4x across a range of robotics and image generation models, giving state-of-the-art sampling speeds of 0.2s on 100-step DiffusionPolicy and 16s on 1000-step StableDiffusion-v2 with no measurable degradation of task reward, FID score, or CLIP score."),yt=l(),G=a("p"),ei=o("The original codebase can be found at "),re=a("a"),ti=o("AndyShih12/paradigms"),ii=o(", and the pipeline was contributed by "),le=a("a"),ai=o("AndyShih12"),ni=o(". \u2764\uFE0F"),Dt=l(),j=a("h2"),F=a("a"),Re=a("span"),v(de.$$.fragment),si=l(),We=a("span"),oi=o("Tips"),St=l(),Te=a("p"),ri=o(`This pipeline improves sampling speed by running denoising steps in parallel, at the cost of increased total FLOPs.
Therefore, it is better to call this pipeline when running on multiple GPUs. Otherwise, without enough GPU bandwidth
sampling may be even slower than sequential sampling.`),Et=l(),C=a("p"),li=o("The two parameters to play with are "),He=a("code"),di=o("parallel"),fi=o(" (batch size) and "),Ye=a("code"),pi=o("tolerance"),ci=o("."),$t=l(),R=a("ul"),q=a("li"),ui=o(`If it fits in memory, for a 1000-step DDPM you can aim for a batch size of around 100
(for example, 8 GPUs and `),Qe=a("code"),mi=o("batch_per_device=12"),hi=o(" to get "),Xe=a("code"),gi=o("parallel=96"),_i=o(`). A higher batch size
may not fit in memory, and lower batch size gives less parallelism.`),bi=l(),fe=a("li"),vi=o(`For tolerance, using a higher tolerance may get better speedups but can risk sample quality degradation.
If there is quality degradation with the default tolerance, then use a lower tolerance like `),Ke=a("code"),wi=o("0.001"),Pi=o("."),xt=l(),x=a("p"),yi=o("For a 1000-step DDPM on 8 A100 GPUs, you can expect around a 3x speedup from "),Ie=a("a"),Di=o("StableDiffusionParadigmsPipeline"),Si=o(" compared to the "),ke=a("a"),Ei=o("StableDiffusionPipeline"),$i=o(`
by setting `),et=a("code"),xi=o("parallel=80"),Ti=o(" and "),tt=a("code"),Ii=o("tolerance=0.1"),ki=o("."),Tt=l(),J=a("p"),Mi=o("\u{1F917} Diffusers offers "),Me=a("a"),Ui=o("distributed inference support"),Ai=o(` for generating multiple prompts
in parallel on multiple GPUs. But `),Ue=a("a"),Gi=o("StableDiffusionParadigmsPipeline"),Ci=o(" is designed for speeding up sampling of a single prompt by using multiple GPUs."),It=l(),v(W.$$.fragment),kt=l(),B=a("h2"),H=a("a"),it=a("span"),v(pe.$$.fragment),Ji=l(),at=a("span"),Li=o("StableDiffusionParadigmsPipeline"),Mt=l(),h=a("div"),v(ce.$$.fragment),Ni=l(),nt=a("p"),Vi=o("Pipeline for text-to-image generation using a parallelized version of Stable Diffusion."),Oi=l(),ue=a("p"),ji=o("This model inherits from "),Ae=a("a"),qi=o("DiffusionPipeline"),Bi=o(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Zi=l(),st=a("p"),zi=o("The pipeline also inherits the following loading methods:"),Fi=l(),k=a("ul"),Ge=a("li"),Ce=a("a"),Ri=o("load_textual_inversion()"),Wi=o(" for loading textual inversion embeddings"),Hi=l(),Je=a("li"),Le=a("a"),Yi=o("load_lora_weights()"),Qi=o(" for loading LoRA weights"),Xi=l(),Ne=a("li"),Ve=a("a"),Ki=o("save_lora_weights()"),ea=o(" for saving LoRA weights"),ta=l(),Y=a("li"),Oe=a("a"),ia=o("from_single_file()"),aa=o(" for loading "),ot=a("code"),na=o(".ckpt"),sa=o(" files"),oa=l(),L=a("div"),v(me.$$.fragment),ra=l(),rt=a("p"),la=o("The call function to the pipeline for generation."),da=l(),v(Q.$$.fragment),fa=l(),X=a("div"),v(he.$$.fragment),pa=l(),ge=a("p"),ca=o("Disable sliced VAE decoding. If "),lt=a("code"),ua=o("enable_vae_slicing"),ma=o(` was previously enabled, this method will go back to
computing decoding in one step.`),ha=l(),K=a("div"),v(_e.$$.fragment),ga=l(),be=a("p"),_a=o("Disable tiled VAE decoding. If "),dt=a("code"),ba=o("enable_vae_tiling"),va=o(` was previously enabled, this method will go back to
computing decoding in one step.`),wa=l(),ee=a("div"),v(ve.$$.fragment),Pa=l(),M=a("p"),ya=o(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),ft=a("code"),Da=o("forward"),Sa=o(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),pt=a("code"),Ea=o("enable_sequential_cpu_offload"),$a=o(`, but performance is much better due to the
iterative execution of the `),ct=a("code"),xa=o("unet"),Ta=o("."),Ia=l(),te=a("div"),v(we.$$.fragment),ka=l(),ut=a("p"),Ma=o(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Ua=l(),ie=a("div"),v(Pe.$$.fragment),Aa=l(),mt=a("p"),Ga=o(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Ut=l(),Z=a("h2"),ae=a("a"),ht=a("span"),v(ye.$$.fragment),Ca=l(),gt=a("span"),Ja=o("StableDiffusionPipelineOutput"),At=l(),z=a("div"),v(De.$$.fragment),La=l(),_t=a("p"),Na=o("Output class for Stable Diffusion pipelines."),this.h()},l(t){const p=Vn('[data-svelte="svelte-1phssyn"]',document.head);m=n(p,"META",{name:!0,content:!0}),p.forEach(i),I=d(t),_=n(t,"H1",{class:!0});var Se=s(_);b=n(Se,"A",{id:!0,class:!0,href:!0});var bt=s(b);E=n(bt,"SPAN",{});var Ba=s(E);w(u.$$.fragment,Ba),Ba.forEach(i),bt.forEach(i),$=d(Se),V=n(Se,"SPAN",{});var Za=s(V);O=r(Za,"Parallel Sampling of Diffusion Models"),Za.forEach(i),Se.forEach(i),T=d(t),U=n(t,"P",{});var Va=s(U);A=n(Va,"A",{href:!0,rel:!0});var za=s(A);Yt=r(za,"Parallel Sampling of Diffusion Models"),za.forEach(i),Qt=r(Va," is by Andy Shih, Suneel Belkhale, Stefano Ermon, Dorsa Sadigh, Nima Anari."),Va.forEach(i),wt=d(t),$e=n(t,"P",{});var Fa=s($e);Xt=r(Fa,"The abstract from the paper is:"),Fa.forEach(i),Pt=d(t),xe=n(t,"P",{});var Ra=s(xe);Fe=n(Ra,"EM",{});var Wa=s(Fe);Kt=r(Wa,"Diffusion models are powerful generative models but suffer from slow sampling, often taking 1000 sequential denoising steps for one sample. As a result, considerable efforts have been directed toward reducing the number of denoising steps, but these methods hurt sample quality. Instead of reducing the number of denoising steps (trading quality for speed), in this paper we explore an orthogonal approach: can we run the denoising steps in parallel (trading compute for speed)? In spite of the sequential nature of the denoising steps, we show that surprisingly it is possible to parallelize sampling via Picard iterations, by guessing the solution of future denoising steps and iteratively refining until convergence. With this insight, we present ParaDiGMS, a novel method to accelerate the sampling of pretrained diffusion models by denoising multiple steps in parallel. ParaDiGMS is the first diffusion sampling method that enables trading compute for speed and is even compatible with existing fast sampling techniques such as DDIM and DPMSolver. Using ParaDiGMS, we improve sampling speed by 2-4x across a range of robotics and image generation models, giving state-of-the-art sampling speeds of 0.2s on 100-step DiffusionPolicy and 16s on 1000-step StableDiffusion-v2 with no measurable degradation of task reward, FID score, or CLIP score."),Wa.forEach(i),Ra.forEach(i),yt=d(t),G=n(t,"P",{});var je=s(G);ei=r(je,"The original codebase can be found at "),re=n(je,"A",{href:!0,rel:!0});var Ha=s(re);ti=r(Ha,"AndyShih12/paradigms"),Ha.forEach(i),ii=r(je,", and the pipeline was contributed by "),le=n(je,"A",{href:!0,rel:!0});var Ya=s(le);ai=r(Ya,"AndyShih12"),Ya.forEach(i),ni=r(je,". \u2764\uFE0F"),je.forEach(i),Dt=d(t),j=n(t,"H2",{class:!0});var Ct=s(j);F=n(Ct,"A",{id:!0,class:!0,href:!0});var Qa=s(F);Re=n(Qa,"SPAN",{});var Xa=s(Re);w(de.$$.fragment,Xa),Xa.forEach(i),Qa.forEach(i),si=d(Ct),We=n(Ct,"SPAN",{});var Ka=s(We);oi=r(Ka,"Tips"),Ka.forEach(i),Ct.forEach(i),St=d(t),Te=n(t,"P",{});var en=s(Te);ri=r(en,`This pipeline improves sampling speed by running denoising steps in parallel, at the cost of increased total FLOPs.
Therefore, it is better to call this pipeline when running on multiple GPUs. Otherwise, without enough GPU bandwidth
sampling may be even slower than sequential sampling.`),en.forEach(i),Et=d(t),C=n(t,"P",{});var qe=s(C);li=r(qe,"The two parameters to play with are "),He=n(qe,"CODE",{});var tn=s(He);di=r(tn,"parallel"),tn.forEach(i),fi=r(qe," (batch size) and "),Ye=n(qe,"CODE",{});var an=s(Ye);pi=r(an,"tolerance"),an.forEach(i),ci=r(qe,"."),qe.forEach(i),$t=d(t),R=n(t,"UL",{});var Jt=s(R);q=n(Jt,"LI",{});var Be=s(q);ui=r(Be,`If it fits in memory, for a 1000-step DDPM you can aim for a batch size of around 100
(for example, 8 GPUs and `),Qe=n(Be,"CODE",{});var nn=s(Qe);mi=r(nn,"batch_per_device=12"),nn.forEach(i),hi=r(Be," to get "),Xe=n(Be,"CODE",{});var sn=s(Xe);gi=r(sn,"parallel=96"),sn.forEach(i),_i=r(Be,`). A higher batch size
may not fit in memory, and lower batch size gives less parallelism.`),Be.forEach(i),bi=d(Jt),fe=n(Jt,"LI",{});var Lt=s(fe);vi=r(Lt,`For tolerance, using a higher tolerance may get better speedups but can risk sample quality degradation.
If there is quality degradation with the default tolerance, then use a lower tolerance like `),Ke=n(Lt,"CODE",{});var on=s(Ke);wi=r(on,"0.001"),on.forEach(i),Pi=r(Lt,"."),Lt.forEach(i),Jt.forEach(i),xt=d(t),x=n(t,"P",{});var N=s(x);yi=r(N,"For a 1000-step DDPM on 8 A100 GPUs, you can expect around a 3x speedup from "),Ie=n(N,"A",{href:!0});var rn=s(Ie);Di=r(rn,"StableDiffusionParadigmsPipeline"),rn.forEach(i),Si=r(N," compared to the "),ke=n(N,"A",{href:!0});var ln=s(ke);Ei=r(ln,"StableDiffusionPipeline"),ln.forEach(i),$i=r(N,`
by setting `),et=n(N,"CODE",{});var dn=s(et);xi=r(dn,"parallel=80"),dn.forEach(i),Ti=r(N," and "),tt=n(N,"CODE",{});var fn=s(tt);Ii=r(fn,"tolerance=0.1"),fn.forEach(i),ki=r(N,"."),N.forEach(i),Tt=d(t),J=n(t,"P",{});var Ze=s(J);Mi=r(Ze,"\u{1F917} Diffusers offers "),Me=n(Ze,"A",{href:!0});var pn=s(Me);Ui=r(pn,"distributed inference support"),pn.forEach(i),Ai=r(Ze,` for generating multiple prompts
in parallel on multiple GPUs. But `),Ue=n(Ze,"A",{href:!0});var cn=s(Ue);Gi=r(cn,"StableDiffusionParadigmsPipeline"),cn.forEach(i),Ci=r(Ze," is designed for speeding up sampling of a single prompt by using multiple GPUs."),Ze.forEach(i),It=d(t),w(W.$$.fragment,t),kt=d(t),B=n(t,"H2",{class:!0});var Nt=s(B);H=n(Nt,"A",{id:!0,class:!0,href:!0});var un=s(H);it=n(un,"SPAN",{});var mn=s(it);w(pe.$$.fragment,mn),mn.forEach(i),un.forEach(i),Ji=d(Nt),at=n(Nt,"SPAN",{});var hn=s(at);Li=r(hn,"StableDiffusionParadigmsPipeline"),hn.forEach(i),Nt.forEach(i),Mt=d(t),h=n(t,"DIV",{class:!0});var g=s(h);w(ce.$$.fragment,g),Ni=d(g),nt=n(g,"P",{});var gn=s(nt);Vi=r(gn,"Pipeline for text-to-image generation using a parallelized version of Stable Diffusion."),gn.forEach(i),Oi=d(g),ue=n(g,"P",{});var Vt=s(ue);ji=r(Vt,"This model inherits from "),Ae=n(Vt,"A",{href:!0});var _n=s(Ae);qi=r(_n,"DiffusionPipeline"),_n.forEach(i),Bi=r(Vt,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Vt.forEach(i),Zi=d(g),st=n(g,"P",{});var bn=s(st);zi=r(bn,"The pipeline also inherits the following loading methods:"),bn.forEach(i),Fi=d(g),k=n(g,"UL",{});var ne=s(k);Ge=n(ne,"LI",{});var Oa=s(Ge);Ce=n(Oa,"A",{href:!0});var vn=s(Ce);Ri=r(vn,"load_textual_inversion()"),vn.forEach(i),Wi=r(Oa," for loading textual inversion embeddings"),Oa.forEach(i),Hi=d(ne),Je=n(ne,"LI",{});var ja=s(Je);Le=n(ja,"A",{href:!0});var wn=s(Le);Yi=r(wn,"load_lora_weights()"),wn.forEach(i),Qi=r(ja," for loading LoRA weights"),ja.forEach(i),Xi=d(ne),Ne=n(ne,"LI",{});var qa=s(Ne);Ve=n(qa,"A",{href:!0});var Pn=s(Ve);Ki=r(Pn,"save_lora_weights()"),Pn.forEach(i),ea=r(qa," for saving LoRA weights"),qa.forEach(i),ta=d(ne),Y=n(ne,"LI",{});var vt=s(Y);Oe=n(vt,"A",{href:!0});var yn=s(Oe);ia=r(yn,"from_single_file()"),yn.forEach(i),aa=r(vt," for loading "),ot=n(vt,"CODE",{});var Dn=s(ot);na=r(Dn,".ckpt"),Dn.forEach(i),sa=r(vt," files"),vt.forEach(i),ne.forEach(i),oa=d(g),L=n(g,"DIV",{class:!0});var ze=s(L);w(me.$$.fragment,ze),ra=d(ze),rt=n(ze,"P",{});var Sn=s(rt);la=r(Sn,"The call function to the pipeline for generation."),Sn.forEach(i),da=d(ze),w(Q.$$.fragment,ze),ze.forEach(i),fa=d(g),X=n(g,"DIV",{class:!0});var Ot=s(X);w(he.$$.fragment,Ot),pa=d(Ot),ge=n(Ot,"P",{});var jt=s(ge);ca=r(jt,"Disable sliced VAE decoding. If "),lt=n(jt,"CODE",{});var En=s(lt);ua=r(En,"enable_vae_slicing"),En.forEach(i),ma=r(jt,` was previously enabled, this method will go back to
computing decoding in one step.`),jt.forEach(i),Ot.forEach(i),ha=d(g),K=n(g,"DIV",{class:!0});var qt=s(K);w(_e.$$.fragment,qt),ga=d(qt),be=n(qt,"P",{});var Bt=s(be);_a=r(Bt,"Disable tiled VAE decoding. If "),dt=n(Bt,"CODE",{});var $n=s(dt);ba=r($n,"enable_vae_tiling"),$n.forEach(i),va=r(Bt,` was previously enabled, this method will go back to
computing decoding in one step.`),Bt.forEach(i),qt.forEach(i),wa=d(g),ee=n(g,"DIV",{class:!0});var Zt=s(ee);w(ve.$$.fragment,Zt),Pa=d(Zt),M=n(Zt,"P",{});var se=s(M);ya=r(se,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),ft=n(se,"CODE",{});var xn=s(ft);Da=r(xn,"forward"),xn.forEach(i),Sa=r(se,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),pt=n(se,"CODE",{});var Tn=s(pt);Ea=r(Tn,"enable_sequential_cpu_offload"),Tn.forEach(i),$a=r(se,`, but performance is much better due to the
iterative execution of the `),ct=n(se,"CODE",{});var In=s(ct);xa=r(In,"unet"),In.forEach(i),Ta=r(se,"."),se.forEach(i),Zt.forEach(i),Ia=d(g),te=n(g,"DIV",{class:!0});var zt=s(te);w(we.$$.fragment,zt),ka=d(zt),ut=n(zt,"P",{});var kn=s(ut);Ma=r(kn,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),kn.forEach(i),zt.forEach(i),Ua=d(g),ie=n(g,"DIV",{class:!0});var Ft=s(ie);w(Pe.$$.fragment,Ft),Aa=d(Ft),mt=n(Ft,"P",{});var Mn=s(mt);Ga=r(Mn,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Mn.forEach(i),Ft.forEach(i),g.forEach(i),Ut=d(t),Z=n(t,"H2",{class:!0});var Rt=s(Z);ae=n(Rt,"A",{id:!0,class:!0,href:!0});var Un=s(ae);ht=n(Un,"SPAN",{});var An=s(ht);w(ye.$$.fragment,An),An.forEach(i),Un.forEach(i),Ca=d(Rt),gt=n(Rt,"SPAN",{});var Gn=s(gt);Ja=r(Gn,"StableDiffusionPipelineOutput"),Gn.forEach(i),Rt.forEach(i),At=d(t),z=n(t,"DIV",{class:!0});var Wt=s(z);w(De.$$.fragment,Wt),La=d(Wt),_t=n(Wt,"P",{});var Cn=s(_t);Na=r(Cn,"Output class for Stable Diffusion pipelines."),Cn.forEach(i),Wt.forEach(i),this.h()},h(){f(m,"name","hf:doc:metadata"),f(m,"content",JSON.stringify(Wn)),f(b,"id","parallel-sampling-of-diffusion-models"),f(b,"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"),f(b,"href","#parallel-sampling-of-diffusion-models"),f(_,"class","relative group"),f(A,"href","https://huggingface.co/papers/2305.16317"),f(A,"rel","nofollow"),f(re,"href","https://github.com/AndyShih12/paradigms"),f(re,"rel","nofollow"),f(le,"href","https://github.com/AndyShih12"),f(le,"rel","nofollow"),f(F,"id","tips"),f(F,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(F,"href","#tips"),f(j,"class","relative group"),f(Ie,"href","/docs/diffusers/main/en/api/pipelines/paradigms#diffusers.StableDiffusionParadigmsPipeline"),f(ke,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),f(Me,"href","../training/distributed_inference"),f(Ue,"href","/docs/diffusers/main/en/api/pipelines/paradigms#diffusers.StableDiffusionParadigmsPipeline"),f(H,"id","diffusers.StableDiffusionParadigmsPipeline"),f(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"),f(H,"href","#diffusers.StableDiffusionParadigmsPipeline"),f(B,"class","relative group"),f(Ae,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),f(Ce,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),f(Le,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_lora_weights"),f(Ve,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.save_lora_weights"),f(Oe,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),f(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ae,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),f(ae,"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"),f(ae,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),f(Z,"class","relative group"),f(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,p){e(document.head,m),c(t,I,p),c(t,_,p),e(_,b),e(b,E),P(u,E,null),e(_,$),e(_,V),e(V,O),c(t,T,p),c(t,U,p),e(U,A),e(A,Yt),e(U,Qt),c(t,wt,p),c(t,$e,p),e($e,Xt),c(t,Pt,p),c(t,xe,p),e(xe,Fe),e(Fe,Kt),c(t,yt,p),c(t,G,p),e(G,ei),e(G,re),e(re,ti),e(G,ii),e(G,le),e(le,ai),e(G,ni),c(t,Dt,p),c(t,j,p),e(j,F),e(F,Re),P(de,Re,null),e(j,si),e(j,We),e(We,oi),c(t,St,p),c(t,Te,p),e(Te,ri),c(t,Et,p),c(t,C,p),e(C,li),e(C,He),e(He,di),e(C,fi),e(C,Ye),e(Ye,pi),e(C,ci),c(t,$t,p),c(t,R,p),e(R,q),e(q,ui),e(q,Qe),e(Qe,mi),e(q,hi),e(q,Xe),e(Xe,gi),e(q,_i),e(R,bi),e(R,fe),e(fe,vi),e(fe,Ke),e(Ke,wi),e(fe,Pi),c(t,xt,p),c(t,x,p),e(x,yi),e(x,Ie),e(Ie,Di),e(x,Si),e(x,ke),e(ke,Ei),e(x,$i),e(x,et),e(et,xi),e(x,Ti),e(x,tt),e(tt,Ii),e(x,ki),c(t,Tt,p),c(t,J,p),e(J,Mi),e(J,Me),e(Me,Ui),e(J,Ai),e(J,Ue),e(Ue,Gi),e(J,Ci),c(t,It,p),P(W,t,p),c(t,kt,p),c(t,B,p),e(B,H),e(H,it),P(pe,it,null),e(B,Ji),e(B,at),e(at,Li),c(t,Mt,p),c(t,h,p),P(ce,h,null),e(h,Ni),e(h,nt),e(nt,Vi),e(h,Oi),e(h,ue),e(ue,ji),e(ue,Ae),e(Ae,qi),e(ue,Bi),e(h,Zi),e(h,st),e(st,zi),e(h,Fi),e(h,k),e(k,Ge),e(Ge,Ce),e(Ce,Ri),e(Ge,Wi),e(k,Hi),e(k,Je),e(Je,Le),e(Le,Yi),e(Je,Qi),e(k,Xi),e(k,Ne),e(Ne,Ve),e(Ve,Ki),e(Ne,ea),e(k,ta),e(k,Y),e(Y,Oe),e(Oe,ia),e(Y,aa),e(Y,ot),e(ot,na),e(Y,sa),e(h,oa),e(h,L),P(me,L,null),e(L,ra),e(L,rt),e(rt,la),e(L,da),P(Q,L,null),e(h,fa),e(h,X),P(he,X,null),e(X,pa),e(X,ge),e(ge,ca),e(ge,lt),e(lt,ua),e(ge,ma),e(h,ha),e(h,K),P(_e,K,null),e(K,ga),e(K,be),e(be,_a),e(be,dt),e(dt,ba),e(be,va),e(h,wa),e(h,ee),P(ve,ee,null),e(ee,Pa),e(ee,M),e(M,ya),e(M,ft),e(ft,Da),e(M,Sa),e(M,pt),e(pt,Ea),e(M,$a),e(M,ct),e(ct,xa),e(M,Ta),e(h,Ia),e(h,te),P(we,te,null),e(te,ka),e(te,ut),e(ut,Ma),e(h,Ua),e(h,ie),P(Pe,ie,null),e(ie,Aa),e(ie,mt),e(mt,Ga),c(t,Ut,p),c(t,Z,p),e(Z,ae),e(ae,ht),P(ye,ht,null),e(Z,Ca),e(Z,gt),e(gt,Ja),c(t,At,p),c(t,z,p),P(De,z,null),e(z,La),e(z,_t),e(_t,Na),Gt=!0},p(t,[p]){const Se={};p&2&&(Se.$$scope={dirty:p,ctx:t}),W.$set(Se);const bt={};p&2&&(bt.$$scope={dirty:p,ctx:t}),Q.$set(bt)},i(t){Gt||(y(u.$$.fragment,t),y(de.$$.fragment,t),y(W.$$.fragment,t),y(pe.$$.fragment,t),y(ce.$$.fragment,t),y(me.$$.fragment,t),y(Q.$$.fragment,t),y(he.$$.fragment,t),y(_e.$$.fragment,t),y(ve.$$.fragment,t),y(we.$$.fragment,t),y(Pe.$$.fragment,t),y(ye.$$.fragment,t),y(De.$$.fragment,t),Gt=!0)},o(t){D(u.$$.fragment,t),D(de.$$.fragment,t),D(W.$$.fragment,t),D(pe.$$.fragment,t),D(ce.$$.fragment,t),D(me.$$.fragment,t),D(Q.$$.fragment,t),D(he.$$.fragment,t),D(_e.$$.fragment,t),D(ve.$$.fragment,t),D(we.$$.fragment,t),D(Pe.$$.fragment,t),D(ye.$$.fragment,t),D(De.$$.fragment,t),Gt=!1},d(t){i(m),t&&i(I),t&&i(_),S(u),t&&i(T),t&&i(U),t&&i(wt),t&&i($e),t&&i(Pt),t&&i(xe),t&&i(yt),t&&i(G),t&&i(Dt),t&&i(j),S(de),t&&i(St),t&&i(Te),t&&i(Et),t&&i(C),t&&i($t),t&&i(R),t&&i(xt),t&&i(x),t&&i(Tt),t&&i(J),t&&i(It),S(W,t),t&&i(kt),t&&i(B),S(pe),t&&i(Mt),t&&i(h),S(ce),S(me),S(Q),S(he),S(_e),S(ve),S(we),S(Pe),t&&i(Ut),t&&i(Z),S(ye),t&&i(At),t&&i(z),S(De)}}}const Wn={local:"parallel-sampling-of-diffusion-models",sections:[{local:"tips",title:"Tips"},{local:"diffusers.StableDiffusionParadigmsPipeline",title:"StableDiffusionParadigmsPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"}],title:"Parallel Sampling of Diffusion Models"};function Hn(Ee){return On(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class is extends Jn{constructor(m){super();Ln(this,m,Hn,Rn,Nn,{})}}export{is as default,Wn as metadata};
