import{S as _s,i as gs,s as bs,e as n,k as d,w as h,t as a,M as vs,c as s,d as t,m as c,a as r,x as _,h as i,b as l,G as e,g as p,y as g,L as ys,q as b,o as v,B as y,v as Ns}from"../../../chunks/vendor-hf-doc-builder.js";import{D as T}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as ws}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ie}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Cs(yn){let $,mo,A,O,Je,H,Go,Le,Wo,uo,I,Xo,K,Yo,Ho,ho,Me,Ko,_o,ke,Be,Qo,go,E,J,Se,Q,et,Ve,ot,bo,w,tt,Te,nt,st,$e,rt,lt,ze,at,it,vo,ee,yo,D,L,Re,oe,dt,Ze,ct,No,m,te,ft,Ge,pt,mt,B,ne,ut,se,ht,Ae,_t,gt,bt,S,re,vt,F,yt,Ee,Nt,wt,De,Ct,xt,Mt,k,le,kt,We,Tt,$t,Xe,At,Et,V,ae,Dt,Ye,Ft,Pt,z,ie,Ut,He,qt,wo,P,R,Ke,de,jt,Qe,Ot,Co,U,ce,It,fe,Jt,Fe,Lt,Bt,xo,q,Z,eo,pe,St,oo,Vt,Mo,u,me,zt,to,Rt,Zt,ue,Gt,Pe,Wt,Xt,Yt,he,Ht,_e,no,Kt,Qt,en,so,on,tn,x,ro,ge,nn,sn,lo,be,rn,ln,ao,ve,an,dn,io,ye,cn,ko,j,G,co,Ne,fn,fo,pn,To,M,we,mn,Ce,un,Ue,hn,_n,gn,W,xe,bn,po,vn,$o;return H=new Ie({}),Q=new Ie({}),ee=new ws({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xuZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZsbGx5YXN2aWVsJTJGQ29udHJvbE5ldC12MS0xJTJGYmxvYiUyRm1haW4lMkZjb250cm9sX3YxMXBfc2QxNV9jYW5ueS5wdGglMjIlMjAlMjAlMjMlMjBjYW4lMjBhbHNvJTIwYmUlMjBhJTIwbG9jYWwlMjBwYXRoJTBBY29udHJvbG5ldCUyMCUzRCUyMENvbnRyb2xOZXRNb2RlbC5mcm9tX3NpbmdsZV9maWxlKHVybCklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGcnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZibG9iJTJGbWFpbiUyRnYxLTUtcHJ1bmVkLnNhZmV0ZW5zb3JzJTIyJTIwJTIwJTIzJTIwY2FuJTIwYWxzbyUyMGJlJTIwYSUyMGxvY2FsJTIwcGF0aCUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sbmV0UGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSh1cmwlMkMlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlnetPipeline, ControlNetModel

url = <span class="hljs-string">&quot;https://huggingface.co/lllyasviel/ControlNet-v1-1/blob/main/control_v11p_sd15_canny.pth&quot;</span>  <span class="hljs-comment"># can also be a local path</span>
controlnet = ControlNetModel.from_single_file(url)

url = <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned.safetensors&quot;</span>  <span class="hljs-comment"># can also be a local path</span>
pipe = StableDiffusionControlnetPipeline.from_single_file(url, controlnet=controlnet)`}}),oe=new Ie({}),te=new T({props:{name:"class diffusers.ControlNetModel",anchor:"diffusers.ControlNetModel",parameters:[{name:"in_channels",val:": int = 4"},{name:"conditioning_channels",val:": int = 3"},{name:"flip_sin_to_cos",val:": bool = True"},{name:"freq_shift",val:": int = 0"},{name:"down_block_types",val:": typing.Tuple[str] = ('CrossAttnDownBlock2D', 'CrossAttnDownBlock2D', 'CrossAttnDownBlock2D', 'DownBlock2D')"},{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 = 1280"},{name:"transformer_layers_per_block",val:": typing.Union[int, typing.Tuple[int]] = 1"},{name:"encoder_hid_dim",val:": typing.Optional[int] = None"},{name:"encoder_hid_dim_type",val:": typing.Optional[str] = None"},{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:"class_embed_type",val:": typing.Optional[str] = None"},{name:"addition_embed_type",val:": typing.Optional[str] = None"},{name:"addition_time_embed_dim",val:": typing.Optional[int] = None"},{name:"num_class_embeds",val:": typing.Optional[int] = None"},{name:"upcast_attention",val:": bool = False"},{name:"resnet_time_scale_shift",val:": str = 'default'"},{name:"projection_class_embeddings_input_dim",val:": typing.Optional[int] = None"},{name:"controlnet_conditioning_channel_order",val:": str = 'rgb'"},{name:"conditioning_embedding_out_channels",val:": typing.Optional[typing.Tuple[int]] = (16, 32, 96, 256)"},{name:"global_pool_conditions",val:": bool = False"},{name:"addition_embed_type_num_heads",val:" = 64"}],parametersDescription:[{anchor:"diffusers.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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>CrossAttnDownBlock2D</code>, <code>CrossAttnUpBlock2D</code>,
<code>UNetMidBlock2DCrossAttn</code>.`,name:"transformer_layers_per_block"},{anchor:"diffusers.ControlNetModel.encoder_hid_dim",description:`<strong>encoder_hid_dim</strong> (<code>int</code>, <em>optional</em>, defaults to None) &#x2014;
If <code>encoder_hid_dim_type</code> is defined, <code>encoder_hidden_states</code> will be projected from <code>encoder_hid_dim</code>
dimension to <code>cross_attention_dim</code>.`,name:"encoder_hid_dim"},{anchor:"diffusers.ControlNetModel.encoder_hid_dim_type",description:`<strong>encoder_hid_dim_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If given, the <code>encoder_hidden_states</code> and potentially other embeddings are down-projected to text
embeddings of dimension <code>cross_attention</code> according to <code>encoder_hid_dim_type</code>.`,name:"encoder_hid_dim_type"},{anchor:"diffusers.ControlNetModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>Union[int, Tuple[int]]</code>, defaults to 8) &#x2014;
The dimension of the attention heads.`,name:"attention_head_dim"},{anchor:"diffusers.ControlNetModel.use_linear_projection",description:"<strong>use_linear_projection</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;",name:"use_linear_projection"},{anchor:"diffusers.ControlNetModel.class_embed_type",description:`<strong>class_embed_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The type of class embedding to use which is ultimately summed with the time embeddings. Choose from None,
<code>&quot;timestep&quot;</code>, <code>&quot;identity&quot;</code>, <code>&quot;projection&quot;</code>, or <code>&quot;simple_projection&quot;</code>.`,name:"class_embed_type"},{anchor:"diffusers.ControlNetModel.addition_embed_type",description:`<strong>addition_embed_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Configures an optional embedding which will be summed with the time embeddings. Choose from <code>None</code> or
&#x201C;text&#x201D;. &#x201C;text&#x201D; will use the <code>TextTimeEmbedding</code> layer.`,name:"addition_embed_type"},{anchor:"diffusers.ControlNetModel.num_class_embeds",description:`<strong>num_class_embeds</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Input dimension of the learnable embedding matrix to be projected to <code>time_embed_dim</code>, when performing
class conditioning with <code>class_embed_type</code> equal to <code>None</code>.`,name:"num_class_embeds"},{anchor:"diffusers.ControlNetModel.upcast_attention",description:"<strong>upcast_attention</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;",name:"upcast_attention"},{anchor:"diffusers.ControlNetModel.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.ControlNetModel.projection_class_embeddings_input_dim",description:`<strong>projection_class_embeddings_input_dim</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The dimension of the <code>class_labels</code> input when <code>class_embed_type=&quot;projection&quot;</code>. Required when
<code>class_embed_type=&quot;projection&quot;</code>.`,name:"projection_class_embeddings_input_dim"},{anchor:"diffusers.ControlNetModel.controlnet_conditioning_channel_order",description:`<strong>controlnet_conditioning_channel_order</strong> (<code>str</code>, defaults to <code>&quot;rgb&quot;</code>) &#x2014;
The channel order of conditional image. Will convert to <code>rgb</code> if it&#x2019;s <code>bgr</code>.`,name:"controlnet_conditioning_channel_order"},{anchor:"diffusers.ControlNetModel.conditioning_embedding_out_channels",description:`<strong>conditioning_embedding_out_channels</strong> (<code>tuple[int]</code>, <em>optional</em>, 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.ControlNetModel.global_pool_conditions",description:"<strong>global_pool_conditions</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;",name:"global_pool_conditions"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/models/controlnet.py#L104"}}),ne=new T({props:{name:"forward",anchor:"diffusers.ControlNetModel.forward",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": typing.Union[torch.Tensor, float, int]"},{name:"encoder_hidden_states",val:": Tensor"},{name:"controlnet_cond",val:": FloatTensor"},{name:"conditioning_scale",val:": float = 1.0"},{name:"class_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"timestep_cond",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"added_cond_kwargs",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"guess_mode",val:": bool = False"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.ControlNetModel.forward.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The noisy input tensor.`,name:"sample"},{anchor:"diffusers.ControlNetModel.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.ControlNetModel.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.ControlNetModel.forward.controlnet_cond",description:`<strong>controlnet_cond</strong> (<code>torch.FloatTensor</code>) &#x2014;
The conditional input tensor of shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"controlnet_cond"},{anchor:"diffusers.ControlNetModel.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.ControlNetModel.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.ControlNetModel.forward.timestep_cond",description:"<strong>timestep_cond</strong> (<code>torch.Tensor</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;",name:"timestep_cond"},{anchor:"diffusers.ControlNetModel.forward.attention_mask",description:"<strong>attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;",name:"attention_mask"},{anchor:"diffusers.ControlNetModel.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.ControlNetModel.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.ControlNetModel.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.ControlNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.models.controlnet.ControlNetOutput">ControlNetOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/models/controlnet.py#L625",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, a <a
  href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.models.controlnet.ControlNetOutput"
>ControlNetOutput</a> is returned, otherwise a tuple is
returned where the first element is the sample tensor.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.models.controlnet.ControlNetOutput"
>ControlNetOutput</a> <strong>or</strong> <code>tuple</code></p>
`}}),re=new T({props:{name:"from_unet",anchor:"diffusers.ControlNetModel.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"}],parametersDescription:[{anchor:"diffusers.ControlNetModel.from_unet.unet",description:`<strong>unet</strong> (<code>UNet2DConditionModel</code>) &#x2014;
The UNet model weights to copy to the <a href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a>. All configuration options are also copied
where applicable.`,name:"unet"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/models/controlnet.py#L418"}}),le=new T({props:{name:"set_attention_slice",anchor:"diffusers.ControlNetModel.set_attention_slice",parameters:[{name:"slice_size",val:""}],parametersDescription:[{anchor:"diffusers.ControlNetModel.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/v0.19.0/src/diffusers/models/controlnet.py#L556"}}),ae=new T({props:{name:"set_attn_processor",anchor:"diffusers.ControlNetModel.set_attn_processor",parameters:[{name:"processor",val:": typing.Union[diffusers.models.attention_processor.AttnProcessor, diffusers.models.attention_processor.AttnProcessor2_0, diffusers.models.attention_processor.XFormersAttnProcessor, diffusers.models.attention_processor.SlicedAttnProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor, diffusers.models.attention_processor.SlicedAttnAddedKVProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor2_0, diffusers.models.attention_processor.XFormersAttnAddedKVProcessor, diffusers.models.attention_processor.LoRAAttnProcessor, diffusers.models.attention_processor.LoRAXFormersAttnProcessor, diffusers.models.attention_processor.LoRAAttnProcessor2_0, diffusers.models.attention_processor.LoRAAttnAddedKVProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor, diffusers.models.attention_processor.CustomDiffusionXFormersAttnProcessor, typing.Dict[str, typing.Union[diffusers.models.attention_processor.AttnProcessor, diffusers.models.attention_processor.AttnProcessor2_0, diffusers.models.attention_processor.XFormersAttnProcessor, diffusers.models.attention_processor.SlicedAttnProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor, diffusers.models.attention_processor.SlicedAttnAddedKVProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor2_0, diffusers.models.attention_processor.XFormersAttnAddedKVProcessor, diffusers.models.attention_processor.LoRAAttnProcessor, diffusers.models.attention_processor.LoRAXFormersAttnProcessor, diffusers.models.attention_processor.LoRAAttnProcessor2_0, diffusers.models.attention_processor.LoRAAttnAddedKVProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor, diffusers.models.attention_processor.CustomDiffusionXFormersAttnProcessor]]]"}],parametersDescription:[{anchor:"diffusers.ControlNetModel.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/v0.19.0/src/diffusers/models/controlnet.py#L514"}}),ie=new T({props:{name:"set_default_attn_processor",anchor:"diffusers.ControlNetModel.set_default_attn_processor",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/models/controlnet.py#L549"}}),de=new Ie({}),ce=new T({props:{name:"class diffusers.models.controlnet.ControlNetOutput",anchor:"diffusers.models.controlnet.ControlNetOutput",parameters:[{name:"down_block_res_samples",val:": typing.Tuple[torch.Tensor]"},{name:"mid_block_res_sample",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.models.controlnet.ControlNetOutput.down_block_res_samples",description:`<strong>down_block_res_samples</strong> (<code>tuple[torch.Tensor]</code>) &#x2014;
A tuple of downsample activations at different resolutions for each downsampling block. Each tensor should
be of shape <code>(batch_size, channel * resolution, height //resolution, width // resolution)</code>. Output can be
used to condition the original UNet&#x2019;s downsampling activations.`,name:"down_block_res_samples"},{anchor:"diffusers.models.controlnet.ControlNetOutput.mid_down_block_re_sample",description:`<strong>mid_down_block_re_sample</strong> (<code>torch.Tensor</code>) &#x2014;
The activation of the midde block (the lowest sample resolution). Each tensor should be of shape
<code>(batch_size, channel * lowest_resolution, height // lowest_resolution, width // lowest_resolution)</code>.
Output can be used to condition the original UNet&#x2019;s middle block activation.`,name:"mid_down_block_re_sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/models/controlnet.py#L40"}}),pe=new Ie({}),me=new T({props:{name:"class diffusers.FlaxControlNetModel",anchor:"diffusers.FlaxControlNetModel",parameters:[{name:"sample_size",val:": int = 32"},{name:"in_channels",val:": int = 4"},{name:"down_block_types",val:": typing.Tuple[str] = ('CrossAttnDownBlock2D', 'CrossAttnDownBlock2D', 'CrossAttnDownBlock2D', 'DownBlock2D')"},{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:"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:"cross_attention_dim",val:": int = 1280"},{name:"dropout",val:": float = 0.0"},{name:"use_linear_projection",val:": bool = False"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"flip_sin_to_cos",val:": bool = True"},{name:"freq_shift",val:": int = 0"},{name:"controlnet_conditioning_channel_order",val:": str = 'rgb'"},{name:"conditioning_embedding_out_channels",val:": typing.Tuple[int] = (16, 32, 96, 256)"},{name:"parent",val:": typing.Union[typing.Type[flax.linen.module.Module], typing.Type[flax.core.scope.Scope], typing.Type[flax.linen.module._Sentinel], NoneType] = <flax.linen.module._Sentinel object at 0x7f5c32038f40>"},{name:"name",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"diffusers.FlaxControlNetModel.sample_size",description:`<strong>sample_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The size of the input sample.`,name:"sample_size"},{anchor:"diffusers.FlaxControlNetModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of channels in the input sample.`,name:"in_channels"},{anchor:"diffusers.FlaxControlNetModel.down_block_types",description:`<strong>down_block_types</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(&quot;FlaxCrossAttnDownBlock2D&quot;, &quot;FlaxCrossAttnDownBlock2D&quot;, &quot;FlaxCrossAttnDownBlock2D&quot;, &quot;FlaxDownBlock2D&quot;)</code>) &#x2014;
The tuple of downsample blocks to use.`,name:"down_block_types"},{anchor:"diffusers.FlaxControlNetModel.block_out_channels",description:`<strong>block_out_channels</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(320, 640, 1280, 1280)</code>) &#x2014;
The tuple of output channels for each block.`,name:"block_out_channels"},{anchor:"diffusers.FlaxControlNetModel.layers_per_block",description:`<strong>layers_per_block</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The number of layers per block.`,name:"layers_per_block"},{anchor:"diffusers.FlaxControlNetModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code> or <code>Tuple[int]</code>, <em>optional</em>, defaults to 8) &#x2014;
The dimension of the attention heads.`,name:"attention_head_dim"},{anchor:"diffusers.FlaxControlNetModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code> or <code>Tuple[int]</code>, <em>optional</em>) &#x2014;
The number of attention heads.`,name:"num_attention_heads"},{anchor:"diffusers.FlaxControlNetModel.cross_attention_dim",description:`<strong>cross_attention_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The dimension of the cross attention features.`,name:"cross_attention_dim"},{anchor:"diffusers.FlaxControlNetModel.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
Dropout probability for down, up and bottleneck blocks.`,name:"dropout"},{anchor:"diffusers.FlaxControlNetModel.flip_sin_to_cos",description:`<strong>flip_sin_to_cos</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to flip the sin to cos in the time embedding.`,name:"flip_sin_to_cos"},{anchor:"diffusers.FlaxControlNetModel.freq_shift",description:"<strong>freq_shift</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The frequency shift to apply to the time embedding.",name:"freq_shift"},{anchor:"diffusers.FlaxControlNetModel.controlnet_conditioning_channel_order",description:`<strong>controlnet_conditioning_channel_order</strong> (<code>str</code>, <em>optional</em>, defaults to <code>rgb</code>) &#x2014;
The channel order of conditional image. Will convert to <code>rgb</code> if it&#x2019;s <code>bgr</code>.`,name:"controlnet_conditioning_channel_order"},{anchor:"diffusers.FlaxControlNetModel.conditioning_embedding_out_channels",description:`<strong>conditioning_embedding_out_channels</strong> (<code>tuple</code>, <em>optional</em>, 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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/models/controlnet_flax.py#L104"}}),Ne=new Ie({}),we=new T({props:{name:"class diffusers.models.controlnet_flax.FlaxControlNetOutput",anchor:"diffusers.models.controlnet_flax.FlaxControlNetOutput",parameters:[{name:"down_block_res_samples",val:": Array"},{name:"mid_block_res_sample",val:": Array"}],parametersDescription:[{anchor:"diffusers.models.controlnet_flax.FlaxControlNetOutput.down_block_res_samples",description:"<strong>down_block_res_samples</strong> (<code>jnp.ndarray</code>) &#x2014;",name:"down_block_res_samples"},{anchor:"diffusers.models.controlnet_flax.FlaxControlNetOutput.mid_block_res_sample",description:"<strong>mid_block_res_sample</strong> (<code>jnp.ndarray</code>) &#x2014;",name:"mid_block_res_sample"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/models/controlnet_flax.py#L34"}}),xe=new T({props:{name:"replace",anchor:"diffusers.models.controlnet_flax.FlaxControlNetOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/flax/struct.py#L111"}}),{c(){$=n("meta"),mo=d(),A=n("h1"),O=n("a"),Je=n("span"),h(H.$$.fragment),Go=d(),Le=n("span"),Wo=a("ControlNet"),uo=d(),I=n("p"),Xo=a("The ControlNet model was introduced in "),K=n("a"),Yo=a("Adding Conditional Control to Text-to-Image Diffusion Models"),Ho=a(" by Lvmin Zhang and Maneesh Agrawala. It provides a greater degree of control over text-to-image generation by conditioning the model on additional inputs such as edge maps, depth maps, segmentation maps, and keypoints for pose detection."),ho=d(),Me=n("p"),Ko=a("The abstract from the paper is:"),_o=d(),ke=n("p"),Be=n("em"),Qo=a("We present a neural network structure, ControlNet, to control pretrained large diffusion models to support additional input conditions. The ControlNet learns task-specific conditions in an end-to-end way, and the learning is robust even when the training dataset is small (< 50k). Moreover, training a ControlNet is as fast as fine-tuning a diffusion model, and the model can be trained on a personal devices. Alternatively, if powerful computation clusters are available, the model can scale to large amounts (millions to billions) of data. We report that large diffusion models like Stable Diffusion can be augmented with ControlNets to enable conditional inputs like edge maps, segmentation maps, keypoints, etc. This may enrich the methods to control large diffusion models and further facilitate related applications."),go=d(),E=n("h2"),J=n("a"),Se=n("span"),h(Q.$$.fragment),et=d(),Ve=n("span"),ot=a("Loading from the original format"),bo=d(),w=n("p"),tt=a("By default the "),Te=n("a"),nt=a("ControlNetModel"),st=a(" should be loaded with "),$e=n("a"),rt=a("from_pretrained()"),lt=a(`, but it can also be loaded
from the original format using `),ze=n("code"),at=a("FromOriginalControlnetMixin.from_single_file"),it=a(" as follows:"),vo=d(),h(ee.$$.fragment),yo=d(),D=n("h2"),L=n("a"),Re=n("span"),h(oe.$$.fragment),dt=d(),Ze=n("span"),ct=a("ControlNetModel"),No=d(),m=n("div"),h(te.$$.fragment),ft=d(),Ge=n("p"),pt=a("A ControlNet model."),mt=d(),B=n("div"),h(ne.$$.fragment),ut=d(),se=n("p"),ht=a("The "),Ae=n("a"),_t=a("ControlNetModel"),gt=a(" forward method."),bt=d(),S=n("div"),h(re.$$.fragment),vt=d(),F=n("p"),yt=a("Instantiate a "),Ee=n("a"),Nt=a("ControlNetModel"),wt=a(" from "),De=n("a"),Ct=a("UNet2DConditionModel"),xt=a("."),Mt=d(),k=n("div"),h(le.$$.fragment),kt=d(),We=n("p"),Tt=a("Enable sliced attention computation."),$t=d(),Xe=n("p"),At=a(`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.`),Et=d(),V=n("div"),h(ae.$$.fragment),Dt=d(),Ye=n("p"),Ft=a("Sets the attention processor to use to compute attention."),Pt=d(),z=n("div"),h(ie.$$.fragment),Ut=d(),He=n("p"),qt=a("Disables custom attention processors and sets the default attention implementation."),wo=d(),P=n("h2"),R=n("a"),Ke=n("span"),h(de.$$.fragment),jt=d(),Qe=n("span"),Ot=a("ControlNetOutput"),Co=d(),U=n("div"),h(ce.$$.fragment),It=d(),fe=n("p"),Jt=a("The output of "),Fe=n("a"),Lt=a("ControlNetModel"),Bt=a("."),xo=d(),q=n("h2"),Z=n("a"),eo=n("span"),h(pe.$$.fragment),St=d(),oo=n("span"),Vt=a("FlaxControlNetModel"),Mo=d(),u=n("div"),h(me.$$.fragment),zt=d(),to=n("p"),Rt=a("A ControlNet model."),Zt=d(),ue=n("p"),Gt=a("This model inherits from "),Pe=n("a"),Wt=a("FlaxModelMixin"),Xt=a(`. Check the superclass documentation for it\u2019s generic methods
implemented for all models (such as downloading or saving).`),Yt=d(),he=n("p"),Ht=a("This model is also a Flax Linen "),_e=n("a"),no=n("code"),Kt=a("flax.linen.Module"),Qt=a(`
subclass. Use it as a regular Flax Linen module and refer to the Flax documentation for all matters related to its
general usage and behavior.`),en=d(),so=n("p"),on=a("Inherent JAX features such as the following are supported:"),tn=d(),x=n("ul"),ro=n("li"),ge=n("a"),nn=a("Just-In-Time (JIT) compilation"),sn=d(),lo=n("li"),be=n("a"),rn=a("Automatic Differentiation"),ln=d(),ao=n("li"),ve=n("a"),an=a("Vectorization"),dn=d(),io=n("li"),ye=n("a"),cn=a("Parallelization"),ko=d(),j=n("h2"),G=n("a"),co=n("span"),h(Ne.$$.fragment),fn=d(),fo=n("span"),pn=a("FlaxControlNetOutput"),To=d(),M=n("div"),h(we.$$.fragment),mn=d(),Ce=n("p"),un=a("The output of "),Ue=n("a"),hn=a("FlaxControlNetModel"),_n=a("."),gn=d(),W=n("div"),h(xe.$$.fragment),bn=d(),po=n("p"),vn=a("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(o){const f=vs('[data-svelte="svelte-1phssyn"]',document.head);$=s(f,"META",{name:!0,content:!0}),f.forEach(t),mo=c(o),A=s(o,"H1",{class:!0});var Ao=r(A);O=s(Ao,"A",{id:!0,class:!0,href:!0});var Nn=r(O);Je=s(Nn,"SPAN",{});var wn=r(Je);_(H.$$.fragment,wn),wn.forEach(t),Nn.forEach(t),Go=c(Ao),Le=s(Ao,"SPAN",{});var Cn=r(Le);Wo=i(Cn,"ControlNet"),Cn.forEach(t),Ao.forEach(t),uo=c(o),I=s(o,"P",{});var Eo=r(I);Xo=i(Eo,"The ControlNet model was introduced in "),K=s(Eo,"A",{href:!0,rel:!0});var xn=r(K);Yo=i(xn,"Adding Conditional Control to Text-to-Image Diffusion Models"),xn.forEach(t),Ho=i(Eo," by Lvmin Zhang and Maneesh Agrawala. It provides a greater degree of control over text-to-image generation by conditioning the model on additional inputs such as edge maps, depth maps, segmentation maps, and keypoints for pose detection."),Eo.forEach(t),ho=c(o),Me=s(o,"P",{});var Mn=r(Me);Ko=i(Mn,"The abstract from the paper is:"),Mn.forEach(t),_o=c(o),ke=s(o,"P",{});var kn=r(ke);Be=s(kn,"EM",{});var Tn=r(Be);Qo=i(Tn,"We present a neural network structure, ControlNet, to control pretrained large diffusion models to support additional input conditions. The ControlNet learns task-specific conditions in an end-to-end way, and the learning is robust even when the training dataset is small (< 50k). Moreover, training a ControlNet is as fast as fine-tuning a diffusion model, and the model can be trained on a personal devices. Alternatively, if powerful computation clusters are available, the model can scale to large amounts (millions to billions) of data. We report that large diffusion models like Stable Diffusion can be augmented with ControlNets to enable conditional inputs like edge maps, segmentation maps, keypoints, etc. This may enrich the methods to control large diffusion models and further facilitate related applications."),Tn.forEach(t),kn.forEach(t),go=c(o),E=s(o,"H2",{class:!0});var Do=r(E);J=s(Do,"A",{id:!0,class:!0,href:!0});var $n=r(J);Se=s($n,"SPAN",{});var An=r(Se);_(Q.$$.fragment,An),An.forEach(t),$n.forEach(t),et=c(Do),Ve=s(Do,"SPAN",{});var En=r(Ve);ot=i(En,"Loading from the original format"),En.forEach(t),Do.forEach(t),bo=c(o),w=s(o,"P",{});var X=r(w);tt=i(X,"By default the "),Te=s(X,"A",{href:!0});var Dn=r(Te);nt=i(Dn,"ControlNetModel"),Dn.forEach(t),st=i(X," should be loaded with "),$e=s(X,"A",{href:!0});var Fn=r($e);rt=i(Fn,"from_pretrained()"),Fn.forEach(t),lt=i(X,`, but it can also be loaded
from the original format using `),ze=s(X,"CODE",{});var Pn=r(ze);at=i(Pn,"FromOriginalControlnetMixin.from_single_file"),Pn.forEach(t),it=i(X," as follows:"),X.forEach(t),vo=c(o),_(ee.$$.fragment,o),yo=c(o),D=s(o,"H2",{class:!0});var Fo=r(D);L=s(Fo,"A",{id:!0,class:!0,href:!0});var Un=r(L);Re=s(Un,"SPAN",{});var qn=r(Re);_(oe.$$.fragment,qn),qn.forEach(t),Un.forEach(t),dt=c(Fo),Ze=s(Fo,"SPAN",{});var jn=r(Ze);ct=i(jn,"ControlNetModel"),jn.forEach(t),Fo.forEach(t),No=c(o),m=s(o,"DIV",{class:!0});var N=r(m);_(te.$$.fragment,N),ft=c(N),Ge=s(N,"P",{});var On=r(Ge);pt=i(On,"A ControlNet model."),On.forEach(t),mt=c(N),B=s(N,"DIV",{class:!0});var Po=r(B);_(ne.$$.fragment,Po),ut=c(Po),se=s(Po,"P",{});var Uo=r(se);ht=i(Uo,"The "),Ae=s(Uo,"A",{href:!0});var In=r(Ae);_t=i(In,"ControlNetModel"),In.forEach(t),gt=i(Uo," forward method."),Uo.forEach(t),Po.forEach(t),bt=c(N),S=s(N,"DIV",{class:!0});var qo=r(S);_(re.$$.fragment,qo),vt=c(qo),F=s(qo,"P",{});var qe=r(F);yt=i(qe,"Instantiate a "),Ee=s(qe,"A",{href:!0});var Jn=r(Ee);Nt=i(Jn,"ControlNetModel"),Jn.forEach(t),wt=i(qe," from "),De=s(qe,"A",{href:!0});var Ln=r(De);Ct=i(Ln,"UNet2DConditionModel"),Ln.forEach(t),xt=i(qe,"."),qe.forEach(t),qo.forEach(t),Mt=c(N),k=s(N,"DIV",{class:!0});var je=r(k);_(le.$$.fragment,je),kt=c(je),We=s(je,"P",{});var Bn=r(We);Tt=i(Bn,"Enable sliced attention computation."),Bn.forEach(t),$t=c(je),Xe=s(je,"P",{});var Sn=r(Xe);At=i(Sn,`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.`),Sn.forEach(t),je.forEach(t),Et=c(N),V=s(N,"DIV",{class:!0});var jo=r(V);_(ae.$$.fragment,jo),Dt=c(jo),Ye=s(jo,"P",{});var Vn=r(Ye);Ft=i(Vn,"Sets the attention processor to use to compute attention."),Vn.forEach(t),jo.forEach(t),Pt=c(N),z=s(N,"DIV",{class:!0});var Oo=r(z);_(ie.$$.fragment,Oo),Ut=c(Oo),He=s(Oo,"P",{});var zn=r(He);qt=i(zn,"Disables custom attention processors and sets the default attention implementation."),zn.forEach(t),Oo.forEach(t),N.forEach(t),wo=c(o),P=s(o,"H2",{class:!0});var Io=r(P);R=s(Io,"A",{id:!0,class:!0,href:!0});var Rn=r(R);Ke=s(Rn,"SPAN",{});var Zn=r(Ke);_(de.$$.fragment,Zn),Zn.forEach(t),Rn.forEach(t),jt=c(Io),Qe=s(Io,"SPAN",{});var Gn=r(Qe);Ot=i(Gn,"ControlNetOutput"),Gn.forEach(t),Io.forEach(t),Co=c(o),U=s(o,"DIV",{class:!0});var Jo=r(U);_(ce.$$.fragment,Jo),It=c(Jo),fe=s(Jo,"P",{});var Lo=r(fe);Jt=i(Lo,"The output of "),Fe=s(Lo,"A",{href:!0});var Wn=r(Fe);Lt=i(Wn,"ControlNetModel"),Wn.forEach(t),Bt=i(Lo,"."),Lo.forEach(t),Jo.forEach(t),xo=c(o),q=s(o,"H2",{class:!0});var Bo=r(q);Z=s(Bo,"A",{id:!0,class:!0,href:!0});var Xn=r(Z);eo=s(Xn,"SPAN",{});var Yn=r(eo);_(pe.$$.fragment,Yn),Yn.forEach(t),Xn.forEach(t),St=c(Bo),oo=s(Bo,"SPAN",{});var Hn=r(oo);Vt=i(Hn,"FlaxControlNetModel"),Hn.forEach(t),Bo.forEach(t),Mo=c(o),u=s(o,"DIV",{class:!0});var C=r(u);_(me.$$.fragment,C),zt=c(C),to=s(C,"P",{});var Kn=r(to);Rt=i(Kn,"A ControlNet model."),Kn.forEach(t),Zt=c(C),ue=s(C,"P",{});var So=r(ue);Gt=i(So,"This model inherits from "),Pe=s(So,"A",{href:!0});var Qn=r(Pe);Wt=i(Qn,"FlaxModelMixin"),Qn.forEach(t),Xt=i(So,`. Check the superclass documentation for it\u2019s generic methods
implemented for all models (such as downloading or saving).`),So.forEach(t),Yt=c(C),he=s(C,"P",{});var Vo=r(he);Ht=i(Vo,"This model is also a Flax Linen "),_e=s(Vo,"A",{href:!0,rel:!0});var es=r(_e);no=s(es,"CODE",{});var os=r(no);Kt=i(os,"flax.linen.Module"),os.forEach(t),es.forEach(t),Qt=i(Vo,`
subclass. Use it as a regular Flax Linen module and refer to the Flax documentation for all matters related to its
general usage and behavior.`),Vo.forEach(t),en=c(C),so=s(C,"P",{});var ts=r(so);on=i(ts,"Inherent JAX features such as the following are supported:"),ts.forEach(t),tn=c(C),x=s(C,"UL",{});var Y=r(x);ro=s(Y,"LI",{});var ns=r(ro);ge=s(ns,"A",{href:!0,rel:!0});var ss=r(ge);nn=i(ss,"Just-In-Time (JIT) compilation"),ss.forEach(t),ns.forEach(t),sn=c(Y),lo=s(Y,"LI",{});var rs=r(lo);be=s(rs,"A",{href:!0,rel:!0});var ls=r(be);rn=i(ls,"Automatic Differentiation"),ls.forEach(t),rs.forEach(t),ln=c(Y),ao=s(Y,"LI",{});var as=r(ao);ve=s(as,"A",{href:!0,rel:!0});var is=r(ve);an=i(is,"Vectorization"),is.forEach(t),as.forEach(t),dn=c(Y),io=s(Y,"LI",{});var ds=r(io);ye=s(ds,"A",{href:!0,rel:!0});var cs=r(ye);cn=i(cs,"Parallelization"),cs.forEach(t),ds.forEach(t),Y.forEach(t),C.forEach(t),ko=c(o),j=s(o,"H2",{class:!0});var zo=r(j);G=s(zo,"A",{id:!0,class:!0,href:!0});var fs=r(G);co=s(fs,"SPAN",{});var ps=r(co);_(Ne.$$.fragment,ps),ps.forEach(t),fs.forEach(t),fn=c(zo),fo=s(zo,"SPAN",{});var ms=r(fo);pn=i(ms,"FlaxControlNetOutput"),ms.forEach(t),zo.forEach(t),To=c(o),M=s(o,"DIV",{class:!0});var Oe=r(M);_(we.$$.fragment,Oe),mn=c(Oe),Ce=s(Oe,"P",{});var Ro=r(Ce);un=i(Ro,"The output of "),Ue=s(Ro,"A",{href:!0});var us=r(Ue);hn=i(us,"FlaxControlNetModel"),us.forEach(t),_n=i(Ro,"."),Ro.forEach(t),gn=c(Oe),W=s(Oe,"DIV",{class:!0});var Zo=r(W);_(xe.$$.fragment,Zo),bn=c(Zo),po=s(Zo,"P",{});var hs=r(po);vn=i(hs,"\u201CReturns a new object replacing the specified fields with new values."),hs.forEach(t),Zo.forEach(t),Oe.forEach(t),this.h()},h(){l($,"name","hf:doc:metadata"),l($,"content",JSON.stringify(xs)),l(O,"id","controlnet"),l(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(O,"href","#controlnet"),l(A,"class","relative group"),l(K,"href","https://huggingface.co/papers/2302.05543"),l(K,"rel","nofollow"),l(J,"id","loading-from-the-original-format"),l(J,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(J,"href","#loading-from-the-original-format"),l(E,"class","relative group"),l(Te,"href","/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel"),l($e,"href","/docs/diffusers/v0.19.0/en/api/models/overview#diffusers.ModelMixin.from_pretrained"),l(L,"id","diffusers.ControlNetModel"),l(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(L,"href","#diffusers.ControlNetModel"),l(D,"class","relative group"),l(Ae,"href","/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel"),l(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ee,"href","/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel"),l(De,"href","/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(R,"id","diffusers.models.controlnet.ControlNetOutput"),l(R,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(R,"href","#diffusers.models.controlnet.ControlNetOutput"),l(P,"class","relative group"),l(Fe,"href","/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel"),l(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Z,"id","diffusers.FlaxControlNetModel"),l(Z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Z,"href","#diffusers.FlaxControlNetModel"),l(q,"class","relative group"),l(Pe,"href","/docs/diffusers/v0.19.0/en/api/models/overview#diffusers.FlaxModelMixin"),l(_e,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),l(_e,"rel","nofollow"),l(ge,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),l(ge,"rel","nofollow"),l(be,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),l(be,"rel","nofollow"),l(ve,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),l(ve,"rel","nofollow"),l(ye,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),l(ye,"rel","nofollow"),l(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(G,"id","diffusers.models.controlnet_flax.FlaxControlNetOutput"),l(G,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(G,"href","#diffusers.models.controlnet_flax.FlaxControlNetOutput"),l(j,"class","relative group"),l(Ue,"href","/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.FlaxControlNetModel"),l(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,f){e(document.head,$),p(o,mo,f),p(o,A,f),e(A,O),e(O,Je),g(H,Je,null),e(A,Go),e(A,Le),e(Le,Wo),p(o,uo,f),p(o,I,f),e(I,Xo),e(I,K),e(K,Yo),e(I,Ho),p(o,ho,f),p(o,Me,f),e(Me,Ko),p(o,_o,f),p(o,ke,f),e(ke,Be),e(Be,Qo),p(o,go,f),p(o,E,f),e(E,J),e(J,Se),g(Q,Se,null),e(E,et),e(E,Ve),e(Ve,ot),p(o,bo,f),p(o,w,f),e(w,tt),e(w,Te),e(Te,nt),e(w,st),e(w,$e),e($e,rt),e(w,lt),e(w,ze),e(ze,at),e(w,it),p(o,vo,f),g(ee,o,f),p(o,yo,f),p(o,D,f),e(D,L),e(L,Re),g(oe,Re,null),e(D,dt),e(D,Ze),e(Ze,ct),p(o,No,f),p(o,m,f),g(te,m,null),e(m,ft),e(m,Ge),e(Ge,pt),e(m,mt),e(m,B),g(ne,B,null),e(B,ut),e(B,se),e(se,ht),e(se,Ae),e(Ae,_t),e(se,gt),e(m,bt),e(m,S),g(re,S,null),e(S,vt),e(S,F),e(F,yt),e(F,Ee),e(Ee,Nt),e(F,wt),e(F,De),e(De,Ct),e(F,xt),e(m,Mt),e(m,k),g(le,k,null),e(k,kt),e(k,We),e(We,Tt),e(k,$t),e(k,Xe),e(Xe,At),e(m,Et),e(m,V),g(ae,V,null),e(V,Dt),e(V,Ye),e(Ye,Ft),e(m,Pt),e(m,z),g(ie,z,null),e(z,Ut),e(z,He),e(He,qt),p(o,wo,f),p(o,P,f),e(P,R),e(R,Ke),g(de,Ke,null),e(P,jt),e(P,Qe),e(Qe,Ot),p(o,Co,f),p(o,U,f),g(ce,U,null),e(U,It),e(U,fe),e(fe,Jt),e(fe,Fe),e(Fe,Lt),e(fe,Bt),p(o,xo,f),p(o,q,f),e(q,Z),e(Z,eo),g(pe,eo,null),e(q,St),e(q,oo),e(oo,Vt),p(o,Mo,f),p(o,u,f),g(me,u,null),e(u,zt),e(u,to),e(to,Rt),e(u,Zt),e(u,ue),e(ue,Gt),e(ue,Pe),e(Pe,Wt),e(ue,Xt),e(u,Yt),e(u,he),e(he,Ht),e(he,_e),e(_e,no),e(no,Kt),e(he,Qt),e(u,en),e(u,so),e(so,on),e(u,tn),e(u,x),e(x,ro),e(ro,ge),e(ge,nn),e(x,sn),e(x,lo),e(lo,be),e(be,rn),e(x,ln),e(x,ao),e(ao,ve),e(ve,an),e(x,dn),e(x,io),e(io,ye),e(ye,cn),p(o,ko,f),p(o,j,f),e(j,G),e(G,co),g(Ne,co,null),e(j,fn),e(j,fo),e(fo,pn),p(o,To,f),p(o,M,f),g(we,M,null),e(M,mn),e(M,Ce),e(Ce,un),e(Ce,Ue),e(Ue,hn),e(Ce,_n),e(M,gn),e(M,W),g(xe,W,null),e(W,bn),e(W,po),e(po,vn),$o=!0},p:ys,i(o){$o||(b(H.$$.fragment,o),b(Q.$$.fragment,o),b(ee.$$.fragment,o),b(oe.$$.fragment,o),b(te.$$.fragment,o),b(ne.$$.fragment,o),b(re.$$.fragment,o),b(le.$$.fragment,o),b(ae.$$.fragment,o),b(ie.$$.fragment,o),b(de.$$.fragment,o),b(ce.$$.fragment,o),b(pe.$$.fragment,o),b(me.$$.fragment,o),b(Ne.$$.fragment,o),b(we.$$.fragment,o),b(xe.$$.fragment,o),$o=!0)},o(o){v(H.$$.fragment,o),v(Q.$$.fragment,o),v(ee.$$.fragment,o),v(oe.$$.fragment,o),v(te.$$.fragment,o),v(ne.$$.fragment,o),v(re.$$.fragment,o),v(le.$$.fragment,o),v(ae.$$.fragment,o),v(ie.$$.fragment,o),v(de.$$.fragment,o),v(ce.$$.fragment,o),v(pe.$$.fragment,o),v(me.$$.fragment,o),v(Ne.$$.fragment,o),v(we.$$.fragment,o),v(xe.$$.fragment,o),$o=!1},d(o){t($),o&&t(mo),o&&t(A),y(H),o&&t(uo),o&&t(I),o&&t(ho),o&&t(Me),o&&t(_o),o&&t(ke),o&&t(go),o&&t(E),y(Q),o&&t(bo),o&&t(w),o&&t(vo),y(ee,o),o&&t(yo),o&&t(D),y(oe),o&&t(No),o&&t(m),y(te),y(ne),y(re),y(le),y(ae),y(ie),o&&t(wo),o&&t(P),y(de),o&&t(Co),o&&t(U),y(ce),o&&t(xo),o&&t(q),y(pe),o&&t(Mo),o&&t(u),y(me),o&&t(ko),o&&t(j),y(Ne),o&&t(To),o&&t(M),y(we),y(xe)}}}const xs={local:"controlnet",sections:[{local:"loading-from-the-original-format",title:"Loading from the original format"},{local:"diffusers.ControlNetModel",title:"ControlNetModel"},{local:"diffusers.models.controlnet.ControlNetOutput",title:"ControlNetOutput"},{local:"diffusers.FlaxControlNetModel",title:"FlaxControlNetModel"},{local:"diffusers.models.controlnet_flax.FlaxControlNetOutput",title:"FlaxControlNetOutput"}],title:"ControlNet"};function Ms(yn){return Ns(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Es extends _s{constructor($){super();gs(this,$,Ms,Cs,bs,{})}}export{Es as default,xs as metadata};
