import{s as se,n as ae,o as de}from"../chunks/scheduler.53228c21.js";import{S as ie,i as me,e as m,s as r,c as u,h as le,a as l,d as t,b as s,f as U,g as f,j as X,k as A,l as J,m as o,n as c,t as p,o as h,p as _}from"../chunks/index.100fac89.js";import{C as ue}from"../chunks/CopyLLMTxtMenu.20a72e0e.js";import{D as re}from"../chunks/Docstring.49101787.js";import{C as fe}from"../chunks/CodeBlock.d30a6509.js";import{H as F,E as ce}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4d82655d.js";function pe(K){let a,Z,z,j,g,W,y,E,T,ee='A Diffusion Transformer model for 3D video-like data used in <a href="https://github.com/Tencent/HunyuanVideo1-1.5" rel="nofollow">HunyuanVideo1.5</a>.',L,b,ne="The model can be loaded with the following code snippet.",R,$,C,M,I,d,v,Q,V,te='A Transformer model for video-like data used in <a href="https://huggingface.co/tencent/HunyuanVideo1.5" rel="nofollow">HunyuanVideo1.5</a>.',P,x,q,i,D,Y,w,oe='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',B,H,G,k,N;return g=new ue({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),y=new F({props:{title:"HunyuanVideo15Transformer3DModel",local:"hunyuanvideo15transformer3dmodel",headingTag:"h1"}}),$=new fe({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEh1bnl1YW5WaWRlbzE1VHJhbnNmb3JtZXIzRE1vZGVsJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBIdW55dWFuVmlkZW8xNVRyYW5zZm9ybWVyM0RNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyaHVueXVhbnZpZGVvLWNvbW11bml0eSUyRkh1bnl1YW5WaWRlby0xLjUtRGlmZnVzZXJzLTQ4MHBfdDJ2JTIyJTIwc3ViZm9sZGVyJTNEJTIydHJhbnNmb3JtZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> HunyuanVideo15Transformer3DModel

