import{s as nt,n as at,o as ot}from"../chunks/scheduler.53228c21.js";import{S as it,i as lt,e as s,s as o,c as C,h as st,a as r,d as n,b as i,f as q,g as y,j as G,k as U,l as rt,m as a,n as N,t as M,o as S,p as x}from"../chunks/index.100fac89.js";import{C as mt}from"../chunks/CopyLLMTxtMenu.999d3d86.js";import{D as et}from"../chunks/Docstring.46d0934e.js";import{H as Z,E as ft}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d27ae4df.js";function pt(B){let l,O,T,E,m,P,f,H,p,J='The ControlNet model 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, 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.',k,d,K="The abstract from the paper is:",z,u,Q="<em>We present ControlNet, a neural network architecture to add spatial conditioning controls to large, pretrained text-to-image diffusion models. ControlNet locks the production-ready large diffusion models, and reuses their deep and robust encoding layers pretrained with billions of images as a strong backbone to learn a diverse set of conditional controls. The neural architecture is connected with “zero convolutions” (zero-initialized convolution layers) that progressively grow the parameters from zero and ensure that no harmful noise could affect the finetuning. We test various conditioning controls, eg, edges, depth, segmentation, human pose, etc, with Stable Diffusion, using single or multiple conditions, with or without prompts. We show that the training of ControlNets is robust with small (&lt;50k) and large (&gt;1m) datasets. Extensive results show that ControlNet may facilitate wider applications to control image diffusion models.</em>",D,c,X=`This model was contributed by <a href="https://huggingface.co/ishan24" rel="nofollow">ishan24</a>. ❤️
The original codebase can be found at <a href="https://github.com/NVlabs/Sana" rel="nofollow">NVlabs/Sana</a>, and you can find official ControlNet checkpoints on <a href="https://huggingface.co/Efficient-Large-Model" rel="nofollow">Efficient-Large-Model’s</a> Hub profile.`,A,g,I,h,$,V,_,W,v,b,F,w,R,L,j;return m=new mt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new Z({props:{title:"SanaControlNetModel",local:"sanacontrolnetmodel",headingTag:"h1"}}),g=new Z({props:{title:"SanaControlNetModel",local:"diffusers.SanaControlNetModel",headingTag:"h2"}}),$=new et({props:{name:"class diffusers.SanaControlNetModel",anchor:"diffusers.SanaControlNetModel",parameters:[{name:"in_channels",val:": int = 32"},{name:"out_channels",val:": typing.Optional[int] = 32"},{name:"num_attention_heads",val:": int = 70"},{name:"attention_head_dim",val:": int = 32"},{name:"num_layers",val:": int = 7"},{name:"num_cross_attention_heads",val:": typing.Optional[int] = 20"},{name:"cross_attention_head_dim",val:": typing.Optional[int] = 112"},{name:"cross_attention_dim",val:": typing.Optional[int] = 2240"},{name:"caption_channels",val:": int = 2304"},{name:"mlp_ratio",val:": float = 2.5"},{name:"dropout",val:": float = 0.0"},{name:"attention_bias",val:": bool = False"},{name:"sample_size",val:": int = 32"},{name:"patch_size",val:": int = 1"},{name:"norm_elementwise_affine",val:": bool = False"},{name:"norm_eps",val:": float = 1e-06"},{name:"interpolation_scale",val:": typing.Optional[int] = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnets/controlnet_sana.py#L41"}}),_=new Z({props:{title:"SanaControlNetOutput",local:"diffusers.models.controlnets.controlnet_sana.SanaControlNetOutput",headingTag:"h2"}}),b=new et({props:{name:"class diffusers.models.controlnets.controlnet_sana.SanaControlNetOutput",anchor:"diffusers.models.controlnets.controlnet_sana.SanaControlNetOutput",parameters:[{name:"controlnet_block_samples",val:": typing.Tuple[torch.Tensor]"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/controlnets/controlnet_sana.py#L37"}}),w=new ft({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/controlnet_sana.md"}}),{c(){l=s("meta"),O=o(),T=s("p"),E=o(),C(m.$$.fragment),P=o(),C(f.$$.fragment),H=o(),p=s("p"),p.innerHTML=J,k=o(),d=s("p"),d.textContent=K,z=o(),u=s("p"),u.innerHTML=Q,D=o(),c=s("p"),c.innerHTML=X,A=o(),C(g.$$.fragment),I=o(),h=s("div"),C($.$$.fragment),V=o(),C(_.$$.fragment),W=o(),v=s("div"),C(b.$$.fragment),F=o(),C(w.$$.fragment),R=o(),L=s("p"),this.h()},l(t){const e=st("svelte-u9bgzb",document.head);l=r(e,"META",{name:!0,content:!0}),e.forEach(n),O=i(t),T=r(t,"P",{}),q(T).forEach(n),E=i(t),y(m.$$.fragment,t),P=i(t),y(f.$$.fragment,t),H=i(t),p=r(t,"P",{"data-svelte-h":!0}),G(p)!=="svelte-1s65p96"&&(p.innerHTML=J),k=i(t),d=r(t,"P",{"data-svelte-h":!0}),G(d)!=="svelte-1cwsb16"&&(d.textContent=K),z=i(t),u=r(t,"P",{"data-svelte-h":!0}),G(u)!=="svelte-fbiw6t"&&(u.innerHTML=Q),D=i(t),c=r(t,"P",{"data-svelte-h":!0}),G(c)!=="svelte-106mph8"&&(c.innerHTML=X),A=i(t),y(g.$$.fragment,t),I=i(t),h=r(t,"DIV",{class:!0});var Y=q(h);y($.$$.fragment,Y),Y.forEach(n),V=i(t),y(_.$$.fragment,t),W=i(t),v=r(t,"DIV",{class:!0});var tt=q(v);y(b.$$.fragment,tt),tt.forEach(n),F=i(t),y(w.$$.fragment,t),R=i(t),L=r(t,"P",{}),q(L).forEach(n),this.h()},h(){U(l,"name","hf:doc:metadata"),U(l,"content",dt),U(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(v,"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,e){rt(document.head,l),a(t,O,e),a(t,T,e),a(t,E,e),N(m,t,e),a(t,P,e),N(f,t,e),a(t,H,e),a(t,p,e),a(t,k,e),a(t,d,e),a(t,z,e),a(t,u,e),a(t,D,e),a(t,c,e),a(t,A,e),N(g,t,e),a(t,I,e),a(t,h,e),N($,h,null),a(t,V,e),N(_,t,e),a(t,W,e),a(t,v,e),N(b,v,null),a(t,F,e),N(w,t,e),a(t,R,e),a(t,L,e),j=!0},p:at,i(t){j||(M(m.$$.fragment,t),M(f.$$.fragment,t),M(g.$$.fragment,t),M($.$$.fragment,t),M(_.$$.fragment,t),M(b.$$.fragment,t),M(w.$$.fragment,t),j=!0)},o(t){S(m.$$.fragment,t),S(f.$$.fragment,t),S(g.$$.fragment,t),S($.$$.fragment,t),S(_.$$.fragment,t),S(b.$$.fragment,t),S(w.$$.fragment,t),j=!1},d(t){t&&(n(O),n(T),n(E),n(P),n(H),n(p),n(k),n(d),n(z),n(u),n(D),n(c),n(A),n(I),n(h),n(V),n(W),n(v),n(F),n(R),n(L)),n(l),x(m,t),x(f,t),x(g,t),x($),x(_,t),x(b),x(w,t)}}}const dt='{"title":"SanaControlNetModel","local":"sanacontrolnetmodel","sections":[{"title":"SanaControlNetModel","local":"diffusers.SanaControlNetModel","sections":[],"depth":2},{"title":"SanaControlNetOutput","local":"diffusers.models.controlnets.controlnet_sana.SanaControlNetOutput","sections":[],"depth":2}],"depth":1}';function ut(B){return ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vt extends it{constructor(l){super(),lt(this,l,ut,pt,nt,{})}}export{vt as component};
