import{s as We,n as Ye,o as Ee}from"../chunks/scheduler.53228c21.js";import{S as Oe,i as Ve,e as i,s as n,c,h as Ge,a as l,d as o,b as s,f as T,g as p,j as h,k as w,l as a,m as r,n as m,t as f,o as u,p as _}from"../chunks/index.100fac89.js";import{C as Pe}from"../chunks/CopyLLMTxtMenu.999d3d86.js";import{D as X}from"../chunks/Docstring.46d0934e.js";import{C as Xe}from"../chunks/CodeBlock.d30a6509.js";import{H as ye,E as Qe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d27ae4df.js";function Ke(Be){let v,ee,Q,te,N,oe,x,ne,$,Je='SparseControlNetModel is an implementation of ControlNet for <a href="https://huggingface.co/papers/2307.04725" rel="nofollow">AnimateDiff</a>.',se,k,Ie='ControlNet was introduced in <a href="https://huggingface.co/papers/2302.05543" rel="nofollow">Adding Conditional Control to Text-to-Image Diffusion Models</a> by Lvmin Zhang, Anyi Rao, and Maneesh Agrawala.',re,S,Ue='The SparseCtrl version of ControlNet was introduced in <a href="https://huggingface.co/papers/2311.16933" rel="nofollow">SparseCtrl: Adding Sparse Controls to Text-to-Video Diffusion Models</a> for achieving controlled generation in text-to-video diffusion models by Yuwei Guo, Ceyuan Yang, Anyi Rao, Maneesh Agrawala, Dahua Lin, and Bo Dai.',ae,D,je="The abstract from the paper is:",ie,B,qe='<em>The development of text-to-video (T2V), i.e., generating videos with a given text prompt, has been significantly advanced in recent years. However, relying solely on text prompts often results in ambiguous frame composition due to spatial uncertainty. The research community thus leverages the dense structure signals, e.g., per-frame depth/edge sequences, to enhance controllability, whose collection accordingly increases the burden of inference. In this work, we present SparseCtrl to enable flexible structure control with temporally sparse signals, requiring only one or a few inputs, as shown in Figure 1. It incorporates an additional condition encoder to process these sparse signals while leaving the pre-trained T2V model untouched. The proposed approach is compatible with various modalities, including sketches, depth maps, and RGB images, providing more practical control for video generation and promoting applications such as storyboarding, depth rendering, keyframe animation, and interpolation. Extensive experiments demonstrate the generalization of SparseCtrl on both original and personalized T2V generators. Codes and models will be publicly available at <a href="https://guoyww.github.io/projects/SparseCtrl" rel="nofollow">this https URL</a>.</em>',le,J,de,I,ce,U,pe,d,j,Ce,W,Le=`A SparseControlNet model as described in <a href="https://huggingface.co/papers/2311.16933" rel="nofollow">SparseCtrl: Adding Sparse Controls to Text-to-Video Diffusion
Models</a>.`,Me,y,q,Te,Y,Ze='The <a href="/docs/diffusers/main/en/api/models/controlnet_sparsectrl#diffusers.SparseControlNetModel">SparseControlNetModel</a> forward method.',we,C,L,Ne,E,Ae='Instantiate a <a href="/docs/diffusers/main/en/api/models/controlnet_sparsectrl#diffusers.SparseControlNetModel">SparseControlNetModel</a> from <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>.',xe,b,Z,$e,O,ze="Enable sliced attention computation.",ke,V,Fe=`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful for saving some memory in exchange for a small decrease in speed.`,Se,M,A,De,G,He="Disables custom attention processors and sets the default attention implementation.",me,z,fe,F,H,ue,R,_e,K,ge;return N=new Pe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),x=new ye({props:{title:"SparseControlNetModel",local:"sparsecontrolnetmodel",headingTag:"h1"}}),J=new ye({props:{title:"Example for loading SparseControlNetModel",local:"example-for-loading-sparsecontrolnetmodel",headingTag:"h2"}}),I=new Xe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3BhcnNlQ29udHJvbE5ldE1vZGVsJTBBJTBBJTIzJTIwZnAzMiUyMHZhcmlhbnQlMjBpbiUyMGZsb2F0MTYlMEElMjMlMjAxLiUyMFNjcmliYmxlJTIwY2hlY2twb2ludCUwQWNvbnRyb2xuZXQlMjAlM0QlMjBTcGFyc2VDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmd1b3l3dyUyRmFuaW1hdGVkaWZmLXNwYXJzZWN0cmwtc2NyaWJibGUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTBBJTIzJTIwMi4lMjBSR0IlMjBjaGVja3BvaW50JTBBY29udHJvbG5ldCUyMCUzRCUyMFNwYXJzZUNvbnRyb2xOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ3VveXd3JTJGYW5pbWF0ZWRpZmYtc3BhcnNlY3RybC1yZ2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTBBJTIzJTIwRm9yJTIwbG9hZGluZyUyMGZwMTYlMjB2YXJpYW50JTJDJTIwcGFzcyUyMCU2MHZhcmlhbnQlM0QlMjJmcDE2JTIyJTYwJTIwYXMlMjBhbiUyMGFkZGl0aW9uYWwlMjBwYXJhbWV0ZXI=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> SparseControlNetModel

<span class="hljs-comment"># fp32 variant in float16</span>
<span class="hljs-comment"># 1. Scribble checkpoint</span>
controlnet = SparseControlNetModel.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-sparsectrl-scribble&quot;</span>, torch_dtype=torch.float16)

<span class="hljs-comment"># 2. RGB checkpoint</span>
controlnet = SparseControlNetModel.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-sparsectrl-rgb&quot;</span>, torch_dtype=torch.float16)

<span class="hljs-comment"># For loading fp16 variant, pass \`variant=&quot;fp16&quot;\` as an additional parameter</span>`,wrap:!1}}),U=new ye({props:{title:"SparseControlNetModel",local:"diffusers.SparseControlNetModel",headingTag:"h2"}}),j=new X({props:{name:"class diffusers.SparseControlNetModel",anchor:"diffusers.SparseControlNetModel",parameters:[{name:"in_channels",val:": int = 4"},{name:"conditioning_channels",val:": int = 4"},{name:"flip_sin_to_cos",val:": bool = True"},{name:"freq_shift",val:": int = 0"},{name:"down_block_types",val:": typing.Tuple[str, ...] = ('CrossAttnDownBlockMotion', 'CrossAttnDownBlockMotion', 'CrossAttnDownBlockMotion', 'DownBlockMotion')"},{name:"only_cross_attention",val:": typing.Union[bool, typing.Tuple[bool]] = False"},{name:"block_out_channels",val:": typing.Tuple[int, ...] = (320, 640, 1280, 1280)"},{name:"layers_per_block",val:": int = 2"},{name:"downsample_padding",val:": int = 1"},{name:"mid_block_scale_factor",val:": float = 1"},{name:"act_fn",val:": str = 'silu'"},{name:"norm_num_groups",val:": typing.Optional[int] = 32"},{name:"norm_eps",val:": float = 1e-05"},{name:"cross_attention_dim",val:": int = 768"},{name:"transformer_layers_per_block",val:": typing.Union[int, typing.Tuple[int, ...]] = 1"},{name:"transformer_layers_per_mid_block",val:": typing.Union[int, typing.Tuple[int], NoneType] = None"},{name:"temporal_transformer_layers_per_block",val:": typing.Union[int, typing.Tuple[int, ...]] = 1"},{name:"attention_head_dim",val:": typing.Union[int, typing.Tuple[int, ...]] = 8"},{name:"num_attention_heads",val:": typing.Union[int, typing.Tuple[int, ...], NoneType] = None"},{name:"use_linear_projection",val:": bool = False"},{name:"upcast_attention",val:": bool = False"},{name:"resnet_time_scale_shift",val:": str = 'default'"},{name:"conditioning_embedding_out_channels",val:": typing.Optional[typing.Tuple[int, ...]] = (16, 32, 96, 256)"},{name:"global_pool_conditions",val:": bool = False"},{name:"controlnet_conditioning_channel_order",val:": str = 'rgb'"},{name:"motion_max_seq_length",val:": int = 32"},{name:"motion_num_attention_heads",val:": int = 8"},{name:"concat_conditioning_mask",val:": bool = True"},{name:"use_simplified_condition_embedding",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.SparseControlNetModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to 4) &#x2014;
The number of channels in the input sample.`,name:"in_channels"},{anchor:"diffusers.SparseControlNetModel.conditioning_channels",description:`<strong>conditioning_channels</strong> (<code>int</code>, defaults to 4) &#x2014;
The number of input channels in the controlnet conditional embedding module. If
<code>concat_condition_embedding</code> is True, the value provided here is incremented by 1.`,name:"conditioning_channels"},{anchor:"diffusers.SparseControlNetModel.flip_sin_to_cos",description:`<strong>flip_sin_to_cos</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to flip the sin to cos in the time embedding.`,name:"flip_sin_to_cos"},{anchor:"diffusers.SparseControlNetModel.freq_shift",description:`<strong>freq_shift</strong> (<code>int</code>, defaults to 0) &#x2014;
The frequency shift to apply to the time embedding.`,name:"freq_shift"},{anchor:"diffusers.SparseControlNetModel.down_block_types",description:`<strong>down_block_types</strong> (<code>tuple[str]</code>, defaults to <code>(&quot;CrossAttnDownBlock2D&quot;, &quot;CrossAttnDownBlock2D&quot;, &quot;CrossAttnDownBlock2D&quot;, &quot;DownBlock2D&quot;)</code>) &#x2014;
The tuple of downsample blocks to use.`,name:"down_block_types"},{anchor:"diffusers.SparseControlNetModel.only_cross_attention",description:"<strong>only_cross_attention</strong> (<code>Union[bool, Tuple[bool]]</code>, defaults to <code>False</code>) &#x2014;",name:"only_cross_attention"},{anchor:"diffusers.SparseControlNetModel.block_out_channels",description:`<strong>block_out_channels</strong> (<code>tuple[int]</code>, defaults to <code>(320, 640, 1280, 1280)</code>) &#x2014;
The tuple of output channels for each block.`,name:"block_out_channels"},{anchor:"diffusers.SparseControlNetModel.layers_per_block",description:`<strong>layers_per_block</strong> (<code>int</code>, defaults to 2) &#x2014;
The number of layers per block.`,name:"layers_per_block"},{anchor:"diffusers.SparseControlNetModel.downsample_padding",description:`<strong>downsample_padding</strong> (<code>int</code>, defaults to 1) &#x2014;
The padding to use for the downsampling convolution.`,name:"downsample_padding"},{anchor:"diffusers.SparseControlNetModel.mid_block_scale_factor",description:`<strong>mid_block_scale_factor</strong> (<code>float</code>, defaults to 1) &#x2014;
The scale factor to use for the mid block.`,name:"mid_block_scale_factor"},{anchor:"diffusers.SparseControlNetModel.act_fn",description:`<strong>act_fn</strong> (<code>str</code>, defaults to &#x201C;silu&#x201D;) &#x2014;
The activation function to use.`,name:"act_fn"},{anchor:"diffusers.SparseControlNetModel.norm_num_groups",description:`<strong>norm_num_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of groups to use for the normalization. If None, normalization and activation layers is skipped
in post-processing.`,name:"norm_num_groups"},{anchor:"diffusers.SparseControlNetModel.norm_eps",description:`<strong>norm_eps</strong> (<code>float</code>, defaults to 1e-5) &#x2014;
The epsilon to use for the normalization.`,name:"norm_eps"},{anchor:"diffusers.SparseControlNetModel.cross_attention_dim",description:`<strong>cross_attention_dim</strong> (<code>int</code>, defaults to 1280) &#x2014;
The dimension of the cross attention features.`,name:"cross_attention_dim"},{anchor:"diffusers.SparseControlNetModel.transformer_layers_per_block",description:`<strong>transformer_layers_per_block</strong> (<code>int</code> or <code>Tuple[int]</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of transformer blocks of type <code>BasicTransformerBlock</code>. Only relevant for
<code>~models.unet_2d_blocks.CrossAttnDownBlock2D</code>, <code>~models.unet_2d_blocks.CrossAttnUpBlock2D</code>,
<code>~models.unet_2d_blocks.UNetMidBlock2DCrossAttn</code>.`,name:"transformer_layers_per_block"},{anchor:"diffusers.SparseControlNetModel.transformer_layers_per_mid_block",description:`<strong>transformer_layers_per_mid_block</strong> (<code>int</code> or <code>Tuple[int]</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of transformer layers to use in each layer in the middle block.`,name:"transformer_layers_per_mid_block"},{anchor:"diffusers.SparseControlNetModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code> or <code>Tuple[int]</code>, defaults to 8) &#x2014;
The dimension of the attention heads.`,name:"attention_head_dim"},{anchor:"diffusers.SparseControlNetModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code> or <code>Tuple[int]</code>, <em>optional</em>) &#x2014;
The number of heads to use for multi-head attention.`,name:"num_attention_heads"},{anchor:"diffusers.SparseControlNetModel.use_linear_projection",description:"<strong>use_linear_projection</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;",name:"use_linear_projection"},{anchor:"diffusers.SparseControlNetModel.upcast_attention",description:"<strong>upcast_attention</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;",name:"upcast_attention"},{anchor:"diffusers.SparseControlNetModel.resnet_time_scale_shift",description:`<strong>resnet_time_scale_shift</strong> (<code>str</code>, defaults to <code>&quot;default&quot;</code>) &#x2014;
Time scale shift config for ResNet blocks (see <code>ResnetBlock2D</code>). Choose from <code>default</code> or <code>scale_shift</code>.`,name:"resnet_time_scale_shift"},{anchor:"diffusers.SparseControlNetModel.conditioning_embedding_out_channels",description:`<strong>conditioning_embedding_out_channels</strong> (<code>Tuple[int]</code>, defaults to <code>(16, 32, 96, 256)</code>) &#x2014;
The tuple of output channel for each block in the <code>conditioning_embedding</code> layer.`,name:"conditioning_embedding_out_channels"},{anchor:"diffusers.SparseControlNetModel.global_pool_conditions",description:`<strong>global_pool_conditions</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
TODO(Patrick) - unused parameter`,name:"global_pool_conditions"},{anchor:"diffusers.SparseControlNetModel.controlnet_conditioning_channel_order",description:"<strong>controlnet_conditioning_channel_order</strong> (<code>str</code>, defaults to <code>rgb</code>) &#x2014;",name:"controlnet_conditioning_channel_order"},{anchor:"diffusers.SparseControlNetModel.motion_max_seq_length",description:`<strong>motion_max_seq_length</strong> (<code>int</code>, defaults to <code>32</code>) &#x2014;
The maximum sequence length to use in the motion module.`,name:"motion_max_seq_length"},{anchor:"diffusers.SparseControlNetModel.motion_num_attention_heads",description:`<strong>motion_num_attention_heads</strong> (<code>int</code> or <code>Tuple[int]</code>, defaults to <code>8</code>) &#x2014;
The number of heads to use in each attention layer of the motion module.`,name:"motion_num_attention_heads"},{anchor:"diffusers.SparseControlNetModel.concat_conditioning_mask",description:"<strong>concat_conditioning_mask</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;",name:"concat_conditioning_mask"},{anchor:"diffusers.SparseControlNetModel.use_simplified_condition_embedding",description:"<strong>use_simplified_condition_embedding</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;",name:"use_simplified_condition_embedding"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L96"}}),q=new X({props:{name:"forward",anchor:"diffusers.SparseControlNetModel.forward",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": typing.Union[torch.Tensor, float, int]"},{name:"encoder_hidden_states",val:": Tensor"},{name:"controlnet_cond",val:": Tensor"},{name:"conditioning_scale",val:": float = 1.0"},{name:"timestep_cond",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"conditioning_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"guess_mode",val:": bool = False"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.SparseControlNetModel.forward.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
The noisy input tensor.`,name:"sample"},{anchor:"diffusers.SparseControlNetModel.forward.timestep",description:`<strong>timestep</strong> (<code>Union[torch.Tensor, float, int]</code>) &#x2014;
The number of timesteps to denoise an input.`,name:"timestep"},{anchor:"diffusers.SparseControlNetModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</code>) &#x2014;
The encoder hidden states.`,name:"encoder_hidden_states"},{anchor:"diffusers.SparseControlNetModel.forward.controlnet_cond",description:`<strong>controlnet_cond</strong> (<code>torch.Tensor</code>) &#x2014;
The conditional input tensor of shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"controlnet_cond"},{anchor:"diffusers.SparseControlNetModel.forward.conditioning_scale",description:`<strong>conditioning_scale</strong> (<code>float</code>, defaults to <code>1.0</code>) &#x2014;
The scale factor for ControlNet outputs.`,name:"conditioning_scale"},{anchor:"diffusers.SparseControlNetModel.forward.class_labels",description:`<strong>class_labels</strong> (<code>torch.Tensor</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Optional class labels for conditioning. Their embeddings will be summed with the timestep embeddings.`,name:"class_labels"},{anchor:"diffusers.SparseControlNetModel.forward.timestep_cond",description:`<strong>timestep_cond</strong> (<code>torch.Tensor</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Additional conditional embeddings for timestep. If provided, the embeddings will be summed with the
timestep_embedding passed through the <code>self.time_embedding</code> layer to obtain the final timestep
embeddings.`,name:"timestep_cond"},{anchor:"diffusers.SparseControlNetModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An attention mask of shape <code>(batch, key_tokens)</code> is applied to <code>encoder_hidden_states</code>. If <code>1</code> the mask
is kept, otherwise if <code>0</code> it is discarded. Mask will be converted into a bias, which adds large
negative values to the attention scores corresponding to &#x201C;discard&#x201D; tokens.`,name:"attention_mask"},{anchor:"diffusers.SparseControlNetModel.forward.added_cond_kwargs",description:`<strong>added_cond_kwargs</strong> (<code>dict</code>) &#x2014;
Additional conditions for the Stable Diffusion XL UNet.`,name:"added_cond_kwargs"},{anchor:"diffusers.SparseControlNetModel.forward.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict[str]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttnProcessor</code>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.SparseControlNetModel.forward.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder tries its best to recognize the input content of the input even if
you remove all prompts. A <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.SparseControlNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>ControlNetOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L533",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, a <code>ControlNetOutput</code> is returned, otherwise a tuple is
returned where the first element is the sample tensor.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ControlNetOutput</code> <strong>or</strong> <code>tuple</code></p>
`}}),L=new X({props:{name:"from_unet",anchor:"diffusers.SparseControlNetModel.from_unet",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet_conditioning_channel_order",val:": str = 'rgb'"},{name:"conditioning_embedding_out_channels",val:": typing.Optional[typing.Tuple[int, ...]] = (16, 32, 96, 256)"},{name:"load_weights_from_unet",val:": bool = True"},{name:"conditioning_channels",val:": int = 3"}],parametersDescription:[{anchor:"diffusers.SparseControlNetModel.from_unet.unet",description:`<strong>unet</strong> (<code>UNet2DConditionModel</code>) &#x2014;
The UNet model weights to copy to the <a href="/docs/diffusers/main/en/api/models/controlnet_sparsectrl#diffusers.SparseControlNetModel">SparseControlNetModel</a>. All configuration options are also
copied where applicable.`,name:"unet"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L387"}}),Z=new X({props:{name:"set_attention_slice",anchor:"diffusers.SparseControlNetModel.set_attention_slice",parameters:[{name:"slice_size",val:": typing.Union[str, int, typing.List[int]]"}],parametersDescription:[{anchor:"diffusers.SparseControlNetModel.set_attention_slice.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code> or <code>list(int)</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, input to the attention heads is halved, so attention is computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory is saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L468"}}),A=new X({props:{name:"set_default_attn_processor",anchor:"diffusers.SparseControlNetModel.set_default_attn_processor",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L452"}}),z=new ye({props:{title:"SparseControlNetOutput",local:"diffusers.models.controlnet_sparsectrl.SparseControlNetOutput",headingTag:"h2"}}),H=new X({props:{name:"class diffusers.models.controlnet_sparsectrl.SparseControlNetOutput",anchor:"diffusers.models.controlnet_sparsectrl.SparseControlNetOutput",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnet_sparsectrl.py#L30"}}),R=new Qe({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/controlnet_sparsectrl.md"}}),{c(){v=i("meta"),ee=n(),Q=i("p"),te=n(),c(N.$$.fragment),oe=n(),c(x.$$.fragment),ne=n(),$=i("p"),$.innerHTML=Je,se=n(),k=i("p"),k.innerHTML=Ie,re=n(),S=i("p"),S.innerHTML=Ue,ae=n(),D=i("p"),D.textContent=je,ie=n(),B=i("p"),B.innerHTML=qe,le=n(),c(J.$$.fragment),de=n(),c(I.$$.fragment),ce=n(),c(U.$$.fragment),pe=n(),d=i("div"),c(j.$$.fragment),Ce=n(),W=i("p"),W.innerHTML=Le,Me=n(),y=i("div"),c(q.$$.fragment),Te=n(),Y=i("p"),Y.innerHTML=Ze,we=n(),C=i("div"),c(L.$$.fragment),Ne=n(),E=i("p"),E.innerHTML=Ae,xe=n(),b=i("div"),c(Z.$$.fragment),$e=n(),O=i("p"),O.textContent=ze,ke=n(),V=i("p"),V.textContent=Fe,Se=n(),M=i("div"),c(A.$$.fragment),De=n(),G=i("p"),G.textContent=He,me=n(),c(z.$$.fragment),fe=n(),F=i("div"),c(H.$$.fragment),ue=n(),c(R.$$.fragment),_e=n(),K=i("p"),this.h()},l(e){const t=Ge("svelte-u9bgzb",document.head);v=l(t,"META",{name:!0,content:!0}),t.forEach(o),ee=s(e),Q=l(e,"P",{}),T(Q).forEach(o),te=s(e),p(N.$$.fragment,e),oe=s(e),p(x.$$.fragment,e),ne=s(e),$=l(e,"P",{"data-svelte-h":!0}),h($)!=="svelte-11my3xx"&&($.innerHTML=Je),se=s(e),k=l(e,"P",{"data-svelte-h":!0}),h(k)!=="svelte-1v2xz23"&&(k.innerHTML=Ie),re=s(e),S=l(e,"P",{"data-svelte-h":!0}),h(S)!=="svelte-1pcd88w"&&(S.innerHTML=Ue),ae=s(e),D=l(e,"P",{"data-svelte-h":!0}),h(D)!=="svelte-1cwsb16"&&(D.textContent=je),ie=s(e),B=l(e,"P",{"data-svelte-h":!0}),h(B)!=="svelte-uew8uc"&&(B.innerHTML=qe),le=s(e),p(J.$$.fragment,e),de=s(e),p(I.$$.fragment,e),ce=s(e),p(U.$$.fragment,e),pe=s(e),d=l(e,"DIV",{class:!0});var g=T(d);p(j.$$.fragment,g),Ce=s(g),W=l(g,"P",{"data-svelte-h":!0}),h(W)!=="svelte-1w3vs31"&&(W.innerHTML=Le),Me=s(g),y=l(g,"DIV",{class:!0});var he=T(y);p(q.$$.fragment,he),Te=s(he),Y=l(he,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-ul1ug5"&&(Y.innerHTML=Ze),he.forEach(o),we=s(g),C=l(g,"DIV",{class:!0});var be=T(C);p(L.$$.fragment,be),Ne=s(be),E=l(be,"P",{"data-svelte-h":!0}),h(E)!=="svelte-24gfcg"&&(E.innerHTML=Ae),be.forEach(o),xe=s(g),b=l(g,"DIV",{class:!0});var P=T(b);p(Z.$$.fragment,P),$e=s(P),O=l(P,"P",{"data-svelte-h":!0}),h(O)!=="svelte-7fahc0"&&(O.textContent=ze),ke=s(P),V=l(P,"P",{"data-svelte-h":!0}),h(V)!=="svelte-1yjwkav"&&(V.textContent=Fe),P.forEach(o),Se=s(g),M=l(g,"DIV",{class:!0});var ve=T(M);p(A.$$.fragment,ve),De=s(ve),G=l(ve,"P",{"data-svelte-h":!0}),h(G)!=="svelte-1lxcwhv"&&(G.textContent=He),ve.forEach(o),g.forEach(o),me=s(e),p(z.$$.fragment,e),fe=s(e),F=l(e,"DIV",{class:!0});var Re=T(F);p(H.$$.fragment,Re),Re.forEach(o),ue=s(e),p(R.$$.fragment,e),_e=s(e),K=l(e,"P",{}),T(K).forEach(o),this.h()},h(){w(v,"name","hf:doc:metadata"),w(v,"content",et),w(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(F,"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){a(document.head,v),r(e,ee,t),r(e,Q,t),r(e,te,t),m(N,e,t),r(e,oe,t),m(x,e,t),r(e,ne,t),r(e,$,t),r(e,se,t),r(e,k,t),r(e,re,t),r(e,S,t),r(e,ae,t),r(e,D,t),r(e,ie,t),r(e,B,t),r(e,le,t),m(J,e,t),r(e,de,t),m(I,e,t),r(e,ce,t),m(U,e,t),r(e,pe,t),r(e,d,t),m(j,d,null),a(d,Ce),a(d,W),a(d,Me),a(d,y),m(q,y,null),a(y,Te),a(y,Y),a(d,we),a(d,C),m(L,C,null),a(C,Ne),a(C,E),a(d,xe),a(d,b),m(Z,b,null),a(b,$e),a(b,O),a(b,ke),a(b,V),a(d,Se),a(d,M),m(A,M,null),a(M,De),a(M,G),r(e,me,t),m(z,e,t),r(e,fe,t),r(e,F,t),m(H,F,null),r(e,ue,t),m(R,e,t),r(e,_e,t),r(e,K,t),ge=!0},p:Ye,i(e){ge||(f(N.$$.fragment,e),f(x.$$.fragment,e),f(J.$$.fragment,e),f(I.$$.fragment,e),f(U.$$.fragment,e),f(j.$$.fragment,e),f(q.$$.fragment,e),f(L.$$.fragment,e),f(Z.$$.fragment,e),f(A.$$.fragment,e),f(z.$$.fragment,e),f(H.$$.fragment,e),f(R.$$.fragment,e),ge=!0)},o(e){u(N.$$.fragment,e),u(x.$$.fragment,e),u(J.$$.fragment,e),u(I.$$.fragment,e),u(U.$$.fragment,e),u(j.$$.fragment,e),u(q.$$.fragment,e),u(L.$$.fragment,e),u(Z.$$.fragment,e),u(A.$$.fragment,e),u(z.$$.fragment,e),u(H.$$.fragment,e),u(R.$$.fragment,e),ge=!1},d(e){e&&(o(ee),o(Q),o(te),o(oe),o(ne),o($),o(se),o(k),o(re),o(S),o(ae),o(D),o(ie),o(B),o(le),o(de),o(ce),o(pe),o(d),o(me),o(fe),o(F),o(ue),o(_e),o(K)),o(v),_(N,e),_(x,e),_(J,e),_(I,e),_(U,e),_(j),_(q),_(L),_(Z),_(A),_(z,e),_(H),_(R,e)}}}const et='{"title":"SparseControlNetModel","local":"sparsecontrolnetmodel","sections":[{"title":"Example for loading SparseControlNetModel","local":"example-for-loading-sparsecontrolnetmodel","sections":[],"depth":2},{"title":"SparseControlNetModel","local":"diffusers.SparseControlNetModel","sections":[],"depth":2},{"title":"SparseControlNetOutput","local":"diffusers.models.controlnet_sparsectrl.SparseControlNetOutput","sections":[],"depth":2}],"depth":1}';function tt(Be){return Ee(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class lt extends Oe{constructor(v){super(),Ve(this,v,tt,Ke,We,{})}}export{lt as component};
