import{S as Ss,i as $s,s as Es,e as n,k as l,w as v,t as o,M as xs,c as s,d as i,m as d,a,x as P,h as r,b as p,G as e,g as c,y as w,q as y,o as D,B as S,v as Ts,L as Is}from"../../../chunks/vendor-hf-doc-builder.js";import{T as ks}from"../../../chunks/Tip-hf-doc-builder.js";import{D as se}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Ms}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ft}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as As}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Us(De){let m,I,_,b,$,u,E,N;return{c(){m=n("p"),I=o("Make sure to check out the Schedulers "),_=n("a"),b=o("guide"),$=o(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),u=n("a"),E=o("reuse components across pipelines"),N=o(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(V){m=s(V,"P",{});var T=a(m);I=r(T,"Make sure to check out the Schedulers "),_=s(T,"A",{href:!0});var M=a(_);b=r(M,"guide"),M.forEach(i),$=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=a(u);E=r(A,"reuse components across pipelines"),A.forEach(i),N=r(T," section to learn how to efficiently load the same components into multiple pipelines."),T.forEach(i),this.h()},h(){p(_,"href","/using-diffusers/schedulers"),p(u,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(V,T){c(V,m,T),e(m,I),e(m,_),e(_,b),e(m,$),e(m,u),e(u,E),e(m,N)},d(V){V&&i(m)}}}function Js(De){let m,I,_,b,$;return b=new Ms({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=n("p"),I=o("Examples:"),_=l(),v(b.$$.fragment)},l(u){m=s(u,"P",{});var E=a(m);I=r(E,"Examples:"),E.forEach(i),_=d(u),P(b.$$.fragment,u)},m(u,E){c(u,m,E),e(m,I),c(u,_,E),w(b,u,E),$=!0},p:Is,i(u){$||(y(b.$$.fragment,u),$=!0)},o(u){D(b.$$.fragment,u),$=!1},d(u){u&&i(m),u&&i(_),S(b,u)}}}function Gs(De){let m,I,_,b,$,u,E,N,V,T,M,A,Rt,zt,ht,Se,Wt,_t,$e,qe,Ht,bt,U,Yt,ae,Qt,Xt,oe,Kt,ei,vt,j,F,Fe,re,ti,Re,ii,Pt,Ee,ni,wt,J,si,ze,ai,oi,We,ri,li,yt,R,O,di,He,pi,fi,Ye,ci,ui,mi,le,gi,Qe,hi,_i,Dt,x,bi,xe,vi,Pi,Te,wi,yi,Xe,Di,Si,Ke,$i,Ei,St,G,xi,Ie,Ti,Ii,ke,ki,Mi,$t,z,Et,B,W,et,de,Ai,tt,Ui,xt,g,pe,Ji,it,Gi,Li,fe,Ci,Me,Ni,Vi,ji,nt,Oi,Bi,k,Ae,Ue,Zi,qi,Fi,Je,Ge,Ri,zi,Wi,Le,Ce,Hi,Yi,Qi,H,Ne,Xi,Ki,st,en,tn,nn,L,ce,sn,at,an,on,Y,rn,Q,ue,ln,me,dn,ot,pn,fn,cn,X,ge,un,he,mn,rt,gn,hn,_n,K,_e,bn,lt,vn,Pn,ee,be,wn,dt,yn,Dn,te,ve,Sn,pt,$n,Tt,Z,ie,ft,Pe,En,ct,xn,It,q,we,Tn,ut,In,kt;return u=new Ft({}),re=new Ft({}),z=new ks({props:{$$slots:{default:[Us]},$$scope:{ctx:De}}}),de=new Ft({}),pe=new se({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/v0.21.0/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> (<code>CLIPTextModel</code>) &#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> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/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/v0.21.0/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/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/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> (<code>CLIPImageProcessor</code>) &#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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L62"}}),ce=new se({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[str, typing.List[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/v0.21.0/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/v0.21.0/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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L476",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/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/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Y=new As({props:{anchor:"diffusers.StableDiffusionParadigmsPipeline.__call__.example",$$slots:{default:[Js]},$$scope:{ctx:De}}}),ue=new se({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionParadigmsPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L154"}}),ge=new se({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionParadigmsPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L171"}}),_e=new se({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionParadigmsPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L146"}}),be=new se({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionParadigmsPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L162"}}),ve=new se({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt.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, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt.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, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionParadigmsPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py#L210"}}),Pe=new Ft({}),we=new se({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/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L15"}}),{c(){m=n("meta"),I=l(),_=n("h1"),b=n("a"),$=n("span"),v(u.$$.fragment),E=l(),N=n("span"),V=o("Parallel Sampling of Diffusion Models"),T=l(),M=n("p"),A=n("a"),Rt=o("Parallel Sampling of Diffusion Models"),zt=o(" is by Andy Shih, Suneel Belkhale, Stefano Ermon, Dorsa Sadigh, Nima Anari."),ht=l(),Se=n("p"),Wt=o("The abstract from the paper is:"),_t=l(),$e=n("p"),qe=n("em"),Ht=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."),bt=l(),U=n("p"),Yt=o("The original codebase can be found at "),ae=n("a"),Qt=o("AndyShih12/paradigms"),Xt=o(", and the pipeline was contributed by "),oe=n("a"),Kt=o("AndyShih12"),ei=o(". \u2764\uFE0F"),vt=l(),j=n("h2"),F=n("a"),Fe=n("span"),v(re.$$.fragment),ti=l(),Re=n("span"),ii=o("Tips"),Pt=l(),Ee=n("p"),ni=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.`),wt=l(),J=n("p"),si=o("The two parameters to play with are "),ze=n("code"),ai=o("parallel"),oi=o(" (batch size) and "),We=n("code"),ri=o("tolerance"),li=o("."),yt=l(),R=n("ul"),O=n("li"),di=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 `),He=n("code"),pi=o("batch_per_device=12"),fi=o(" to get "),Ye=n("code"),ci=o("parallel=96"),ui=o(`). A higher batch size
may not fit in memory, and lower batch size gives less parallelism.`),mi=l(),le=n("li"),gi=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 `),Qe=n("code"),hi=o("0.001"),_i=o("."),Dt=l(),x=n("p"),bi=o("For a 1000-step DDPM on 8 A100 GPUs, you can expect around a 3x speedup from "),xe=n("a"),vi=o("StableDiffusionParadigmsPipeline"),Pi=o(" compared to the "),Te=n("a"),wi=o("StableDiffusionPipeline"),yi=o(`
by setting `),Xe=n("code"),Di=o("parallel=80"),Si=o(" and "),Ke=n("code"),$i=o("tolerance=0.1"),Ei=o("."),St=l(),G=n("p"),xi=o("\u{1F917} Diffusers offers "),Ie=n("a"),Ti=o("distributed inference support"),Ii=o(` for generating multiple prompts
in parallel on multiple GPUs. But `),ke=n("a"),ki=o("StableDiffusionParadigmsPipeline"),Mi=o(" is designed for speeding up sampling of a single prompt by using multiple GPUs."),$t=l(),v(z.$$.fragment),Et=l(),B=n("h2"),W=n("a"),et=n("span"),v(de.$$.fragment),Ai=l(),tt=n("span"),Ui=o("StableDiffusionParadigmsPipeline"),xt=l(),g=n("div"),v(pe.$$.fragment),Ji=l(),it=n("p"),Gi=o("Pipeline for text-to-image generation using a parallelized version of Stable Diffusion."),Li=l(),fe=n("p"),Ci=o("This model inherits from "),Me=n("a"),Ni=o("DiffusionPipeline"),Vi=o(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ji=l(),nt=n("p"),Oi=o("The pipeline also inherits the following loading methods:"),Bi=l(),k=n("ul"),Ae=n("li"),Ue=n("a"),Zi=o("load_textual_inversion()"),qi=o(" for loading textual inversion embeddings"),Fi=l(),Je=n("li"),Ge=n("a"),Ri=o("load_lora_weights()"),zi=o(" for loading LoRA weights"),Wi=l(),Le=n("li"),Ce=n("a"),Hi=o("save_lora_weights()"),Yi=o(" for saving LoRA weights"),Qi=l(),H=n("li"),Ne=n("a"),Xi=o("from_single_file()"),Ki=o(" for loading "),st=n("code"),en=o(".ckpt"),tn=o(" files"),nn=l(),L=n("div"),v(ce.$$.fragment),sn=l(),at=n("p"),an=o("The call function to the pipeline for generation."),on=l(),v(Y.$$.fragment),rn=l(),Q=n("div"),v(ue.$$.fragment),ln=l(),me=n("p"),dn=o("Disable sliced VAE decoding. If "),ot=n("code"),pn=o("enable_vae_slicing"),fn=o(` was previously enabled, this method will go back to
computing decoding in one step.`),cn=l(),X=n("div"),v(ge.$$.fragment),un=l(),he=n("p"),mn=o("Disable tiled VAE decoding. If "),rt=n("code"),gn=o("enable_vae_tiling"),hn=o(` was previously enabled, this method will go back to
computing decoding in one step.`),_n=l(),K=n("div"),v(_e.$$.fragment),bn=l(),lt=n("p"),vn=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.`),Pn=l(),ee=n("div"),v(be.$$.fragment),wn=l(),dt=n("p"),yn=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.`),Dn=l(),te=n("div"),v(ve.$$.fragment),Sn=l(),pt=n("p"),$n=o("Encodes the prompt into text encoder hidden states."),Tt=l(),Z=n("h2"),ie=n("a"),ft=n("span"),v(Pe.$$.fragment),En=l(),ct=n("span"),xn=o("StableDiffusionPipelineOutput"),It=l(),q=n("div"),v(we.$$.fragment),Tn=l(),ut=n("p"),In=o("Output class for Stable Diffusion pipelines."),this.h()},l(t){const f=xs('[data-svelte="svelte-1phssyn"]',document.head);m=s(f,"META",{name:!0,content:!0}),f.forEach(i),I=d(t),_=s(t,"H1",{class:!0});var ye=a(_);b=s(ye,"A",{id:!0,class:!0,href:!0});var mt=a(b);$=s(mt,"SPAN",{});var Jn=a($);P(u.$$.fragment,Jn),Jn.forEach(i),mt.forEach(i),E=d(ye),N=s(ye,"SPAN",{});var Gn=a(N);V=r(Gn,"Parallel Sampling of Diffusion Models"),Gn.forEach(i),ye.forEach(i),T=d(t),M=s(t,"P",{});var kn=a(M);A=s(kn,"A",{href:!0,rel:!0});var Ln=a(A);Rt=r(Ln,"Parallel Sampling of Diffusion Models"),Ln.forEach(i),zt=r(kn," is by Andy Shih, Suneel Belkhale, Stefano Ermon, Dorsa Sadigh, Nima Anari."),kn.forEach(i),ht=d(t),Se=s(t,"P",{});var Cn=a(Se);Wt=r(Cn,"The abstract from the paper is:"),Cn.forEach(i),_t=d(t),$e=s(t,"P",{});var Nn=a($e);qe=s(Nn,"EM",{});var Vn=a(qe);Ht=r(Vn,"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."),Vn.forEach(i),Nn.forEach(i),bt=d(t),U=s(t,"P",{});var Ve=a(U);Yt=r(Ve,"The original codebase can be found at "),ae=s(Ve,"A",{href:!0,rel:!0});var jn=a(ae);Qt=r(jn,"AndyShih12/paradigms"),jn.forEach(i),Xt=r(Ve,", and the pipeline was contributed by "),oe=s(Ve,"A",{href:!0,rel:!0});var On=a(oe);Kt=r(On,"AndyShih12"),On.forEach(i),ei=r(Ve,". \u2764\uFE0F"),Ve.forEach(i),vt=d(t),j=s(t,"H2",{class:!0});var Mt=a(j);F=s(Mt,"A",{id:!0,class:!0,href:!0});var Bn=a(F);Fe=s(Bn,"SPAN",{});var Zn=a(Fe);P(re.$$.fragment,Zn),Zn.forEach(i),Bn.forEach(i),ti=d(Mt),Re=s(Mt,"SPAN",{});var qn=a(Re);ii=r(qn,"Tips"),qn.forEach(i),Mt.forEach(i),Pt=d(t),Ee=s(t,"P",{});var Fn=a(Ee);ni=r(Fn,`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.`),Fn.forEach(i),wt=d(t),J=s(t,"P",{});var je=a(J);si=r(je,"The two parameters to play with are "),ze=s(je,"CODE",{});var Rn=a(ze);ai=r(Rn,"parallel"),Rn.forEach(i),oi=r(je," (batch size) and "),We=s(je,"CODE",{});var zn=a(We);ri=r(zn,"tolerance"),zn.forEach(i),li=r(je,"."),je.forEach(i),yt=d(t),R=s(t,"UL",{});var At=a(R);O=s(At,"LI",{});var Oe=a(O);di=r(Oe,`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 `),He=s(Oe,"CODE",{});var Wn=a(He);pi=r(Wn,"batch_per_device=12"),Wn.forEach(i),fi=r(Oe," to get "),Ye=s(Oe,"CODE",{});var Hn=a(Ye);ci=r(Hn,"parallel=96"),Hn.forEach(i),ui=r(Oe,`). A higher batch size
may not fit in memory, and lower batch size gives less parallelism.`),Oe.forEach(i),mi=d(At),le=s(At,"LI",{});var Ut=a(le);gi=r(Ut,`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 `),Qe=s(Ut,"CODE",{});var Yn=a(Qe);hi=r(Yn,"0.001"),Yn.forEach(i),_i=r(Ut,"."),Ut.forEach(i),At.forEach(i),Dt=d(t),x=s(t,"P",{});var C=a(x);bi=r(C,"For a 1000-step DDPM on 8 A100 GPUs, you can expect around a 3x speedup from "),xe=s(C,"A",{href:!0});var Qn=a(xe);vi=r(Qn,"StableDiffusionParadigmsPipeline"),Qn.forEach(i),Pi=r(C," compared to the "),Te=s(C,"A",{href:!0});var Xn=a(Te);wi=r(Xn,"StableDiffusionPipeline"),Xn.forEach(i),yi=r(C,`
by setting `),Xe=s(C,"CODE",{});var Kn=a(Xe);Di=r(Kn,"parallel=80"),Kn.forEach(i),Si=r(C," and "),Ke=s(C,"CODE",{});var es=a(Ke);$i=r(es,"tolerance=0.1"),es.forEach(i),Ei=r(C,"."),C.forEach(i),St=d(t),G=s(t,"P",{});var Be=a(G);xi=r(Be,"\u{1F917} Diffusers offers "),Ie=s(Be,"A",{href:!0});var ts=a(Ie);Ti=r(ts,"distributed inference support"),ts.forEach(i),Ii=r(Be,` for generating multiple prompts
in parallel on multiple GPUs. But `),ke=s(Be,"A",{href:!0});var is=a(ke);ki=r(is,"StableDiffusionParadigmsPipeline"),is.forEach(i),Mi=r(Be," is designed for speeding up sampling of a single prompt by using multiple GPUs."),Be.forEach(i),$t=d(t),P(z.$$.fragment,t),Et=d(t),B=s(t,"H2",{class:!0});var Jt=a(B);W=s(Jt,"A",{id:!0,class:!0,href:!0});var ns=a(W);et=s(ns,"SPAN",{});var ss=a(et);P(de.$$.fragment,ss),ss.forEach(i),ns.forEach(i),Ai=d(Jt),tt=s(Jt,"SPAN",{});var as=a(tt);Ui=r(as,"StableDiffusionParadigmsPipeline"),as.forEach(i),Jt.forEach(i),xt=d(t),g=s(t,"DIV",{class:!0});var h=a(g);P(pe.$$.fragment,h),Ji=d(h),it=s(h,"P",{});var os=a(it);Gi=r(os,"Pipeline for text-to-image generation using a parallelized version of Stable Diffusion."),os.forEach(i),Li=d(h),fe=s(h,"P",{});var Gt=a(fe);Ci=r(Gt,"This model inherits from "),Me=s(Gt,"A",{href:!0});var rs=a(Me);Ni=r(rs,"DiffusionPipeline"),rs.forEach(i),Vi=r(Gt,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Gt.forEach(i),ji=d(h),nt=s(h,"P",{});var ls=a(nt);Oi=r(ls,"The pipeline also inherits the following loading methods:"),ls.forEach(i),Bi=d(h),k=s(h,"UL",{});var ne=a(k);Ae=s(ne,"LI",{});var Mn=a(Ae);Ue=s(Mn,"A",{href:!0});var ds=a(Ue);Zi=r(ds,"load_textual_inversion()"),ds.forEach(i),qi=r(Mn," for loading textual inversion embeddings"),Mn.forEach(i),Fi=d(ne),Je=s(ne,"LI",{});var An=a(Je);Ge=s(An,"A",{href:!0});var ps=a(Ge);Ri=r(ps,"load_lora_weights()"),ps.forEach(i),zi=r(An," for loading LoRA weights"),An.forEach(i),Wi=d(ne),Le=s(ne,"LI",{});var Un=a(Le);Ce=s(Un,"A",{href:!0});var fs=a(Ce);Hi=r(fs,"save_lora_weights()"),fs.forEach(i),Yi=r(Un," for saving LoRA weights"),Un.forEach(i),Qi=d(ne),H=s(ne,"LI",{});var gt=a(H);Ne=s(gt,"A",{href:!0});var cs=a(Ne);Xi=r(cs,"from_single_file()"),cs.forEach(i),Ki=r(gt," for loading "),st=s(gt,"CODE",{});var us=a(st);en=r(us,".ckpt"),us.forEach(i),tn=r(gt," files"),gt.forEach(i),ne.forEach(i),nn=d(h),L=s(h,"DIV",{class:!0});var Ze=a(L);P(ce.$$.fragment,Ze),sn=d(Ze),at=s(Ze,"P",{});var ms=a(at);an=r(ms,"The call function to the pipeline for generation."),ms.forEach(i),on=d(Ze),P(Y.$$.fragment,Ze),Ze.forEach(i),rn=d(h),Q=s(h,"DIV",{class:!0});var Lt=a(Q);P(ue.$$.fragment,Lt),ln=d(Lt),me=s(Lt,"P",{});var Ct=a(me);dn=r(Ct,"Disable sliced VAE decoding. If "),ot=s(Ct,"CODE",{});var gs=a(ot);pn=r(gs,"enable_vae_slicing"),gs.forEach(i),fn=r(Ct,` was previously enabled, this method will go back to
computing decoding in one step.`),Ct.forEach(i),Lt.forEach(i),cn=d(h),X=s(h,"DIV",{class:!0});var Nt=a(X);P(ge.$$.fragment,Nt),un=d(Nt),he=s(Nt,"P",{});var Vt=a(he);mn=r(Vt,"Disable tiled VAE decoding. If "),rt=s(Vt,"CODE",{});var hs=a(rt);gn=r(hs,"enable_vae_tiling"),hs.forEach(i),hn=r(Vt,` was previously enabled, this method will go back to
computing decoding in one step.`),Vt.forEach(i),Nt.forEach(i),_n=d(h),K=s(h,"DIV",{class:!0});var jt=a(K);P(_e.$$.fragment,jt),bn=d(jt),lt=s(jt,"P",{});var _s=a(lt);vn=r(_s,`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.`),_s.forEach(i),jt.forEach(i),Pn=d(h),ee=s(h,"DIV",{class:!0});var Ot=a(ee);P(be.$$.fragment,Ot),wn=d(Ot),dt=s(Ot,"P",{});var bs=a(dt);yn=r(bs,`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.`),bs.forEach(i),Ot.forEach(i),Dn=d(h),te=s(h,"DIV",{class:!0});var Bt=a(te);P(ve.$$.fragment,Bt),Sn=d(Bt),pt=s(Bt,"P",{});var vs=a(pt);$n=r(vs,"Encodes the prompt into text encoder hidden states."),vs.forEach(i),Bt.forEach(i),h.forEach(i),Tt=d(t),Z=s(t,"H2",{class:!0});var Zt=a(Z);ie=s(Zt,"A",{id:!0,class:!0,href:!0});var Ps=a(ie);ft=s(Ps,"SPAN",{});var ws=a(ft);P(Pe.$$.fragment,ws),ws.forEach(i),Ps.forEach(i),En=d(Zt),ct=s(Zt,"SPAN",{});var ys=a(ct);xn=r(ys,"StableDiffusionPipelineOutput"),ys.forEach(i),Zt.forEach(i),It=d(t),q=s(t,"DIV",{class:!0});var qt=a(q);P(we.$$.fragment,qt),Tn=d(qt),ut=s(qt,"P",{});var Ds=a(ut);In=r(Ds,"Output class for Stable Diffusion pipelines."),Ds.forEach(i),qt.forEach(i),this.h()},h(){p(m,"name","hf:doc:metadata"),p(m,"content",JSON.stringify(Ls)),p(b,"id","parallel-sampling-of-diffusion-models"),p(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"),p(b,"href","#parallel-sampling-of-diffusion-models"),p(_,"class","relative group"),p(A,"href","https://huggingface.co/papers/2305.16317"),p(A,"rel","nofollow"),p(ae,"href","https://github.com/AndyShih12/paradigms"),p(ae,"rel","nofollow"),p(oe,"href","https://github.com/AndyShih12"),p(oe,"rel","nofollow"),p(F,"id","tips"),p(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"),p(F,"href","#tips"),p(j,"class","relative group"),p(xe,"href","/docs/diffusers/v0.21.0/en/api/pipelines/paradigms#diffusers.StableDiffusionParadigmsPipeline"),p(Te,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),p(Ie,"href","../training/distributed_inference"),p(ke,"href","/docs/diffusers/v0.21.0/en/api/pipelines/paradigms#diffusers.StableDiffusionParadigmsPipeline"),p(W,"id","diffusers.StableDiffusionParadigmsPipeline"),p(W,"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"),p(W,"href","#diffusers.StableDiffusionParadigmsPipeline"),p(B,"class","relative group"),p(Me,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Ue,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),p(Ge,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),p(Ce,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),p(Ne,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ie,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(ie,"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"),p(ie,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(Z,"class","relative group"),p(q,"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,f){e(document.head,m),c(t,I,f),c(t,_,f),e(_,b),e(b,$),w(u,$,null),e(_,E),e(_,N),e(N,V),c(t,T,f),c(t,M,f),e(M,A),e(A,Rt),e(M,zt),c(t,ht,f),c(t,Se,f),e(Se,Wt),c(t,_t,f),c(t,$e,f),e($e,qe),e(qe,Ht),c(t,bt,f),c(t,U,f),e(U,Yt),e(U,ae),e(ae,Qt),e(U,Xt),e(U,oe),e(oe,Kt),e(U,ei),c(t,vt,f),c(t,j,f),e(j,F),e(F,Fe),w(re,Fe,null),e(j,ti),e(j,Re),e(Re,ii),c(t,Pt,f),c(t,Ee,f),e(Ee,ni),c(t,wt,f),c(t,J,f),e(J,si),e(J,ze),e(ze,ai),e(J,oi),e(J,We),e(We,ri),e(J,li),c(t,yt,f),c(t,R,f),e(R,O),e(O,di),e(O,He),e(He,pi),e(O,fi),e(O,Ye),e(Ye,ci),e(O,ui),e(R,mi),e(R,le),e(le,gi),e(le,Qe),e(Qe,hi),e(le,_i),c(t,Dt,f),c(t,x,f),e(x,bi),e(x,xe),e(xe,vi),e(x,Pi),e(x,Te),e(Te,wi),e(x,yi),e(x,Xe),e(Xe,Di),e(x,Si),e(x,Ke),e(Ke,$i),e(x,Ei),c(t,St,f),c(t,G,f),e(G,xi),e(G,Ie),e(Ie,Ti),e(G,Ii),e(G,ke),e(ke,ki),e(G,Mi),c(t,$t,f),w(z,t,f),c(t,Et,f),c(t,B,f),e(B,W),e(W,et),w(de,et,null),e(B,Ai),e(B,tt),e(tt,Ui),c(t,xt,f),c(t,g,f),w(pe,g,null),e(g,Ji),e(g,it),e(it,Gi),e(g,Li),e(g,fe),e(fe,Ci),e(fe,Me),e(Me,Ni),e(fe,Vi),e(g,ji),e(g,nt),e(nt,Oi),e(g,Bi),e(g,k),e(k,Ae),e(Ae,Ue),e(Ue,Zi),e(Ae,qi),e(k,Fi),e(k,Je),e(Je,Ge),e(Ge,Ri),e(Je,zi),e(k,Wi),e(k,Le),e(Le,Ce),e(Ce,Hi),e(Le,Yi),e(k,Qi),e(k,H),e(H,Ne),e(Ne,Xi),e(H,Ki),e(H,st),e(st,en),e(H,tn),e(g,nn),e(g,L),w(ce,L,null),e(L,sn),e(L,at),e(at,an),e(L,on),w(Y,L,null),e(g,rn),e(g,Q),w(ue,Q,null),e(Q,ln),e(Q,me),e(me,dn),e(me,ot),e(ot,pn),e(me,fn),e(g,cn),e(g,X),w(ge,X,null),e(X,un),e(X,he),e(he,mn),e(he,rt),e(rt,gn),e(he,hn),e(g,_n),e(g,K),w(_e,K,null),e(K,bn),e(K,lt),e(lt,vn),e(g,Pn),e(g,ee),w(be,ee,null),e(ee,wn),e(ee,dt),e(dt,yn),e(g,Dn),e(g,te),w(ve,te,null),e(te,Sn),e(te,pt),e(pt,$n),c(t,Tt,f),c(t,Z,f),e(Z,ie),e(ie,ft),w(Pe,ft,null),e(Z,En),e(Z,ct),e(ct,xn),c(t,It,f),c(t,q,f),w(we,q,null),e(q,Tn),e(q,ut),e(ut,In),kt=!0},p(t,[f]){const ye={};f&2&&(ye.$$scope={dirty:f,ctx:t}),z.$set(ye);const mt={};f&2&&(mt.$$scope={dirty:f,ctx:t}),Y.$set(mt)},i(t){kt||(y(u.$$.fragment,t),y(re.$$.fragment,t),y(z.$$.fragment,t),y(de.$$.fragment,t),y(pe.$$.fragment,t),y(ce.$$.fragment,t),y(Y.$$.fragment,t),y(ue.$$.fragment,t),y(ge.$$.fragment,t),y(_e.$$.fragment,t),y(be.$$.fragment,t),y(ve.$$.fragment,t),y(Pe.$$.fragment,t),y(we.$$.fragment,t),kt=!0)},o(t){D(u.$$.fragment,t),D(re.$$.fragment,t),D(z.$$.fragment,t),D(de.$$.fragment,t),D(pe.$$.fragment,t),D(ce.$$.fragment,t),D(Y.$$.fragment,t),D(ue.$$.fragment,t),D(ge.$$.fragment,t),D(_e.$$.fragment,t),D(be.$$.fragment,t),D(ve.$$.fragment,t),D(Pe.$$.fragment,t),D(we.$$.fragment,t),kt=!1},d(t){i(m),t&&i(I),t&&i(_),S(u),t&&i(T),t&&i(M),t&&i(ht),t&&i(Se),t&&i(_t),t&&i($e),t&&i(bt),t&&i(U),t&&i(vt),t&&i(j),S(re),t&&i(Pt),t&&i(Ee),t&&i(wt),t&&i(J),t&&i(yt),t&&i(R),t&&i(Dt),t&&i(x),t&&i(St),t&&i(G),t&&i($t),S(z,t),t&&i(Et),t&&i(B),S(de),t&&i(xt),t&&i(g),S(pe),S(ce),S(Y),S(ue),S(ge),S(_e),S(be),S(ve),t&&i(Tt),t&&i(Z),S(Pe),t&&i(It),t&&i(q),S(we)}}}const Ls={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 Cs(De){return Ts(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qs extends Ss{constructor(m){super();$s(this,m,Cs,Gs,Es,{})}}export{qs as default,Ls as metadata};
