import{s as Pe,n as Ge,o as Xe}from"../chunks/scheduler.8c3d61f6.js";import{S as Qe,i as Ke,g as i,s as n,r as p,A as eo,h as l,f as o,c as s,j as C,u as m,x as g,k as M,y as r,a,v as f,d as u,t as _,w as h}from"../chunks/index.da70eac4.js";import{D as V}from"../chunks/Docstring.6b390b9a.js";import{C as oo}from"../chunks/CodeBlock.00a903b3.js";import{H as we,E as to}from"../chunks/EditOnGithub.1e64e623.js";function no(je){let v,te,ee,ne,N,se,$,qe='SparseControlNetModel is an implementation of ControlNet for <a href="https://arxiv.org/abs/2307.04725" rel="nofollow">AnimateDiff</a>.',re,k,Ae='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.',ae,S,Ze='The SparseCtrl version of ControlNet was introduced in <a href="https://arxiv.org/abs/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.',ie,D,Le="The abstract from the paper is:",le,B,ze='<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>',de,I,ce,J,pe,U,me,d,j,Te,W,Fe=`A SparseControlNet model as described in <a href="https://arxiv.org/abs/2311.16933" rel="nofollow">SparseCtrl: Adding Sparse Controls to Text-to-Video Diffusion
Models</a>.`,ye,w,q,xe,Y,He='The <a href="/docs/diffusers/pr_7018/en/api/models/controlnet_sparsectrl#diffusers.SparseControlNetModel">SparseControlNetModel</a> forward method.',Ne,T,A,$e,O,Ee='Instantiate a <a href="/docs/diffusers/pr_7018/en/api/models/controlnet_sparsectrl#diffusers.SparseControlNetModel">SparseControlNetModel</a> from <a href="/docs/diffusers/pr_7018/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>.',ke,b,Z,Se,P,Re="Enable sliced attention computation.",De,G,Ve=`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.`,Be,y,L,Ie,X,We="Sets the attention processor to use to compute attention.",Je,x,z,Ue,Q,Ye="Disables custom attention processors and sets the default attention implementation.",fe,F,ue,H,E,_e,R,he,oe,ge;return N=new we({props:{title:"SparseControlNetModel",local:"sparsecontrolnetmodel",headingTag:"h1"}}),I=new we({props:{title:"Example for loading SparseControlNetModel",local:"example-for-loading-sparsecontrolnetmodel",headingTag:"h2"}}),J=new oo({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 we({props:{title:"SparseControlNetModel",local:"diffusers.SparseControlNetModel",headingTag:"h2"}}),j=new V({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:": Tuple = ('CrossAttnDownBlockMotion', 'CrossAttnDownBlockMotion', 'CrossAttnDownBlockMotion', 'DownBlockMotion')"},{name:"only_cross_attention",val:": Union = False"},{name:"block_out_channels",val:": Tuple = (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:": Optional = 32"},{name:"norm_eps",val:": float = 1e-05"},{name:"cross_attention_dim",val:": int = 768"},{name:"transformer_layers_per_block",val:": Union = 1"},{name:"transformer_layers_per_mid_block",val:": Union = None"},{name:"temporal_transformer_layers_per_block",val:": Union = 1"},{name:"attention_head_dim",val:": Union = 8"},{name:"num_attention_heads",val:": Union = 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:": Optional = (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/vr_7018/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L96"}}),q=new V({props:{name:"forward",anchor:"diffusers.SparseControlNetModel.forward",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": Union"},{name:"encoder_hidden_states",val:": Tensor"},{name:"controlnet_cond",val:": Tensor"},{name:"conditioning_scale",val:": float = 1.0"},{name:"timestep_cond",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"cross_attention_kwargs",val:": Optional = None"},{name:"conditioning_mask",val:": Optional = 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/vr_7018/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L597",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>
`}}),A=new V({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:": Optional = (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/pr_7018/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/vr_7018/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L387"}}),Z=new V({props:{name:"set_attention_slice",anchor:"diffusers.SparseControlNetModel.set_attention_slice",parameters:[{name:"slice_size",val:": Union"}],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/vr_7018/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L528"}}),L=new V({props:{name:"set_attn_processor",anchor:"diffusers.SparseControlNetModel.set_attn_processor",parameters:[{name:"processor",val:": Union"}],parametersDescription:[{anchor:"diffusers.SparseControlNetModel.set_attn_processor.processor",description:`<strong>processor</strong> (<code>dict</code> of <code>AttentionProcessor</code> or only <code>AttentionProcessor</code>) &#x2014;
The instantiated processor class or a dictionary of processor classes that will be set as the processor
for <strong>all</strong> <code>Attention</code> layers.</p>
<p>If <code>processor</code> is a dict, the key needs to define the path to the corresponding cross attention
processor. This is strongly recommended when setting trainable attention processors.`,name:"processor"}],source:"https://github.com/huggingface/diffusers/blob/vr_7018/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L477"}}),z=new V({props:{name:"set_default_attn_processor",anchor:"diffusers.SparseControlNetModel.set_default_attn_processor",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_7018/src/diffusers/models/controlnets/controlnet_sparsectrl.py#L512"}}),F=new we({props:{title:"SparseControlNetOutput",local:"diffusers.models.controlnet_sparsectrl.SparseControlNetOutput",headingTag:"h2"}}),E=new V({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/vr_7018/src/diffusers/models/controlnet_sparsectrl.py#L28"}}),R=new to({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/controlnet_sparsectrl.md"}}),{c(){v=i("meta"),te=n(),ee=i("p"),ne=n(),p(N.$$.fragment),se=n(),$=i("p"),$.innerHTML=qe,re=n(),k=i("p"),k.innerHTML=Ae,ae=n(),S=i("p"),S.innerHTML=Ze,ie=n(),D=i("p"),D.textContent=Le,le=n(),B=i("p"),B.innerHTML=ze,de=n(),p(I.$$.fragment),ce=n(),p(J.$$.fragment),pe=n(),p(U.$$.fragment),me=n(),d=i("div"),p(j.$$.fragment),Te=n(),W=i("p"),W.innerHTML=Fe,ye=n(),w=i("div"),p(q.$$.fragment),xe=n(),Y=i("p"),Y.innerHTML=He,Ne=n(),T=i("div"),p(A.$$.fragment),$e=n(),O=i("p"),O.innerHTML=Ee,ke=n(),b=i("div"),p(Z.$$.fragment),Se=n(),P=i("p"),P.textContent=Re,De=n(),G=i("p"),G.textContent=Ve,Be=n(),y=i("div"),p(L.$$.fragment),Ie=n(),X=i("p"),X.textContent=We,Je=n(),x=i("div"),p(z.$$.fragment),Ue=n(),Q=i("p"),Q.textContent=Ye,fe=n(),p(F.$$.fragment),ue=n(),H=i("div"),p(E.$$.fragment),_e=n(),p(R.$$.fragment),he=n(),oe=i("p"),this.h()},l(e){const t=eo("svelte-u9bgzb",document.head);v=l(t,"META",{name:!0,content:!0}),t.forEach(o),te=s(e),ee=l(e,"P",{}),C(ee).forEach(o),ne=s(e),m(N.$$.fragment,e),se=s(e),$=l(e,"P",{"data-svelte-h":!0}),g($)!=="svelte-3bkh7w"&&($.innerHTML=qe),re=s(e),k=l(e,"P",{"data-svelte-h":!0}),g(k)!=="svelte-1v2xz23"&&(k.innerHTML=Ae),ae=s(e),S=l(e,"P",{"data-svelte-h":!0}),g(S)!=="svelte-1jv73o9"&&(S.innerHTML=Ze),ie=s(e),D=l(e,"P",{"data-svelte-h":!0}),g(D)!=="svelte-1cwsb16"&&(D.textContent=Le),le=s(e),B=l(e,"P",{"data-svelte-h":!0}),g(B)!=="svelte-uew8uc"&&(B.innerHTML=ze),de=s(e),m(I.$$.fragment,e),ce=s(e),m(J.$$.fragment,e),pe=s(e),m(U.$$.fragment,e),me=s(e),d=l(e,"DIV",{class:!0});var c=C(d);m(j.$$.fragment,c),Te=s(c),W=l(c,"P",{"data-svelte-h":!0}),g(W)!=="svelte-1kqamro"&&(W.innerHTML=Fe),ye=s(c),w=l(c,"DIV",{class:!0});var be=C(w);m(q.$$.fragment,be),xe=s(be),Y=l(be,"P",{"data-svelte-h":!0}),g(Y)!=="svelte-gdxo91"&&(Y.innerHTML=He),be.forEach(o),Ne=s(c),T=l(c,"DIV",{class:!0});var ve=C(T);m(A.$$.fragment,ve),$e=s(ve),O=l(ve,"P",{"data-svelte-h":!0}),g(O)!=="svelte-khmu0k"&&(O.innerHTML=Ee),ve.forEach(o),ke=s(c),b=l(c,"DIV",{class:!0});var K=C(b);m(Z.$$.fragment,K),Se=s(K),P=l(K,"P",{"data-svelte-h":!0}),g(P)!=="svelte-7fahc0"&&(P.textContent=Re),De=s(K),G=l(K,"P",{"data-svelte-h":!0}),g(G)!=="svelte-1yjwkav"&&(G.textContent=Ve),K.forEach(o),Be=s(c),y=l(c,"DIV",{class:!0});var Ce=C(y);m(L.$$.fragment,Ce),Ie=s(Ce),X=l(Ce,"P",{"data-svelte-h":!0}),g(X)!=="svelte-1o77hl2"&&(X.textContent=We),Ce.forEach(o),Je=s(c),x=l(c,"DIV",{class:!0});var Me=C(x);m(z.$$.fragment,Me),Ue=s(Me),Q=l(Me,"P",{"data-svelte-h":!0}),g(Q)!=="svelte-1lxcwhv"&&(Q.textContent=Ye),Me.forEach(o),c.forEach(o),fe=s(e),m(F.$$.fragment,e),ue=s(e),H=l(e,"DIV",{class:!0});var Oe=C(H);m(E.$$.fragment,Oe),Oe.forEach(o),_e=s(e),m(R.$$.fragment,e),he=s(e),oe=l(e,"P",{}),C(oe).forEach(o),this.h()},h(){M(v,"name","hf:doc:metadata"),M(v,"content",so),M(w,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(H,"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){r(document.head,v),a(e,te,t),a(e,ee,t),a(e,ne,t),f(N,e,t),a(e,se,t),a(e,$,t),a(e,re,t),a(e,k,t),a(e,ae,t),a(e,S,t),a(e,ie,t),a(e,D,t),a(e,le,t),a(e,B,t),a(e,de,t),f(I,e,t),a(e,ce,t),f(J,e,t),a(e,pe,t),f(U,e,t),a(e,me,t),a(e,d,t),f(j,d,null),r(d,Te),r(d,W),r(d,ye),r(d,w),f(q,w,null),r(w,xe),r(w,Y),r(d,Ne),r(d,T),f(A,T,null),r(T,$e),r(T,O),r(d,ke),r(d,b),f(Z,b,null),r(b,Se),r(b,P),r(b,De),r(b,G),r(d,Be),r(d,y),f(L,y,null),r(y,Ie),r(y,X),r(d,Je),r(d,x),f(z,x,null),r(x,Ue),r(x,Q),a(e,fe,t),f(F,e,t),a(e,ue,t),a(e,H,t),f(E,H,null),a(e,_e,t),f(R,e,t),a(e,he,t),a(e,oe,t),ge=!0},p:Ge,i(e){ge||(u(N.$$.fragment,e),u(I.$$.fragment,e),u(J.$$.fragment,e),u(U.$$.fragment,e),u(j.$$.fragment,e),u(q.$$.fragment,e),u(A.$$.fragment,e),u(Z.$$.fragment,e),u(L.$$.fragment,e),u(z.$$.fragment,e),u(F.$$.fragment,e),u(E.$$.fragment,e),u(R.$$.fragment,e),ge=!0)},o(e){_(N.$$.fragment,e),_(I.$$.fragment,e),_(J.$$.fragment,e),_(U.$$.fragment,e),_(j.$$.fragment,e),_(q.$$.fragment,e),_(A.$$.fragment,e),_(Z.$$.fragment,e),_(L.$$.fragment,e),_(z.$$.fragment,e),_(F.$$.fragment,e),_(E.$$.fragment,e),_(R.$$.fragment,e),ge=!1},d(e){e&&(o(te),o(ee),o(ne),o(se),o($),o(re),o(k),o(ae),o(S),o(ie),o(D),o(le),o(B),o(de),o(ce),o(pe),o(me),o(d),o(fe),o(ue),o(H),o(_e),o(he),o(oe)),o(v),h(N,e),h(I,e),h(J,e),h(U,e),h(j),h(q),h(A),h(Z),h(L),h(z),h(F,e),h(E),h(R,e)}}}const so='{"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 ro(je){return Xe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class mo extends Qe{constructor(v){super(),Ke(this,v,ro,no,Pe,{})}}export{mo as component};