transformer = HunyuanVideo15Transformer3DModel.from_pretrained(<span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_t2v&quot;</span> subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)`,wrap:!1}}),M=new F({props:{title:"HunyuanVideo15Transformer3DModel",local:"diffusers.HunyuanVideo15Transformer3DModel",headingTag:"h2"}}),v=new re({props:{name:"class diffusers.HunyuanVideo15Transformer3DModel",anchor:"diffusers.HunyuanVideo15Transformer3DModel",parameters:[{name:"in_channels",val:": int = 65"},{name:"out_channels",val:": int = 32"},{name:"num_attention_heads",val:": int = 16"},{name:"attention_head_dim",val:": int = 128"},{name:"num_layers",val:": int = 54"},{name:"num_refiner_layers",val:": int = 2"},{name:"mlp_ratio",val:": float = 4.0"},{name:"patch_size",val:": int = 1"},{name:"patch_size_t",val:": int = 1"},{name:"qk_norm",val:": str = 'rms_norm'"},{name:"text_embed_dim",val:": int = 3584"},{name:"text_embed_2_dim",val:": int = 1472"},{name:"image_embed_dim",val:": int = 1152"},{name:"rope_theta",val:": float = 256.0"},{name:"rope_axes_dim",val:": typing.Tuple[int, ...] = (16, 56, 56)"},{name:"target_size",val:": int = 640"},{name:"task_type",val:": str = 'i2v'"},{name:"use_meanflow",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.HunyuanVideo15Transformer3DModel.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.HunyuanVideo15Transformer3DModel.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, defaults to <code>16</code>) &#x2014;
The number of channels in the output.`,name:"out_channels"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, defaults to <code>24</code>) &#x2014;
The number of heads to use for multi-head attention.`,name:"num_attention_heads"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014;
The number of channels in each head.`,name:"attention_head_dim"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to <code>20</code>) &#x2014;
The number of layers of dual-stream blocks to use.`,name:"num_layers"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.num_refiner_layers",description:`<strong>num_refiner_layers</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
The number of layers of refiner blocks to use.`,name:"num_refiner_layers"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, defaults to <code>4.0</code>) &#x2014;
The ratio of the hidden layer size to the input size in the feedforward network.`,name:"mlp_ratio"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
The size of the spatial patches to use in the patch embedding layer.`,name:"patch_size"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.patch_size_t",description:`<strong>patch_size_t</strong> (<code>int</code>, defaults to <code>1</code>) &#x2014;
The size of the tmeporal patches to use in the patch embedding layer.`,name:"patch_size_t"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.qk_norm",description:`<strong>qk_norm</strong> (<code>str</code>, defaults to <code>rms_norm</code>) &#x2014;
The normalization to use for the query and key projections in the attention layers.`,name:"qk_norm"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.guidance_embeds",description:`<strong>guidance_embeds</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to use guidance embeddings in the model.`,name:"guidance_embeds"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.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.HunyuanVideo15Transformer3DModel.pooled_projection_dim",description:`<strong>pooled_projection_dim</strong> (<code>int</code>, defaults to <code>768</code>) &#x2014;
The dimension of the pooled projection of the text embeddings.`,name:"pooled_projection_dim"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, defaults to <code>256.0</code>) &#x2014;
The value of theta to use in the RoPE layer.`,name:"rope_theta"},{anchor:"diffusers.HunyuanVideo15Transformer3DModel.rope_axes_dim",description:`<strong>rope_axes_dim</strong> (<code>Tuple[int]</code>, defaults to <code>(16, 56, 56)</code>) &#x2014;
The dimensions of the axes to use in the RoPE layer.`,name:"rope_axes_dim"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_hunyuan_video15.py#L510"}}),x=new F({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),D=new re({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"}}),H=new ce({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/hunyuan_video15_transformer_3d.md"}}),{c(){a=m("meta"),Z=r(),z=m("p"),j=r(),u(g.$$.fragment),W=r(),u(y.$$.fragment),E=r(),T=m("p"),T.innerHTML=ee,L=r(),b=m("p"),b.textContent=ne,R=r(),u($.$$.fragment),C=r(),u(M.$$.fragment),I=r(),d=m("div"),u(v.$$.fragment),Q=r(),V=m("p"),V.innerHTML=te,P=r(),u(x.$$.fragment),q=r(),i=m("div"),u(D.$$.fragment),Y=r(),w=m("p"),w.innerHTML=oe,B=r(),u(H.$$.fragment),G=r(),k=m("p"),this.h()},l(e){const n=le("svelte-u9bgzb",document.head);a=l(n,"META",{name:!0,content:!0}),n.forEach(t),Z=s(e),z=l(e,"P",{}),U(z).forEach(t),j=s(e),f(g.$$.fragment,e),W=s(e),f(y.$$.fragment,e),E=s(e),T=l(e,"P",{"data-svelte-h":!0}),X(T)!=="svelte-1o0oh00"&&(T.innerHTML=ee),L=s(e),b=l(e,"P",{"data-svelte-h":!0}),X(b)!=="svelte-1vuni30"&&(b.textContent=ne),R=s(e),f($.$$.fragment,e),C=s(e),f(M.$$.fragment,e),I=s(e),d=l(e,"DIV",{class:!0});var O=U(d);f(v.$$.fragment,O),Q=s(O),V=l(O,"P",{"data-svelte-h":!0}),X(V)!=="svelte-1anxe62"&&(V.innerHTML=te),O.forEach(t),P=s(e),f(x.$$.fragment,e),q=s(e),i=l(e,"DIV",{class:!0});var S=U(i);f(D.$$.fragment,S),Y=s(S),w=l(S,"P",{"data-svelte-h":!0}),X(w)!=="svelte-1x8c0js"&&(w.innerHTML=oe),S.forEach(t),B=s(e),f(H.$$.fragment,e),G=s(e),k=l(e,"P",{}),U(k).forEach(t),this.h()},h(){A(a,"name","hf:doc:metadata"),A(a,"content",he),A(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(i,"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,n){J(document.head,a),o(e,Z,n),o(e,z,n),o(e,j,n),c(g,e,n),o(e,W,n),c(y,e,n),o(e,E,n),o(e,T,n),o(e,L,n),o(e,b,n),o(e,R,n),c($,e,n),o(e,C,n),c(M,e,n),o(e,I,n),o(e,d,n),c(v,d,null),J(d,Q),J(d,V),o(e,P,n),c(x,e,n),o(e,q,n),o(e,i,n),c(D,i,null),J(i,Y),J(i,w),o(e,B,n),c(H,e,n),o(e,G,n),o(e,k,n),N=!0},p:ae,i(e){N||(p(g.$$.fragment,e),p(y.$$.fragment,e),p($.$$.fragment,e),p(M.$$.fragment,e),p(v.$$.fragment,e),p(x.$$.fragment,e),p(D.$$.fragment,e),p(H.$$.fragment,e),N=!0)},o(e){h(g.$$.fragment,e),h(y.$$.fragment,e),h($.$$.fragment,e),h(M.$$.fragment,e),h(v.$$.fragment,e),h(x.$$.fragment,e),h(D.$$.fragment,e),h(H.$$.fragment,e),N=!1},d(e){e&&(t(Z),t(z),t(j),t(W),t(E),t(T),t(L),t(b),t(R),t(C),t(I),t(d),t(P),t(q),t(i),t(B),t(G),t(k)),t(a),_(g,e),_(y,e),_($,e),_(M,e),_(v),_(x,e),_(D),_(H,e)}}}const he='{"title":"HunyuanVideo15Transformer3DModel","local":"hunyuanvideo15transformer3dmodel","sections":[{"title":"HunyuanVideo15Transformer3DModel","local":"diffusers.HunyuanVideo15Transformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function _e(K){return de(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ve extends ie{constructor(a){super(),me(this,a,_e,pe,se,{})}}export{ve as component};
