import{s as se,n as re,o as ie}from"../chunks/scheduler.53228c21.js";import{S as de,i as me,e as m,s as a,c as f,h as le,a as l,d as n,b as s,f as B,g as c,j as X,k as G,l as J,m as o,n as p,t as u,o as _,p as h}from"../chunks/index.100fac89.js";import{C as fe}from"../chunks/CopyLLMTxtMenu.b0ff86f3.js";import{D as ae}from"../chunks/Docstring.db856a1e.js";import{C as ce}from"../chunks/CodeBlock.d30a6509.js";import{H as Q,E as pe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.136ef3fd.js";function ue(K){let r,Z,k,F,g,L,y,j,b,ee='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.',C,T,te="The model can be loaded with the following code snippet.",I,M,H,$,N,i,v,S,A,ne='A Transformer model for video-like data in <a href="https://github.com/aigc-apps/EasyAnimate" rel="nofollow">EasyAnimate</a>.',q,x,O,d,D,U,w,oe='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',V,E,W,z,P;return g=new fe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),y=new Q({props:{title:"EasyAnimateTransformer3DModel",local:"easyanimatetransformer3dmodel",headingTag:"h1"}}),M=new ce({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 Q({props:{title:"EasyAnimateTransformer3DModel",local:"diffusers.EasyAnimateTransformer3DModel",headingTag:"h2"}}),v=new ae({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"}}),x=new Q({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),D=new ae({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#L21"}}),E=new pe({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/easyanimate_transformer3d.md"}}),{c(){r=m("meta"),Z=a(),k=m("p"),F=a(),f(g.$$.fragment),L=a(),f(y.$$.fragment),j=a(),b=m("p"),b.innerHTML=ee,C=a(),T=m("p"),T.textContent=te,I=a(),f(M.$$.fragment),H=a(),f($.$$.fragment),N=a(),i=m("div"),f(v.$$.fragment),S=a(),A=m("p"),A.innerHTML=ne,q=a(),f(x.$$.fragment),O=a(),d=m("div"),f(D.$$.fragment),U=a(),w=m("p"),w.innerHTML=oe,V=a(),f(E.$$.fragment),W=a(),z=m("p"),this.h()},l(e){const t=le("svelte-u9bgzb",document.head);r=l(t,"META",{name:!0,content:!0}),t.forEach(n),Z=s(e),k=l(e,"P",{}),B(k).forEach(n),F=s(e),c(g.$$.fragment,e),L=s(e),c(y.$$.fragment,e),j=s(e),b=l(e,"P",{"data-svelte-h":!0}),X(b)!=="svelte-14a7gv2"&&(b.innerHTML=ee),C=s(e),T=l(e,"P",{"data-svelte-h":!0}),X(T)!=="svelte-1vuni30"&&(T.textContent=te),I=s(e),c(M.$$.fragment,e),H=s(e),c($.$$.fragment,e),N=s(e),i=l(e,"DIV",{class:!0});var R=B(i);c(v.$$.fragment,R),S=s(R),A=l(R,"P",{"data-svelte-h":!0}),X(A)!=="svelte-xn9wgl"&&(A.innerHTML=ne),R.forEach(n),q=s(e),c(x.$$.fragment,e),O=s(e),d=l(e,"DIV",{class:!0});var Y=B(d);c(D.$$.fragment,Y),U=s(Y),w=l(Y,"P",{"data-svelte-h":!0}),X(w)!=="svelte-1x8c0js"&&(w.innerHTML=oe),Y.forEach(n),V=s(e),c(E.$$.fragment,e),W=s(e),z=l(e,"P",{}),B(z).forEach(n),this.h()},h(){G(r,"name","hf:doc:metadata"),G(r,"content",_e),G(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),G(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){J(document.head,r),o(e,Z,t),o(e,k,t),o(e,F,t),p(g,e,t),o(e,L,t),p(y,e,t),o(e,j,t),o(e,b,t),o(e,C,t),o(e,T,t),o(e,I,t),p(M,e,t),o(e,H,t),p($,e,t),o(e,N,t),o(e,i,t),p(v,i,null),J(i,S),J(i,A),o(e,q,t),p(x,e,t),o(e,O,t),o(e,d,t),p(D,d,null),J(d,U),J(d,w),o(e,V,t),p(E,e,t),o(e,W,t),o(e,z,t),P=!0},p:re,i(e){P||(u(g.$$.fragment,e),u(y.$$.fragment,e),u(M.$$.fragment,e),u($.$$.fragment,e),u(v.$$.fragment,e),u(x.$$.fragment,e),u(D.$$.fragment,e),u(E.$$.fragment,e),P=!0)},o(e){_(g.$$.fragment,e),_(y.$$.fragment,e),_(M.$$.fragment,e),_($.$$.fragment,e),_(v.$$.fragment,e),_(x.$$.fragment,e),_(D.$$.fragment,e),_(E.$$.fragment,e),P=!1},d(e){e&&(n(Z),n(k),n(F),n(L),n(j),n(b),n(C),n(T),n(I),n(H),n(N),n(i),n(q),n(O),n(d),n(V),n(W),n(z)),n(r),h(g,e),h(y,e),h(M,e),h($,e),h(v),h(x,e),h(D),h(E,e)}}}const _e='{"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 he(K){return ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ve extends de{constructor(r){super(),me(this,r,he,ue,se,{})}}export{ve as component};
