import{S as Cs,i as Js,s as Ls,e as a,k as l,w as v,t as o,M as Ns,c as s,d as i,m as d,a as n,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 Vs,L as Os}from"../../../chunks/vendor-hf-doc-builder.js";import{T as js}from"../../../chunks/Tip-hf-doc-builder.js";import{D as oe}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as qs}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ht}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Bs}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Zs(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=s(O,"P",{});var T=n(m);I=r(T,"Make sure to check out the Schedulers "),_=s(T,"A",{href:!0});var U=n(_);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=s(T,"A",{href:!0});var A=n(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 zs(Ee){let m,I,_,b,E;return b=new qs({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=s(u,"P",{});var $=n(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:Os,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 Fs(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,si,Dt,j,F,Re,de,ni,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,st,Vi,Oi,ue,ji,Ae,qi,Bi,Zi,nt,zi,Fi,k,Ge,Ce,Ri,Wi,Hi,Je,Le,Yi,Qi,Xi,Ne,Ve,Ki,ea,ta,Y,Oe,ia,aa,ot,sa,na,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 js({props:{$$slots:{default:[Zs]},$$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/img2img#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#L474",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#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/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Q=new Bs({props:{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.example",$$slots:{default:[zs]},$$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"),si=o(". \u2764\uFE0F"),Dt=l(),j=a("h2"),F=a("a"),Re=a("span"),v(de.$$.fragment),ni=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(),st=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(),nt=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"),sa=o(".ckpt"),na=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=Ns('[data-svelte="svelte-1phssyn"]',document.head);m=s(p,"META",{name:!0,content:!0}),p.forEach(i),I=d(t),_=s(t,"H1",{class:!0});var Se=n(_);b=s(Se,"A",{id:!0,class:!0,href:!0});var bt=n(b);E=s(bt,"SPAN",{});var Ba=n(E);w(u.$$.fragment,Ba),Ba.forEach(i),bt.forEach(i),$=d(Se),V=s(Se,"SPAN",{});var Za=n(V);O=r(Za,"Parallel Sampling of Diffusion Models"),Za.forEach(i),Se.forEach(i),T=d(t),U=s(t,"P",{});var Va=n(U);A=s(Va,"A",{href:!0,rel:!0});var za=n(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=s(t,"P",{});var Fa=n($e);Xt=r(Fa,"The abstract from the paper is:"),Fa.forEach(i),Pt=d(t),xe=s(t,"P",{});var Ra=n(xe);Fe=s(Ra,"EM",{});var Wa=n(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=s(t,"P",{});var je=n(G);ei=r(je,"The original codebase can be found at "),re=s(je,"A",{href:!0,rel:!0});var Ha=n(re);ti=r(Ha,"AndyShih12/paradigms"),Ha.forEach(i),ii=r(je,", and the pipeline was contributed by "),le=s(je,"A",{href:!0,rel:!0});var Ya=n(le);ai=r(Ya,"AndyShih12"),Ya.forEach(i),si=r(je,". \u2764\uFE0F"),je.forEach(i),Dt=d(t),j=s(t,"H2",{class:!0});var Ct=n(j);F=s(Ct,"A",{id:!0,class:!0,href:!0});var Qa=n(F);Re=s(Qa,"SPAN",{});var Xa=n(Re);w(de.$$.fragment,Xa),Xa.forEach(i),Qa.forEach(i),ni=d(Ct),We=s(Ct,"SPAN",{});var Ka=n(We);oi=r(Ka,"Tips"),Ka.forEach(i),Ct.forEach(i),St=d(t),Te=s(t,"P",{});var es=n(Te);ri=r(es,`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.`),es.forEach(i),Et=d(t),C=s(t,"P",{});var qe=n(C);li=r(qe,"The two parameters to play with are "),He=s(qe,"CODE",{});var ts=n(He);di=r(ts,"parallel"),ts.forEach(i),fi=r(qe," (batch size) and "),Ye=s(qe,"CODE",{});var is=n(Ye);pi=r(is,"tolerance"),is.forEach(i),ci=r(qe,"."),qe.forEach(i),$t=d(t),R=s(t,"UL",{});var Jt=n(R);q=s(Jt,"LI",{});var Be=n(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=s(Be,"CODE",{});var as=n(Qe);mi=r(as,"batch_per_device=12"),as.forEach(i),hi=r(Be," to get "),Xe=s(Be,"CODE",{});var ss=n(Xe);gi=r(ss,"parallel=96"),ss.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=s(Jt,"LI",{});var Lt=n(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=s(Lt,"CODE",{});var ns=n(Ke);wi=r(ns,"0.001"),ns.forEach(i),Pi=r(Lt,"."),Lt.forEach(i),Jt.forEach(i),xt=d(t),x=s(t,"P",{});var N=n(x);yi=r(N,"For a 1000-step DDPM on 8 A100 GPUs, you can expect around a 3x speedup from "),Ie=s(N,"A",{href:!0});var os=n(Ie);Di=r(os,"StableDiffusionParadigmsPipeline"),os.forEach(i),Si=r(N," compared to the "),ke=s(N,"A",{href:!0});var rs=n(ke);Ei=r(rs,"StableDiffusionPipeline"),rs.forEach(i),$i=r(N,`
by setting `),et=s(N,"CODE",{});var ls=n(et);xi=r(ls,"parallel=80"),ls.forEach(i),Ti=r(N," and "),tt=s(N,"CODE",{});var ds=n(tt);Ii=r(ds,"tolerance=0.1"),ds.forEach(i),ki=r(N,"."),N.forEach(i),Tt=d(t),J=s(t,"P",{});var Ze=n(J);Mi=r(Ze,"\u{1F917} Diffusers offers "),Me=s(Ze,"A",{href:!0});var fs=n(Me);Ui=r(fs,"distributed inference support"),fs.forEach(i),Ai=r(Ze,` for generating multiple prompts
in parallel on multiple GPUs. But `),Ue=s(Ze,"A",{href:!0});var ps=n(Ue);Gi=r(ps,"StableDiffusionParadigmsPipeline"),ps.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=s(t,"H2",{class:!0});var Nt=n(B);H=s(Nt,"A",{id:!0,class:!0,href:!0});var cs=n(H);it=s(cs,"SPAN",{});var us=n(it);w(pe.$$.fragment,us),us.forEach(i),cs.forEach(i),Ji=d(Nt),at=s(Nt,"SPAN",{});var ms=n(at);Li=r(ms,"StableDiffusionParadigmsPipeline"),ms.forEach(i),Nt.forEach(i),Mt=d(t),h=s(t,"DIV",{class:!0});var g=n(h);w(ce.$$.fragment,g),Ni=d(g),st=s(g,"P",{});var hs=n(st);Vi=r(hs,"Pipeline for text-to-image generation using a parallelized version of Stable Diffusion."),hs.forEach(i),Oi=d(g),ue=s(g,"P",{});var Vt=n(ue);ji=r(Vt,"This model inherits from "),Ae=s(Vt,"A",{href:!0});var gs=n(Ae);qi=r(gs,"DiffusionPipeline"),gs.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),nt=s(g,"P",{});var _s=n(nt);zi=r(_s,"The pipeline also inherits the following loading methods:"),_s.forEach(i),Fi=d(g),k=s(g,"UL",{});var se=n(k);Ge=s(se,"LI",{});var Oa=n(Ge);Ce=s(Oa,"A",{href:!0});var bs=n(Ce);Ri=r(bs,"load_textual_inversion()"),bs.forEach(i),Wi=r(Oa," for loading textual inversion embeddings"),Oa.forEach(i),Hi=d(se),Je=s(se,"LI",{});var ja=n(Je);Le=s(ja,"A",{href:!0});var vs=n(Le);Yi=r(vs,"load_lora_weights()"),vs.forEach(i),Qi=r(ja," for loading LoRA weights"),ja.forEach(i),Xi=d(se),Ne=s(se,"LI",{});var qa=n(Ne);Ve=s(qa,"A",{href:!0});var ws=n(Ve);Ki=r(ws,"save_lora_weights()"),ws.forEach(i),ea=r(qa," for saving LoRA weights"),qa.forEach(i),ta=d(se),Y=s(se,"LI",{});var vt=n(Y);Oe=s(vt,"A",{href:!0});var Ps=n(Oe);ia=r(Ps,"from_single_file()"),Ps.forEach(i),aa=r(vt," for loading "),ot=s(vt,"CODE",{});var ys=n(ot);sa=r(ys,".ckpt"),ys.forEach(i),na=r(vt," files"),vt.forEach(i),se.forEach(i),oa=d(g),L=s(g,"DIV",{class:!0});var ze=n(L);w(me.$$.fragment,ze),ra=d(ze),rt=s(ze,"P",{});var Ds=n(rt);la=r(Ds,"The call function to the pipeline for generation."),Ds.forEach(i),da=d(ze),w(Q.$$.fragment,ze),ze.forEach(i),fa=d(g),X=s(g,"DIV",{class:!0});var Ot=n(X);w(he.$$.fragment,Ot),pa=d(Ot),ge=s(Ot,"P",{});var jt=n(ge);ca=r(jt,"Disable sliced VAE decoding. If "),lt=s(jt,"CODE",{});var Ss=n(lt);ua=r(Ss,"enable_vae_slicing"),Ss.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=s(g,"DIV",{class:!0});var qt=n(K);w(_e.$$.fragment,qt),ga=d(qt),be=s(qt,"P",{});var Bt=n(be);_a=r(Bt,"Disable tiled VAE decoding. If "),dt=s(Bt,"CODE",{});var Es=n(dt);ba=r(Es,"enable_vae_tiling"),Es.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=s(g,"DIV",{class:!0});var Zt=n(ee);w(ve.$$.fragment,Zt),Pa=d(Zt),M=s(Zt,"P",{});var ne=n(M);ya=r(ne,`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=s(ne,"CODE",{});var $s=n(ft);Da=r($s,"forward"),$s.forEach(i),Sa=r(ne,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),pt=s(ne,"CODE",{});var xs=n(pt);Ea=r(xs,"enable_sequential_cpu_offload"),xs.forEach(i),$a=r(ne,`, but performance is much better due to the
iterative execution of the `),ct=s(ne,"CODE",{});var Ts=n(ct);xa=r(Ts,"unet"),Ts.forEach(i),Ta=r(ne,"."),ne.forEach(i),Zt.forEach(i),Ia=d(g),te=s(g,"DIV",{class:!0});var zt=n(te);w(we.$$.fragment,zt),ka=d(zt),ut=s(zt,"P",{});var Is=n(ut);Ma=r(Is,`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.`),Is.forEach(i),zt.forEach(i),Ua=d(g),ie=s(g,"DIV",{class:!0});var Ft=n(ie);w(Pe.$$.fragment,Ft),Aa=d(Ft),mt=s(Ft,"P",{});var ks=n(mt);Ga=r(ks,`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.`),ks.forEach(i),Ft.forEach(i),g.forEach(i),Ut=d(t),Z=s(t,"H2",{class:!0});var Rt=n(Z);ae=s(Rt,"A",{id:!0,class:!0,href:!0});var Ms=n(ae);ht=s(Ms,"SPAN",{});var Us=n(ht);w(ye.$$.fragment,Us),Us.forEach(i),Ms.forEach(i),Ca=d(Rt),gt=s(Rt,"SPAN",{});var As=n(gt);Ja=r(As,"StableDiffusionPipelineOutput"),As.forEach(i),Rt.forEach(i),At=d(t),z=s(t,"DIV",{class:!0});var Wt=n(z);w(De.$$.fragment,Wt),La=d(Wt),_t=s(Wt,"P",{});var Gs=n(_t);Na=r(Gs,"Output class for Stable Diffusion pipelines."),Gs.forEach(i),Wt.forEach(i),this.h()},h(){f(m,"name","hf:doc:metadata"),f(m,"content",JSON.stringify(Rs)),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/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),f(Le,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),f(Ve,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.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,si),c(t,Dt,p),c(t,j,p),e(j,F),e(F,Re),P(de,Re,null),e(j,ni),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,st),e(st,Vi),e(h,Oi),e(h,ue),e(ue,ji),e(ue,Ae),e(Ae,qi),e(ue,Bi),e(h,Zi),e(h,nt),e(nt,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,sa),e(Y,na),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 Rs={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 Ws(Ee){return Vs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tn extends Cs{constructor(m){super();Js(this,m,Ws,Fs,Ls,{})}}export{tn as default,Rs as metadata};
