import{s as oe,n as ae,o as se}from"../chunks/scheduler.8c3d61f6.js";import{S as re,i as ie,g as m,s as a,r as T,A as de,h as l,f as n,c as s,j as R,u as M,x as Y,k as B,y as z,a as o,v,d as $,t as x,w as D}from"../chunks/index.da70eac4.js";import{D as ne}from"../chunks/Docstring.932cdff3.js";import{C as me}from"../chunks/CodeBlock.a9c4becf.js";import{H as S,E as le}from"../chunks/index.ef90fe87.js";function fe(U){let r,J,w,Z,f,F,c,Q='A Diffusion Transformer model for 3D data from <a href="https://github.com/aigc-apps/EasyAnimate" rel="nofollow">EasyAnimate</a> was introduced by Alibaba PAI.',j,p,K="The model can be loaded with the following code snippet.",I,u,H,_,L,i,h,X,E,ee='A Transformer model for video-like data in <a href="https://github.com/aigc-apps/EasyAnimate" rel="nofollow">EasyAnimate</a>.',N,g,q,d,y,G,A,te='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',C,b,O,k,V;return f=new S({props:{title:"EasyAnimateTransformer3DModel",local:"easyanimatetransformer3dmodel",headingTag:"h1"}}),u=new me({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEVhc3lBbmltYXRlVHJhbnNmb3JtZXIzRE1vZGVsJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBFYXN5QW5pbWF0ZVRyYW5zZm9ybWVyM0RNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYWxpYmFiYS1wYWklMkZFYXN5QW5pbWF0ZVY1LjEtMTJiLXpoJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIydHJhbnNmb3JtZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> EasyAnimateTransformer3DModel

transformer = EasyAnimateTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;alibaba-pai/EasyAnimateV5.1-12b-zh&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),_=new S({props:{title:"EasyAnimateTransformer3DModel",local:"diffusers.EasyAnimateTransformer3DModel",headingTag:"h2"}}),h=new ne({props:{name:"class diffusers.EasyAnimateTransformer3DModel",anchor:"diffusers.EasyAnimateTransformer3DModel",parameters:[{name:"num_attention_heads",val:": int = 48"},{name:"attention_head_dim",val:": int = 64"},{name:"in_channels",val:": typing.Optional[int] = None"},{name:"out_channels",val:": typing.Optional[int] = None"},{name:"patch_size",val:": typing.Optional[int] = None"},{name:"sample_width",val:": int = 90"},{name:"sample_height",val:": int = 60"},{name:"activation_fn",val:": str = 'gelu-approximate'"},{name:"timestep_activation_fn",val:": str = 'silu'"},{name:"freq_shift",val:": int = 0"},{name:"num_layers",val:": int = 48"},{name:"mmdit_layers",val:": int = 48"},{name:"dropout",val:": float = 0.0"},{name:"time_embed_dim",val:": int = 512"},{name:"add_norm_text_encoder",val:": bool = False"},{name:"text_embed_dim",val:": int = 3584"},{name:"text_embed_dim_t5",val:": int = None"},{name:"norm_eps",val:": float = 1e-05"},{name:"norm_elementwise_affine",val:": bool = True"},{name:"flip_sin_to_cos",val:": bool = True"},{name:"time_position_encoding_type",val:": str = '3d_rope'"},{name:"after_norm",val:" = False"},{name:"resize_inpaint_mask_directly",val:": bool = True"},{name:"enable_text_attention_mask",val:": bool = True"},{name:"add_noise_in_inpaint_model",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.EasyAnimateTransformer3DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, defaults to <code>48</code>) &#x2014;
The number of heads to use for multi-head attention.`,name:"num_attention_heads"},{anchor:"diffusers.EasyAnimateTransformer3DModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code>, defaults to <code>64</code>) &#x2014;
The number of channels in each head.`,name:"attention_head_dim"},{anchor:"diffusers.EasyAnimateTransformer3DModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>16</code>) &#x2014;
The number of channels in the input.`,name:"in_channels"},{anchor:"diffusers.EasyAnimateTransformer3DModel.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>16</code>) &#x2014;
The number of channels in the output.`,name:"out_channels"},{anchor:"diffusers.EasyAnimateTransformer3DModel.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
The size of the patches to use in the patch embedding layer.`,name:"patch_size"},{anchor:"diffusers.EasyAnimateTransformer3DModel.sample_width",description:`<strong>sample_width</strong> (<code>int</code>, defaults to <code>90</code>) &#x2014;
The width of the input latents.`,name:"sample_width"},{anchor:"diffusers.EasyAnimateTransformer3DModel.sample_height",description:`<strong>sample_height</strong> (<code>int</code>, defaults to <code>60</code>) &#x2014;
The height of the input latents.`,name:"sample_height"},{anchor:"diffusers.EasyAnimateTransformer3DModel.activation_fn",description:`<strong>activation_fn</strong> (<code>str</code>, defaults to <code>&quot;gelu-approximate&quot;</code>) &#x2014;
Activation function to use in feed-forward.`,name:"activation_fn"},{anchor:"diffusers.EasyAnimateTransformer3DModel.timestep_activation_fn",description:`<strong>timestep_activation_fn</strong> (<code>str</code>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
Activation function to use when generating the timestep embeddings.`,name:"timestep_activation_fn"},{anchor:"diffusers.EasyAnimateTransformer3DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to <code>30</code>) &#x2014;
The number of layers of Transformer blocks to use.`,name:"num_layers"},{anchor:"diffusers.EasyAnimateTransformer3DModel.mmdit_layers",description:`<strong>mmdit_layers</strong> (<code>int</code>, defaults to <code>1000</code>) &#x2014;
The number of layers of Multi Modal Transformer blocks to use.`,name:"mmdit_layers"},{anchor:"diffusers.EasyAnimateTransformer3DModel.dropout",description:`<strong>dropout</strong> (<code>float</code>, defaults to <code>0.0</code>) &#x2014;
The dropout probability to use.`,name:"dropout"},{anchor:"diffusers.EasyAnimateTransformer3DModel.time_embed_dim",description:`<strong>time_embed_dim</strong> (<code>int</code>, defaults to <code>512</code>) &#x2014;
Output dimension of timestep embeddings.`,name:"time_embed_dim"},{anchor:"diffusers.EasyAnimateTransformer3DModel.text_embed_dim",description:`<strong>text_embed_dim</strong> (<code>int</code>, defaults to <code>4096</code>) &#x2014;
Input dimension of text embeddings from the text encoder.`,name:"text_embed_dim"},{anchor:"diffusers.EasyAnimateTransformer3DModel.norm_eps",description:`<strong>norm_eps</strong> (<code>float</code>, defaults to <code>1e-5</code>) &#x2014;
The epsilon value to use in normalization layers.`,name:"norm_eps"},{anchor:"diffusers.EasyAnimateTransformer3DModel.norm_elementwise_affine",description:`<strong>norm_elementwise_affine</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to use elementwise affine in normalization layers.`,name:"norm_elementwise_affine"},{anchor:"diffusers.EasyAnimateTransformer3DModel.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.EasyAnimateTransformer3DModel.time_position_encoding_type",description:`<strong>time_position_encoding_type</strong> (<code>str</code>, defaults to <code>3d_rope</code>) &#x2014;
Type of time position encoding.`,name:"time_position_encoding_type"},{anchor:"diffusers.EasyAnimateTransformer3DModel.after_norm",description:`<strong>after_norm</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Flag to apply normalization after.`,name:"after_norm"},{anchor:"diffusers.EasyAnimateTransformer3DModel.resize_inpaint_mask_directly",description:`<strong>resize_inpaint_mask_directly</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Flag to resize inpaint mask directly.`,name:"resize_inpaint_mask_directly"},{anchor:"diffusers.EasyAnimateTransformer3DModel.enable_text_attention_mask",description:`<strong>enable_text_attention_mask</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Flag to enable text attention mask.`,name:"enable_text_attention_mask"},{anchor:"diffusers.EasyAnimateTransformer3DModel.add_noise_in_inpaint_model",description:`<strong>add_noise_in_inpaint_model</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Flag to add noise in inpaint model.`,name:"add_noise_in_inpaint_model"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_easyanimate.py#L318"}}),g=new S({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),y=new ne({props:{name:"class diffusers.models.modeling_outputs.Transformer2DModelOutput",anchor:"diffusers.models.modeling_outputs.Transformer2DModelOutput",parameters:[{name:"sample",val:": torch.Tensor"}],parametersDescription:[{anchor:"diffusers.models.modeling_outputs.Transformer2DModelOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> or <code>(batch size, num_vector_embeds - 1, num_latent_pixels)</code> if <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a> is discrete) &#x2014;
The hidden states output conditioned on the <code>encoder_hidden_states</code> input. If discrete, returns probability
distributions for the unnoised latent pixels.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_outputs.py#L20"}}),b=new le({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/easyanimate_transformer3d.md"}}),{c(){r=m("meta"),J=a(),w=m("p"),Z=a(),T(f.$$.fragment),F=a(),c=m("p"),c.innerHTML=Q,j=a(),p=m("p"),p.textContent=K,I=a(),T(u.$$.fragment),H=a(),T(_.$$.fragment),L=a(),i=m("div"),T(h.$$.fragment),X=a(),E=m("p"),E.innerHTML=ee,N=a(),T(g.$$.fragment),q=a(),d=m("div"),T(y.$$.fragment),G=a(),A=m("p"),A.innerHTML=te,C=a(),T(b.$$.fragment),O=a(),k=m("p"),this.h()},l(e){const t=de("svelte-u9bgzb",document.head);r=l(t,"META",{name:!0,content:!0}),t.forEach(n),J=s(e),w=l(e,"P",{}),R(w).forEach(n),Z=s(e),M(f.$$.fragment,e),F=s(e),c=l(e,"P",{"data-svelte-h":!0}),Y(c)!=="svelte-14a7gv2"&&(c.innerHTML=Q),j=s(e),p=l(e,"P",{"data-svelte-h":!0}),Y(p)!=="svelte-1vuni30"&&(p.textContent=K),I=s(e),M(u.$$.fragment,e),H=s(e),M(_.$$.fragment,e),L=s(e),i=l(e,"DIV",{class:!0});var W=R(i);M(h.$$.fragment,W),X=s(W),E=l(W,"P",{"data-svelte-h":!0}),Y(E)!=="svelte-xn9wgl"&&(E.innerHTML=ee),W.forEach(n),N=s(e),M(g.$$.fragment,e),q=s(e),d=l(e,"DIV",{class:!0});var P=R(d);M(y.$$.fragment,P),G=s(P),A=l(P,"P",{"data-svelte-h":!0}),Y(A)!=="svelte-1x8c0js"&&(A.innerHTML=te),P.forEach(n),C=s(e),M(b.$$.fragment,e),O=s(e),k=l(e,"P",{}),R(k).forEach(n),this.h()},h(){B(r,"name","hf:doc:metadata"),B(r,"content",ce),B(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(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(e,t){z(document.head,r),o(e,J,t),o(e,w,t),o(e,Z,t),v(f,e,t),o(e,F,t),o(e,c,t),o(e,j,t),o(e,p,t),o(e,I,t),v(u,e,t),o(e,H,t),v(_,e,t),o(e,L,t),o(e,i,t),v(h,i,null),z(i,X),z(i,E),o(e,N,t),v(g,e,t),o(e,q,t),o(e,d,t),v(y,d,null),z(d,G),z(d,A),o(e,C,t),v(b,e,t),o(e,O,t),o(e,k,t),V=!0},p:ae,i(e){V||($(f.$$.fragment,e),$(u.$$.fragment,e),$(_.$$.fragment,e),$(h.$$.fragment,e),$(g.$$.fragment,e),$(y.$$.fragment,e),$(b.$$.fragment,e),V=!0)},o(e){x(f.$$.fragment,e),x(u.$$.fragment,e),x(_.$$.fragment,e),x(h.$$.fragment,e),x(g.$$.fragment,e),x(y.$$.fragment,e),x(b.$$.fragment,e),V=!1},d(e){e&&(n(J),n(w),n(Z),n(F),n(c),n(j),n(p),n(I),n(H),n(L),n(i),n(N),n(q),n(d),n(C),n(O),n(k)),n(r),D(f,e),D(u,e),D(_,e),D(h),D(g,e),D(y),D(b,e)}}}const ce='{"title":"EasyAnimateTransformer3DModel","local":"easyanimatetransformer3dmodel","sections":[{"title":"EasyAnimateTransformer3DModel","local":"diffusers.EasyAnimateTransformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function pe(U){return se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class be extends re{constructor(r){super(),ie(this,r,pe,fe,oe,{})}}export{be as component};
