import{s as ut,o as gt,n as Oe}from"../chunks/scheduler.8c3d61f6.js";import{S as _t,i as bt,g as c,s as i,r as h,A as yt,h as p,f as n,c as o,j as G,u as f,x as k,k as Y,y as d,a as s,v as u,d as g,t as _,w as b}from"../chunks/index.da70eac4.js";import{D as fe}from"../chunks/Docstring.6b390b9a.js";import{C as _e}from"../chunks/CodeBlock.00a903b3.js";import{E as Ke}from"../chunks/ExampleCodeBlock.db12be95.js";import{H as ue,E as wt}from"../chunks/EditOnGithub.1e64e623.js";function kt(B){let l,T="Example:",y,r,m;return r=new _e({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMkMlMjBQeXJhbWlkQXR0ZW50aW9uQnJvYWRjYXN0Q29uZmlnJTBBJTBBcGlwZSUyMCUzRCUyMENvZ1ZpZGVvWFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJUSFVETSUyRkNvZ1ZpZGVvWC01YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQWNvbmZpZyUyMCUzRCUyMFB5cmFtaWRBdHRlbnRpb25Ccm9hZGNhc3RDb25maWcoJTBBJTIwJTIwJTIwJTIwc3BhdGlhbF9hdHRlbnRpb25fYmxvY2tfc2tpcF9yYW5nZSUzRDIlMkMlMEElMjAlMjAlMjAlMjBzcGF0aWFsX2F0dGVudGlvbl90aW1lc3RlcF9za2lwX3JhbmdlJTNEKDEwMCUyQyUyMDgwMCklMkMlMEElMjAlMjAlMjAlMjBjdXJyZW50X3RpbWVzdGVwX2NhbGxiYWNrJTNEbGFtYmRhJTNBJTIwcGlwZS5jdXJyZW50X3RpbWVzdGVwJTJDJTBBKSUwQXBpcGUudHJhbnNmb3JtZXIuZW5hYmxlX2NhY2hlKGNvbmZpZyk=",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> CogVideoXPipeline, PyramidAttentionBroadcastConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = CogVideoXPipeline.from_pretrained(<span class="hljs-string">&quot;THUDM/CogVideoX-5b&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>config = PyramidAttentionBroadcastConfig(
<span class="hljs-meta">... </span>    spatial_attention_block_skip_range=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    spatial_attention_timestep_skip_range=(<span class="hljs-number">100</span>, <span class="hljs-number">800</span>),
<span class="hljs-meta">... </span>    current_timestep_callback=<span class="hljs-keyword">lambda</span>: pipe.current_timestep,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.transformer.enable_cache(config)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,y=i(),h(r.$$.fragment)},l(a){l=p(a,"P",{"data-svelte-h":!0}),k(l)!=="svelte-11lpom8"&&(l.textContent=T),y=o(a),f(r.$$.fragment,a)},m(a,w){s(a,l,w),s(a,y,w),u(r,a,w),m=!0},p:Oe,i(a){m||(g(r.$$.fragment,a),m=!0)},o(a){_(r.$$.fragment,a),m=!1},d(a){a&&(n(l),n(y)),b(r,a)}}}function Mt(B){let l,T="Example:",y,r,m;return r=new _e({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMkMlMjBQeXJhbWlkQXR0ZW50aW9uQnJvYWRjYXN0Q29uZmlnJTJDJTIwYXBwbHlfcHlyYW1pZF9hdHRlbnRpb25fYnJvYWRjYXN0JTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b192aWRlbyUwQSUwQXBpcGUlMjAlM0QlMjBDb2dWaWRlb1hQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyVEhVRE0lMkZDb2dWaWRlb1gtNWIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFjb25maWclMjAlM0QlMjBQeXJhbWlkQXR0ZW50aW9uQnJvYWRjYXN0Q29uZmlnKCUwQSUyMCUyMCUyMCUyMHNwYXRpYWxfYXR0ZW50aW9uX2Jsb2NrX3NraXBfcmFuZ2UlM0QyJTJDJTBBJTIwJTIwJTIwJTIwc3BhdGlhbF9hdHRlbnRpb25fdGltZXN0ZXBfc2tpcF9yYW5nZSUzRCgxMDAlMkMlMjA4MDApJTJDJTBBJTIwJTIwJTIwJTIwY3VycmVudF90aW1lc3RlcF9jYWxsYmFjayUzRGxhbWJkYSUzQSUyMHBpcGUuY3VycmVudF90aW1lc3RlcCUyQyUwQSklMEFhcHBseV9weXJhbWlkX2F0dGVudGlvbl9icm9hZGNhc3QocGlwZS50cmFuc2Zvcm1lciUyQyUyMGNvbmZpZyk=",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> CogVideoXPipeline, PyramidAttentionBroadcastConfig, apply_pyramid_attention_broadcast
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = CogVideoXPipeline.from_pretrained(<span class="hljs-string">&quot;THUDM/CogVideoX-5b&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>config = PyramidAttentionBroadcastConfig(
<span class="hljs-meta">... </span>    spatial_attention_block_skip_range=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    spatial_attention_timestep_skip_range=(<span class="hljs-number">100</span>, <span class="hljs-number">800</span>),
<span class="hljs-meta">... </span>    current_timestep_callback=<span class="hljs-keyword">lambda</span>: pipe.current_timestep,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>apply_pyramid_attention_broadcast(pipe.transformer, config)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,y=i(),h(r.$$.fragment)},l(a){l=p(a,"P",{"data-svelte-h":!0}),k(l)!=="svelte-11lpom8"&&(l.textContent=T),y=o(a),f(r.$$.fragment,a)},m(a,w){s(a,l,w),s(a,y,w),u(r,a,w),m=!0},p:Oe,i(a){m||(g(r.$$.fragment,a),m=!0)},o(a){_(r.$$.fragment,a),m=!1},d(a){a&&(n(l),n(y)),b(r,a)}}}function Tt(B){let l,T="Example:",y,r,m;return r=new _e({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMkMlMjBGYXN0ZXJDYWNoZUNvbmZpZyUyQyUyMGFwcGx5X2Zhc3Rlcl9jYWNoZSUwQSUwQXBpcGUlMjAlM0QlMjBDb2dWaWRlb1hQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyVEhVRE0lMkZDb2dWaWRlb1gtNWIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFjb25maWclMjAlM0QlMjBGYXN0ZXJDYWNoZUNvbmZpZyglMEElMjAlMjAlMjAlMjBzcGF0aWFsX2F0dGVudGlvbl9ibG9ja19za2lwX3JhbmdlJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHNwYXRpYWxfYXR0ZW50aW9uX3RpbWVzdGVwX3NraXBfcmFuZ2UlM0QoLTElMkMlMjA2ODEpJTJDJTBBJTIwJTIwJTIwJTIwbG93X2ZyZXF1ZW5jeV93ZWlnaHRfdXBkYXRlX3RpbWVzdGVwX3JhbmdlJTNEKDk5JTJDJTIwNjQxKSUyQyUwQSUyMCUyMCUyMCUyMGhpZ2hfZnJlcXVlbmN5X3dlaWdodF91cGRhdGVfdGltZXN0ZXBfcmFuZ2UlM0QoLTElMkMlMjAzMDEpJTJDJTBBJTIwJTIwJTIwJTIwc3BhdGlhbF9hdHRlbnRpb25fYmxvY2tfaWRlbnRpZmllcnMlM0QlNUIlMjJ0cmFuc2Zvcm1lcl9ibG9ja3MlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBhdHRlbnRpb25fd2VpZ2h0X2NhbGxiYWNrJTNEbGFtYmRhJTIwXyUzQSUyMDAuMyUyQyUwQSUyMCUyMCUyMCUyMHRlbnNvcl9mb3JtYXQlM0QlMjJCRkNIVyUyMiUyQyUwQSklMEFhcHBseV9mYXN0ZXJfY2FjaGUocGlwZS50cmFuc2Zvcm1lciUyQyUyMGNvbmZpZyk=",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> CogVideoXPipeline, FasterCacheConfig, apply_faster_cache

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = CogVideoXPipeline.from_pretrained(<span class="hljs-string">&quot;THUDM/CogVideoX-5b&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>config = FasterCacheConfig(
<span class="hljs-meta">... </span>    spatial_attention_block_skip_range=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    spatial_attention_timestep_skip_range=(-<span class="hljs-number">1</span>, <span class="hljs-number">681</span>),
<span class="hljs-meta">... </span>    low_frequency_weight_update_timestep_range=(<span class="hljs-number">99</span>, <span class="hljs-number">641</span>),
<span class="hljs-meta">... </span>    high_frequency_weight_update_timestep_range=(-<span class="hljs-number">1</span>, <span class="hljs-number">301</span>),
<span class="hljs-meta">... </span>    spatial_attention_block_identifiers=[<span class="hljs-string">&quot;transformer_blocks&quot;</span>],
<span class="hljs-meta">... </span>    attention_weight_callback=<span class="hljs-keyword">lambda</span> _: <span class="hljs-number">0.3</span>,
<span class="hljs-meta">... </span>    tensor_format=<span class="hljs-string">&quot;BFCHW&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>apply_faster_cache(pipe.transformer, config)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,y=i(),h(r.$$.fragment)},l(a){l=p(a,"P",{"data-svelte-h":!0}),k(l)!=="svelte-11lpom8"&&(l.textContent=T),y=o(a),f(r.$$.fragment,a)},m(a,w){s(a,l,w),s(a,y,w),u(r,a,w),m=!0},p:Oe,i(a){m||(g(r.$$.fragment,a),m=!0)},o(a){_(r.$$.fragment,a),m=!1},d(a){a&&(n(l),n(y)),b(r,a)}}}function Ct(B){let l,T,y,r,m,a,w,be,N,et='<a href="https://huggingface.co/papers/2408.12588" rel="nofollow">Pyramid Attention Broadcast</a> from Xuanlei Zhao, Xiaolong Jin, Kai Wang, Yang You.',ye,I,tt="Pyramid Attention Broadcast (PAB) is a method that speeds up inference in diffusion models by systematically skipping attention computations between successive inference steps and reusing cached attention states. The attention states are not very different between successive inference steps. The most prominent difference is in the spatial attention blocks, not as much in the temporal attention blocks, and finally the least in the cross attention blocks. Therefore, many cross attention computation blocks can be skipped, followed by the temporal and spatial attention blocks. By combining other techniques like sequence parallelism and classifier-free guidance parallelism, PAB achieves near real-time video generation.",we,q,nt='Enable PAB with <a href="/docs/diffusers/main/en/api/cache#diffusers.PyramidAttentionBroadcastConfig">~PyramidAttentionBroadcastConfig</a> on any pipeline. For some benchmarks, refer to <a href="https://github.com/huggingface/diffusers/pull/9562" rel="nofollow">this</a> pull request.',ke,R,Me,Q,Te,E,at='<a href="https://huggingface.co/papers/2410.19355" rel="nofollow">FasterCache</a> from Zhengyao Lv, Chenyang Si, Junhao Song, Zhenyu Yang, Yu Qiao, Ziwei Liu, Kwan-Yee K. Wong.',Ce,V,st="FasterCache is a method that speeds up inference in diffusion transformers by:",je,A,it="<li>Reusing attention states between successive inference steps, due to high similarity between them</li> <li>Skipping unconditional branch prediction used in classifier-free guidance by revealing redundancies between unconditional and conditional branch outputs for the same timestep, and therefore approximating the unconditional branch output using the conditional branch output</li>",Je,P,$e,S,ve,M,H,Ie,se,ot="A class for enable/disabling caching techniques on diffusion models.",qe,ie,lt="Supported caching techniques:",Re,oe,rt='<li><a href="https://huggingface.co/papers/2408.12588" rel="nofollow">Pyramid Attention Broadcast</a></li> <li><a href="https://huggingface.co/papers/2410.19355" rel="nofollow">FasterCache</a></li>',Qe,$,D,Ee,le,ct="Enable caching techniques on the model.",Ve,W,Ze,z,Ue,v,L,Ae,re,pt="Configuration for Pyramid Attention Broadcast.",Be,C,K,Pe,ce,dt='Apply <a href="https://huggingface.co/papers/2408.12588" rel="nofollow">Pyramid Attention Broadcast</a> to a given pipeline.',Se,pe,mt=`PAB is an attention approximation method that leverages the similarity in attention states between timesteps to
reduce the computational cost of attention computation. The key takeaway from the paper is that the attention
similarity in the cross-attention layers between timesteps is high, followed by less similarity in the temporal and
spatial layers. This allows for the skipping of attention computation in the cross-attention layers more frequently
than in the temporal and spatial layers. Applying PAB will, therefore, speedup the inference process.`,He,F,We,O,Fe,Z,ee,De,de,ht='Configuration for <a href="https://huggingface.co/papers/2410.19355" rel="nofollow">FasterCache</a>.',xe,J,te,ze,me,ft='Applies <a href="https://huggingface.co/papers/2410.19355" rel="nofollow">FasterCache</a> to a given pipeline.',Le,x,Xe,ne,Ge,ge,Ye;return m=new ue({props:{title:"Caching methods",local:"caching-methods",headingTag:"h1"}}),w=new ue({props:{title:"Pyramid Attention Broadcast",local:"pyramid-attention-broadcast",headingTag:"h2"}}),R=new _e({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMkMlMjBQeXJhbWlkQXR0ZW50aW9uQnJvYWRjYXN0Q29uZmlnJTBBJTBBcGlwZSUyMCUzRCUyMENvZ1ZpZGVvWFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJUSFVETSUyRkNvZ1ZpZGVvWC01YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQSUyMyUyMEluY3JlYXNpbmclMjB0aGUlMjB2YWx1ZSUyMG9mJTIwJTYwc3BhdGlhbF9hdHRlbnRpb25fdGltZXN0ZXBfc2tpcF9yYW5nZSU1QjAlNUQlNjAlMjBvciUyMGRlY3JlYXNpbmclMjB0aGUlMjB2YWx1ZSUyMG9mJTBBJTIzJTIwJTYwc3BhdGlhbF9hdHRlbnRpb25fdGltZXN0ZXBfc2tpcF9yYW5nZSU1QjElNUQlNjAlMjB3aWxsJTIwZGVjcmVhc2UlMjB0aGUlMjBpbnRlcnZhbCUyMGluJTIwd2hpY2glMjBweXJhbWlkJTIwYXR0ZW50aW9uJTBBJTIzJTIwYnJvYWRjYXN0JTIwaXMlMjBhY3RpdmUlMkMlMjBsZWFkZXIlMjB0byUyMHNsb3dlciUyMGluZmVyZW5jZSUyMHNwZWVkcy4lMjBIb3dldmVyJTJDJTIwbGFyZ2UlMjBpbnRlcnZhbHMlMjBjYW4lMjBsZWFkJTIwdG8lMEElMjMlMjBwb29yZXIlMjBxdWFsaXR5JTIwb2YlMjBnZW5lcmF0ZWQlMjB2aWRlb3MuJTBBY29uZmlnJTIwJTNEJTIwUHlyYW1pZEF0dGVudGlvbkJyb2FkY2FzdENvbmZpZyglMEElMjAlMjAlMjAlMjBzcGF0aWFsX2F0dGVudGlvbl9ibG9ja19za2lwX3JhbmdlJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHNwYXRpYWxfYXR0ZW50aW9uX3RpbWVzdGVwX3NraXBfcmFuZ2UlM0QoMTAwJTJDJTIwODAwKSUyQyUwQSUyMCUyMCUyMCUyMGN1cnJlbnRfdGltZXN0ZXBfY2FsbGJhY2slM0RsYW1iZGElM0ElMjBwaXBlLmN1cnJlbnRfdGltZXN0ZXAlMkMlMEEpJTBBcGlwZS50cmFuc2Zvcm1lci5lbmFibGVfY2FjaGUoY29uZmlnKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> CogVideoXPipeline, PyramidAttentionBroadcastConfig

pipe = CogVideoXPipeline.from_pretrained(<span class="hljs-string">&quot;THUDM/CogVideoX-5b&quot;</span>, torch_dtype=torch.bfloat16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># Increasing the value of \`spatial_attention_timestep_skip_range[0]\` or decreasing the value of</span>
<span class="hljs-comment"># \`spatial_attention_timestep_skip_range[1]\` will decrease the interval in which pyramid attention</span>
<span class="hljs-comment"># broadcast is active, leader to slower inference speeds. However, large intervals can lead to</span>
<span class="hljs-comment"># poorer quality of generated videos.</span>
config = PyramidAttentionBroadcastConfig(
    spatial_attention_block_skip_range=<span class="hljs-number">2</span>,
    spatial_attention_timestep_skip_range=(<span class="hljs-number">100</span>, <span class="hljs-number">800</span>),
    current_timestep_callback=<span class="hljs-keyword">lambda</span>: pipe.current_timestep,
)
pipe.transformer.enable_cache(config)`,wrap:!1}}),Q=new ue({props:{title:"Faster Cache",local:"faster-cache",headingTag:"h2"}}),P=new _e({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMkMlMjBGYXN0ZXJDYWNoZUNvbmZpZyUwQSUwQXBpcGUlMjAlM0QlMjBDb2dWaWRlb1hQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyVEhVRE0lMkZDb2dWaWRlb1gtNWIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFjb25maWclMjAlM0QlMjBGYXN0ZXJDYWNoZUNvbmZpZyglMEElMjAlMjAlMjAlMjBzcGF0aWFsX2F0dGVudGlvbl9ibG9ja19za2lwX3JhbmdlJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHNwYXRpYWxfYXR0ZW50aW9uX3RpbWVzdGVwX3NraXBfcmFuZ2UlM0QoLTElMkMlMjA2ODEpJTJDJTBBJTIwJTIwJTIwJTIwY3VycmVudF90aW1lc3RlcF9jYWxsYmFjayUzRGxhbWJkYSUzQSUyMHBpcGUuY3VycmVudF90aW1lc3RlcCUyQyUwQSUyMCUyMCUyMCUyMGF0dGVudGlvbl93ZWlnaHRfY2FsbGJhY2slM0RsYW1iZGElMjBfJTNBJTIwMC4zJTJDJTBBJTIwJTIwJTIwJTIwdW5jb25kaXRpb25hbF9iYXRjaF9za2lwX3JhbmdlJTNENSUyQyUwQSUyMCUyMCUyMCUyMHVuY29uZGl0aW9uYWxfYmF0Y2hfdGltZXN0ZXBfc2tpcF9yYW5nZSUzRCgtMSUyQyUyMDc4MSklMkMlMEElMjAlMjAlMjAlMjB0ZW5zb3JfZm9ybWF0JTNEJTIyQkZDSFclMjIlMkMlMEEpJTBBcGlwZS50cmFuc2Zvcm1lci5lbmFibGVfY2FjaGUoY29uZmlnKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> CogVideoXPipeline, FasterCacheConfig

pipe = CogVideoXPipeline.from_pretrained(<span class="hljs-string">&quot;THUDM/CogVideoX-5b&quot;</span>, torch_dtype=torch.bfloat16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

config = FasterCacheConfig(
    spatial_attention_block_skip_range=<span class="hljs-number">2</span>,
    spatial_attention_timestep_skip_range=(-<span class="hljs-number">1</span>, <span class="hljs-number">681</span>),
    current_timestep_callback=<span class="hljs-keyword">lambda</span>: pipe.current_timestep,
    attention_weight_callback=<span class="hljs-keyword">lambda</span> _: <span class="hljs-number">0.3</span>,
    unconditional_batch_skip_range=<span class="hljs-number">5</span>,
    unconditional_batch_timestep_skip_range=(-<span class="hljs-number">1</span>, <span class="hljs-number">781</span>),
    tensor_format=<span class="hljs-string">&quot;BFCHW&quot;</span>,
)
pipe.transformer.enable_cache(config)`,wrap:!1}}),S=new ue({props:{title:"CacheMixin",local:"diffusers.CacheMixin",headingTag:"h3"}}),H=new fe({props:{name:"class diffusers.CacheMixin",anchor:"diffusers.CacheMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cache_utils.py#L21"}}),D=new fe({props:{name:"enable_cache",anchor:"diffusers.CacheMixin.enable_cache",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"diffusers.CacheMixin.enable_cache.config",description:`<strong>config</strong> (<code>Union[PyramidAttentionBroadcastConfig]</code>) &#x2014;
The configuration for applying the caching technique. Currently supported caching techniques are:<ul>
<li><a href="/docs/diffusers/main/en/api/cache#diffusers.PyramidAttentionBroadcastConfig">PyramidAttentionBroadcastConfig</a></li>
</ul>`,name:"config"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cache_utils.py#L36"}}),W=new Ke({props:{anchor:"diffusers.CacheMixin.enable_cache.example",$$slots:{default:[kt]},$$scope:{ctx:B}}}),z=new ue({props:{title:"PyramidAttentionBroadcastConfig",local:"diffusers.PyramidAttentionBroadcastConfig",headingTag:"h3"}}),L=new fe({props:{name:"class diffusers.PyramidAttentionBroadcastConfig",anchor:"diffusers.PyramidAttentionBroadcastConfig",parameters:[{name:"spatial_attention_block_skip_range",val:": typing.Optional[int] = None"},{name:"temporal_attention_block_skip_range",val:": typing.Optional[int] = None"},{name:"cross_attention_block_skip_range",val:": typing.Optional[int] = None"},{name:"spatial_attention_timestep_skip_range",val:": typing.Tuple[int, int] = (100, 800)"},{name:"temporal_attention_timestep_skip_range",val:": typing.Tuple[int, int] = (100, 800)"},{name:"cross_attention_timestep_skip_range",val:": typing.Tuple[int, int] = (100, 800)"},{name:"spatial_attention_block_identifiers",val:": typing.Tuple[str, ...] = ('blocks', 'transformer_blocks', 'single_transformer_blocks')"},{name:"temporal_attention_block_identifiers",val:": typing.Tuple[str, ...] = ('temporal_transformer_blocks',)"},{name:"cross_attention_block_identifiers",val:": typing.Tuple[str, ...] = ('blocks', 'transformer_blocks')"},{name:"current_timestep_callback",val:": typing.Callable[[], int] = None"}],parametersDescription:[{anchor:"diffusers.PyramidAttentionBroadcastConfig.spatial_attention_block_skip_range",description:`<strong>spatial_attention_block_skip_range</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of times a specific spatial attention broadcast is skipped before computing the attention states
to re-use. If this is set to the value <code>N</code>, the attention computation will be skipped <code>N - 1</code> times (i.e.,
old attention states will be re-used) before computing the new attention states again.`,name:"spatial_attention_block_skip_range"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.temporal_attention_block_skip_range",description:`<strong>temporal_attention_block_skip_range</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of times a specific temporal attention broadcast is skipped before computing the attention
states to re-use. If this is set to the value <code>N</code>, the attention computation will be skipped <code>N - 1</code> times
(i.e., old attention states will be re-used) before computing the new attention states again.`,name:"temporal_attention_block_skip_range"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.cross_attention_block_skip_range",description:`<strong>cross_attention_block_skip_range</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of times a specific cross-attention broadcast is skipped before computing the attention states
to re-use. If this is set to the value <code>N</code>, the attention computation will be skipped <code>N - 1</code> times (i.e.,
old attention states will be re-used) before computing the new attention states again.`,name:"cross_attention_block_skip_range"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.spatial_attention_timestep_skip_range",description:`<strong>spatial_attention_timestep_skip_range</strong> (<code>Tuple[int, int]</code>, defaults to <code>(100, 800)</code>) &#x2014;
The range of timesteps to skip in the spatial attention layer. The attention computations will be
conditionally skipped if the current timestep is within the specified range.`,name:"spatial_attention_timestep_skip_range"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.temporal_attention_timestep_skip_range",description:`<strong>temporal_attention_timestep_skip_range</strong> (<code>Tuple[int, int]</code>, defaults to <code>(100, 800)</code>) &#x2014;
The range of timesteps to skip in the temporal attention layer. The attention computations will be
conditionally skipped if the current timestep is within the specified range.`,name:"temporal_attention_timestep_skip_range"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.cross_attention_timestep_skip_range",description:`<strong>cross_attention_timestep_skip_range</strong> (<code>Tuple[int, int]</code>, defaults to <code>(100, 800)</code>) &#x2014;
The range of timesteps to skip in the cross-attention layer. The attention computations will be
conditionally skipped if the current timestep is within the specified range.`,name:"cross_attention_timestep_skip_range"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.spatial_attention_block_identifiers",description:`<strong>spatial_attention_block_identifiers</strong> (<code>Tuple[str, ...]</code>, defaults to <code>(&quot;blocks&quot;, &quot;transformer_blocks&quot;)</code>) &#x2014;
The identifiers to match against the layer names to determine if the layer is a spatial attention layer.`,name:"spatial_attention_block_identifiers"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.temporal_attention_block_identifiers",description:`<strong>temporal_attention_block_identifiers</strong> (<code>Tuple[str, ...]</code>, defaults to <code>(&quot;temporal_transformer_blocks&quot;,)</code>) &#x2014;
The identifiers to match against the layer names to determine if the layer is a temporal attention layer.`,name:"temporal_attention_block_identifiers"},{anchor:"diffusers.PyramidAttentionBroadcastConfig.cross_attention_block_identifiers",description:`<strong>cross_attention_block_identifiers</strong> (<code>Tuple[str, ...]</code>, defaults to <code>(&quot;blocks&quot;, &quot;transformer_blocks&quot;)</code>) &#x2014;
The identifiers to match against the layer names to determine if the layer is a cross-attention layer.`,name:"cross_attention_block_identifiers"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/hooks/pyramid_attention_broadcast.py#L36"}}),K=new fe({props:{name:"diffusers.apply_pyramid_attention_broadcast",anchor:"diffusers.apply_pyramid_attention_broadcast",parameters:[{name:"module",val:": Module"},{name:"config",val:": PyramidAttentionBroadcastConfig"}],parametersDescription:[{anchor:"diffusers.apply_pyramid_attention_broadcast.module",description:`<strong>module</strong> (<code>torch.nn.Module</code>) &#x2014;
The module to apply Pyramid Attention Broadcast to.`,name:"module"},{anchor:"diffusers.apply_pyramid_attention_broadcast.config",description:`<strong>config</strong> (<code>Optional[PyramidAttentionBroadcastConfig]</code>, <code>optional</code>, defaults to <code>None</code>) &#x2014;
The configuration to use for Pyramid Attention Broadcast.`,name:"config"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/hooks/pyramid_attention_broadcast.py#L178"}}),F=new Ke({props:{anchor:"diffusers.apply_pyramid_attention_broadcast.example",$$slots:{default:[Mt]},$$scope:{ctx:B}}}),O=new ue({props:{title:"FasterCacheConfig",local:"diffusers.FasterCacheConfig",headingTag:"h3"}}),ee=new fe({props:{name:"class diffusers.FasterCacheConfig",anchor:"diffusers.FasterCacheConfig",parameters:[{name:"spatial_attention_block_skip_range",val:": int = 2"},{name:"temporal_attention_block_skip_range",val:": typing.Optional[int] = None"},{name:"spatial_attention_timestep_skip_range",val:": typing.Tuple[int, int] = (-1, 681)"},{name:"temporal_attention_timestep_skip_range",val:": typing.Tuple[int, int] = (-1, 681)"},{name:"low_frequency_weight_update_timestep_range",val:": typing.Tuple[int, int] = (99, 901)"},{name:"high_frequency_weight_update_timestep_range",val:": typing.Tuple[int, int] = (-1, 301)"},{name:"alpha_low_frequency",val:": float = 1.1"},{name:"alpha_high_frequency",val:": float = 1.1"},{name:"unconditional_batch_skip_range",val:": int = 5"},{name:"unconditional_batch_timestep_skip_range",val:": typing.Tuple[int, int] = (-1, 641)"},{name:"spatial_attention_block_identifiers",val:": typing.Tuple[str, ...] = ('^blocks.*attn', '^transformer_blocks.*attn', '^single_transformer_blocks.*attn')"},{name:"temporal_attention_block_identifiers",val:": typing.Tuple[str, ...] = ('^temporal_transformer_blocks.*attn',)"},{name:"attention_weight_callback",val:": typing.Callable[[torch.nn.modules.module.Module], float] = None"},{name:"low_frequency_weight_callback",val:": typing.Callable[[torch.nn.modules.module.Module], float] = None"},{name:"high_frequency_weight_callback",val:": typing.Callable[[torch.nn.modules.module.Module], float] = None"},{name:"tensor_format",val:": str = 'BCFHW'"},{name:"is_guidance_distilled",val:": bool = False"},{name:"current_timestep_callback",val:": typing.Callable[[], int] = None"},{name:"_unconditional_conditional_input_kwargs_identifiers",val:": typing.List[str] = ('hidden_states', 'encoder_hidden_states', 'timestep', 'attention_mask', 'encoder_attention_mask')"}],parametersDescription:[{anchor:"diffusers.FasterCacheConfig.spatial_attention_block_skip_range",description:`<strong>spatial_attention_block_skip_range</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
Calculate the attention states every <code>N</code> iterations. If this is set to <code>N</code>, the attention computation will
be skipped <code>N - 1</code> times (i.e., cached attention states will be re-used) before computing the new attention
states again.`,name:"spatial_attention_block_skip_range"},{anchor:"diffusers.FasterCacheConfig.temporal_attention_block_skip_range",description:`<strong>temporal_attention_block_skip_range</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Calculate the attention states every <code>N</code> iterations. If this is set to <code>N</code>, the attention computation will
be skipped <code>N - 1</code> times (i.e., cached attention states will be re-used) before computing the new attention
states again.`,name:"temporal_attention_block_skip_range"},{anchor:"diffusers.FasterCacheConfig.spatial_attention_timestep_skip_range",description:`<strong>spatial_attention_timestep_skip_range</strong> (<code>Tuple[float, float]</code>, defaults to <code>(-1, 681)</code>) &#x2014;
The timestep range within which the spatial attention computation can be skipped without a significant loss
in quality. This is to be determined by the user based on the underlying model. The first value in the
tuple is the lower bound and the second value is the upper bound. Typically, diffusion timesteps for
denoising are in the reversed range of 0 to 1000 (i.e. denoising starts at timestep 1000 and ends at
timestep 0). For the default values, this would mean that the spatial attention computation skipping will
be applicable only after denoising timestep 681 is reached, and continue until the end of the denoising
process.`,name:"spatial_attention_timestep_skip_range"},{anchor:"diffusers.FasterCacheConfig.temporal_attention_timestep_skip_range",description:`<strong>temporal_attention_timestep_skip_range</strong> (<code>Tuple[float, float]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The timestep range within which the temporal attention computation can be skipped without a significant
loss in quality. This is to be determined by the user based on the underlying model. The first value in the
tuple is the lower bound and the second value is the upper bound. Typically, diffusion timesteps for
denoising are in the reversed range of 0 to 1000 (i.e. denoising starts at timestep 1000 and ends at
timestep 0).`,name:"temporal_attention_timestep_skip_range"},{anchor:"diffusers.FasterCacheConfig.low_frequency_weight_update_timestep_range",description:`<strong>low_frequency_weight_update_timestep_range</strong> (<code>Tuple[int, int]</code>, defaults to <code>(99, 901)</code>) &#x2014;
The timestep range within which the low frequency weight scaling update is applied. The first value in the
tuple is the lower bound and the second value is the upper bound of the timestep range. The callback
function for the update is called only within this range.`,name:"low_frequency_weight_update_timestep_range"},{anchor:"diffusers.FasterCacheConfig.high_frequency_weight_update_timestep_range",description:`<strong>high_frequency_weight_update_timestep_range</strong> (<code>Tuple[int, int]</code>, defaults to <code>(-1, 301)</code>) &#x2014;
The timestep range within which the high frequency weight scaling update is applied. The first value in the
tuple is the lower bound and the second value is the upper bound of the timestep range. The callback
function for the update is called only within this range.`,name:"high_frequency_weight_update_timestep_range"},{anchor:"diffusers.FasterCacheConfig.alpha_low_frequency",description:`<strong>alpha_low_frequency</strong> (<code>float</code>, defaults to <code>1.1</code>) &#x2014;
The weight to scale the low frequency updates by. This is used to approximate the unconditional branch from
the conditional branch outputs.`,name:"alpha_low_frequency"},{anchor:"diffusers.FasterCacheConfig.alpha_high_frequency",description:`<strong>alpha_high_frequency</strong> (<code>float</code>, defaults to <code>1.1</code>) &#x2014;
The weight to scale the high frequency updates by. This is used to approximate the unconditional branch
from the conditional branch outputs.`,name:"alpha_high_frequency"},{anchor:"diffusers.FasterCacheConfig.unconditional_batch_skip_range",description:`<strong>unconditional_batch_skip_range</strong> (<code>int</code>, defaults to <code>5</code>) &#x2014;
Process the unconditional branch every <code>N</code> iterations. If this is set to <code>N</code>, the unconditional branch
computation will be skipped <code>N - 1</code> times (i.e., cached unconditional branch states will be re-used) before
computing the new unconditional branch states again.`,name:"unconditional_batch_skip_range"},{anchor:"diffusers.FasterCacheConfig.unconditional_batch_timestep_skip_range",description:`<strong>unconditional_batch_timestep_skip_range</strong> (<code>Tuple[float, float]</code>, defaults to <code>(-1, 641)</code>) &#x2014;
The timestep range within which the unconditional branch computation can be skipped without a significant
loss in quality. This is to be determined by the user based on the underlying model. The first value in the
tuple is the lower bound and the second value is the upper bound.`,name:"unconditional_batch_timestep_skip_range"},{anchor:"diffusers.FasterCacheConfig.spatial_attention_block_identifiers",description:`<strong>spatial_attention_block_identifiers</strong> (<code>Tuple[str, ...]</code>, defaults to <code>(&quot;blocks.*attn1&quot;, &quot;transformer_blocks.*attn1&quot;, &quot;single_transformer_blocks.*attn1&quot;)</code>) &#x2014;
The identifiers to match the spatial attention blocks in the model. If the name of the block contains any
of these identifiers, FasterCache will be applied to that block. This can either be the full layer names,
partial layer names, or regex patterns. Matching will always be done using a regex match.`,name:"spatial_attention_block_identifiers"},{anchor:"diffusers.FasterCacheConfig.temporal_attention_block_identifiers",description:`<strong>temporal_attention_block_identifiers</strong> (<code>Tuple[str, ...]</code>, defaults to <code>(&quot;temporal_transformer_blocks.*attn1&quot;,)</code>) &#x2014;
The identifiers to match the temporal attention blocks in the model. If the name of the block contains any
of these identifiers, FasterCache will be applied to that block. This can either be the full layer names,
partial layer names, or regex patterns. Matching will always be done using a regex match.`,name:"temporal_attention_block_identifiers"},{anchor:"diffusers.FasterCacheConfig.attention_weight_callback",description:`<strong>attention_weight_callback</strong> (<code>Callable[[torch.nn.Module], float]</code>, defaults to <code>None</code>) &#x2014;
The callback function to determine the weight to scale the attention outputs by. This function should take
the attention module as input and return a float value. This is used to approximate the unconditional
branch from the conditional branch outputs. If not provided, the default weight is 0.5 for all timesteps.
Typically, as described in the paper, this weight should gradually increase from 0 to 1 as the inference
progresses. Users are encouraged to experiment and provide custom weight schedules that take into account
the number of inference steps and underlying model behaviour as denoising progresses.`,name:"attention_weight_callback"},{anchor:"diffusers.FasterCacheConfig.low_frequency_weight_callback",description:`<strong>low_frequency_weight_callback</strong> (<code>Callable[[torch.nn.Module], float]</code>, defaults to <code>None</code>) &#x2014;
The callback function to determine the weight to scale the low frequency updates by. If not provided, the
default weight is 1.1 for timesteps within the range specified (as described in the paper).`,name:"low_frequency_weight_callback"},{anchor:"diffusers.FasterCacheConfig.high_frequency_weight_callback",description:`<strong>high_frequency_weight_callback</strong> (<code>Callable[[torch.nn.Module], float]</code>, defaults to <code>None</code>) &#x2014;
The callback function to determine the weight to scale the high frequency updates by. If not provided, the
default weight is 1.1 for timesteps within the range specified (as described in the paper).`,name:"high_frequency_weight_callback"},{anchor:"diffusers.FasterCacheConfig.tensor_format",description:`<strong>tensor_format</strong> (<code>str</code>, defaults to <code>&quot;BCFHW&quot;</code>) &#x2014;
The format of the input tensors. This should be one of <code>&quot;BCFHW&quot;</code>, <code>&quot;BFCHW&quot;</code>, or <code>&quot;BCHW&quot;</code>. The format is
used to split individual latent frames in order for low and high frequency components to be computed.`,name:"tensor_format"},{anchor:"diffusers.FasterCacheConfig.is_guidance_distilled",description:`<strong>is_guidance_distilled</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether the model is guidance distilled or not. If the model is guidance distilled, FasterCache will not be
applied at the denoiser-level to skip the unconditional branch computation (as there is none).`,name:"is_guidance_distilled"},{anchor:"diffusers.FasterCacheConfig._unconditional_conditional_input_kwargs_identifiers",description:`<strong>_unconditional_conditional_input_kwargs_identifiers</strong> (<code>List[str]</code>, defaults to <code>(&quot;hidden_states&quot;, &quot;encoder_hidden_states&quot;, &quot;timestep&quot;, &quot;attention_mask&quot;, &quot;encoder_attention_mask&quot;)</code>) &#x2014;
The identifiers to match the input kwargs that contain the batchwise-concatenated unconditional and
conditional inputs. If the name of the input kwargs contains any of these identifiers, FasterCache will
split the inputs into unconditional and conditional branches. This must be a list of exact input kwargs
names that contain the batchwise-concatenated unconditional and conditional inputs.`,name:"_unconditional_conditional_input_kwargs_identifiers"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/hooks/faster_cache.py#L49"}}),te=new fe({props:{name:"diffusers.apply_faster_cache",anchor:"diffusers.apply_faster_cache",parameters:[{name:"module",val:": Module"},{name:"config",val:": FasterCacheConfig"}],parametersDescription:[{anchor:"diffusers.apply_faster_cache.pipeline",description:`<strong>pipeline</strong> (<code>DiffusionPipeline</code>) &#x2014;
The diffusion pipeline to apply FasterCache to.`,name:"pipeline"},{anchor:"diffusers.apply_faster_cache.config",description:`<strong>config</strong> (<code>Optional[FasterCacheConfig]</code>, <code>optional</code>, defaults to <code>None</code>) &#x2014;
The configuration to use for FasterCache.`,name:"config"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/hooks/faster_cache.py#L486"}}),x=new Ke({props:{anchor:"diffusers.apply_faster_cache.example",$$slots:{default:[Tt]},$$scope:{ctx:B}}}),ne=new wt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/cache.md"}}),{c(){l=c("meta"),T=i(),y=c("p"),r=i(),h(m.$$.fragment),a=i(),h(w.$$.fragment),be=i(),N=c("p"),N.innerHTML=et,ye=i(),I=c("p"),I.textContent=tt,we=i(),q=c("p"),q.innerHTML=nt,ke=i(),h(R.$$.fragment),Me=i(),h(Q.$$.fragment),Te=i(),E=c("p"),E.innerHTML=at,Ce=i(),V=c("p"),V.textContent=st,je=i(),A=c("ul"),A.innerHTML=it,Je=i(),h(P.$$.fragment),$e=i(),h(S.$$.fragment),ve=i(),M=c("div"),h(H.$$.fragment),Ie=i(),se=c("p"),se.textContent=ot,qe=i(),ie=c("p"),ie.textContent=lt,Re=i(),oe=c("ul"),oe.innerHTML=rt,Qe=i(),$=c("div"),h(D.$$.fragment),Ee=i(),le=c("p"),le.textContent=ct,Ve=i(),h(W.$$.fragment),Ze=i(),h(z.$$.fragment),Ue=i(),v=c("div"),h(L.$$.fragment),Ae=i(),re=c("p"),re.textContent=pt,Be=i(),C=c("div"),h(K.$$.fragment),Pe=i(),ce=c("p"),ce.innerHTML=dt,Se=i(),pe=c("p"),pe.textContent=mt,He=i(),h(F.$$.fragment),We=i(),h(O.$$.fragment),Fe=i(),Z=c("div"),h(ee.$$.fragment),De=i(),de=c("p"),de.innerHTML=ht,xe=i(),J=c("div"),h(te.$$.fragment),ze=i(),me=c("p"),me.innerHTML=ft,Le=i(),h(x.$$.fragment),Xe=i(),h(ne.$$.fragment),Ge=i(),ge=c("p"),this.h()},l(e){const t=yt("svelte-u9bgzb",document.head);l=p(t,"META",{name:!0,content:!0}),t.forEach(n),T=o(e),y=p(e,"P",{}),G(y).forEach(n),r=o(e),f(m.$$.fragment,e),a=o(e),f(w.$$.fragment,e),be=o(e),N=p(e,"P",{"data-svelte-h":!0}),k(N)!=="svelte-pxfzru"&&(N.innerHTML=et),ye=o(e),I=p(e,"P",{"data-svelte-h":!0}),k(I)!=="svelte-wme9w7"&&(I.textContent=tt),we=o(e),q=p(e,"P",{"data-svelte-h":!0}),k(q)!=="svelte-18yurga"&&(q.innerHTML=nt),ke=o(e),f(R.$$.fragment,e),Me=o(e),f(Q.$$.fragment,e),Te=o(e),E=p(e,"P",{"data-svelte-h":!0}),k(E)!=="svelte-2yyatd"&&(E.innerHTML=at),Ce=o(e),V=p(e,"P",{"data-svelte-h":!0}),k(V)!=="svelte-1yt038j"&&(V.textContent=st),je=o(e),A=p(e,"UL",{"data-svelte-h":!0}),k(A)!=="svelte-1nlgyxs"&&(A.innerHTML=it),Je=o(e),f(P.$$.fragment,e),$e=o(e),f(S.$$.fragment,e),ve=o(e),M=p(e,"DIV",{class:!0});var j=G(M);f(H.$$.fragment,j),Ie=o(j),se=p(j,"P",{"data-svelte-h":!0}),k(se)!=="svelte-1jkm0k7"&&(se.textContent=ot),qe=o(j),ie=p(j,"P",{"data-svelte-h":!0}),k(ie)!=="svelte-x25y7s"&&(ie.textContent=lt),Re=o(j),oe=p(j,"UL",{"data-svelte-h":!0}),k(oe)!=="svelte-n3yfbs"&&(oe.innerHTML=rt),Qe=o(j),$=p(j,"DIV",{class:!0});var U=G($);f(D.$$.fragment,U),Ee=o(U),le=p(U,"P",{"data-svelte-h":!0}),k(le)!=="svelte-1jqtd9a"&&(le.textContent=ct),Ve=o(U),f(W.$$.fragment,U),U.forEach(n),j.forEach(n),Ze=o(e),f(z.$$.fragment,e),Ue=o(e),v=p(e,"DIV",{class:!0});var ae=G(v);f(L.$$.fragment,ae),Ae=o(ae),re=p(ae,"P",{"data-svelte-h":!0}),k(re)!=="svelte-g9nrp2"&&(re.textContent=pt),ae.forEach(n),Be=o(e),C=p(e,"DIV",{class:!0});var X=G(C);f(K.$$.fragment,X),Pe=o(X),ce=p(X,"P",{"data-svelte-h":!0}),k(ce)!=="svelte-1k6n7qf"&&(ce.innerHTML=dt),Se=o(X),pe=p(X,"P",{"data-svelte-h":!0}),k(pe)!=="svelte-1n2zwuf"&&(pe.textContent=mt),He=o(X),f(F.$$.fragment,X),X.forEach(n),We=o(e),f(O.$$.fragment,e),Fe=o(e),Z=p(e,"DIV",{class:!0});var Ne=G(Z);f(ee.$$.fragment,Ne),De=o(Ne),de=p(Ne,"P",{"data-svelte-h":!0}),k(de)!=="svelte-38u0u9"&&(de.innerHTML=ht),Ne.forEach(n),xe=o(e),J=p(e,"DIV",{class:!0});var he=G(J);f(te.$$.fragment,he),ze=o(he),me=p(he,"P",{"data-svelte-h":!0}),k(me)!=="svelte-1v5ielx"&&(me.innerHTML=ft),Le=o(he),f(x.$$.fragment,he),he.forEach(n),Xe=o(e),f(ne.$$.fragment,e),Ge=o(e),ge=p(e,"P",{}),G(ge).forEach(n),this.h()},h(){Y(l,"name","hf:doc:metadata"),Y(l,"content",jt),Y($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Y(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){d(document.head,l),s(e,T,t),s(e,y,t),s(e,r,t),u(m,e,t),s(e,a,t),u(w,e,t),s(e,be,t),s(e,N,t),s(e,ye,t),s(e,I,t),s(e,we,t),s(e,q,t),s(e,ke,t),u(R,e,t),s(e,Me,t),u(Q,e,t),s(e,Te,t),s(e,E,t),s(e,Ce,t),s(e,V,t),s(e,je,t),s(e,A,t),s(e,Je,t),u(P,e,t),s(e,$e,t),u(S,e,t),s(e,ve,t),s(e,M,t),u(H,M,null),d(M,Ie),d(M,se),d(M,qe),d(M,ie),d(M,Re),d(M,oe),d(M,Qe),d(M,$),u(D,$,null),d($,Ee),d($,le),d($,Ve),u(W,$,null),s(e,Ze,t),u(z,e,t),s(e,Ue,t),s(e,v,t),u(L,v,null),d(v,Ae),d(v,re),s(e,Be,t),s(e,C,t),u(K,C,null),d(C,Pe),d(C,ce),d(C,Se),d(C,pe),d(C,He),u(F,C,null),s(e,We,t),u(O,e,t),s(e,Fe,t),s(e,Z,t),u(ee,Z,null),d(Z,De),d(Z,de),s(e,xe,t),s(e,J,t),u(te,J,null),d(J,ze),d(J,me),d(J,Le),u(x,J,null),s(e,Xe,t),u(ne,e,t),s(e,Ge,t),s(e,ge,t),Ye=!0},p(e,[t]){const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),W.$set(j);const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),F.$set(U);const ae={};t&2&&(ae.$$scope={dirty:t,ctx:e}),x.$set(ae)},i(e){Ye||(g(m.$$.fragment,e),g(w.$$.fragment,e),g(R.$$.fragment,e),g(Q.$$.fragment,e),g(P.$$.fragment,e),g(S.$$.fragment,e),g(H.$$.fragment,e),g(D.$$.fragment,e),g(W.$$.fragment,e),g(z.$$.fragment,e),g(L.$$.fragment,e),g(K.$$.fragment,e),g(F.$$.fragment,e),g(O.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(x.$$.fragment,e),g(ne.$$.fragment,e),Ye=!0)},o(e){_(m.$$.fragment,e),_(w.$$.fragment,e),_(R.$$.fragment,e),_(Q.$$.fragment,e),_(P.$$.fragment,e),_(S.$$.fragment,e),_(H.$$.fragment,e),_(D.$$.fragment,e),_(W.$$.fragment,e),_(z.$$.fragment,e),_(L.$$.fragment,e),_(K.$$.fragment,e),_(F.$$.fragment,e),_(O.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(x.$$.fragment,e),_(ne.$$.fragment,e),Ye=!1},d(e){e&&(n(T),n(y),n(r),n(a),n(be),n(N),n(ye),n(I),n(we),n(q),n(ke),n(Me),n(Te),n(E),n(Ce),n(V),n(je),n(A),n(Je),n($e),n(ve),n(M),n(Ze),n(Ue),n(v),n(Be),n(C),n(We),n(Fe),n(Z),n(xe),n(J),n(Xe),n(Ge),n(ge)),n(l),b(m,e),b(w,e),b(R,e),b(Q,e),b(P,e),b(S,e),b(H),b(D),b(W),b(z,e),b(L),b(K),b(F),b(O,e),b(ee),b(te),b(x),b(ne,e)}}}const jt='{"title":"Caching methods","local":"caching-methods","sections":[{"title":"Pyramid Attention Broadcast","local":"pyramid-attention-broadcast","sections":[],"depth":2},{"title":"Faster Cache","local":"faster-cache","sections":[{"title":"CacheMixin","local":"diffusers.CacheMixin","sections":[],"depth":3},{"title":"PyramidAttentionBroadcastConfig","local":"diffusers.PyramidAttentionBroadcastConfig","sections":[],"depth":3},{"title":"FasterCacheConfig","local":"diffusers.FasterCacheConfig","sections":[],"depth":3}],"depth":2}],"depth":1}';function Jt(B){return gt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ft extends _t{constructor(l){super(),bt(this,l,Jt,Ct,ut,{})}}export{Ft as component};
