import{s as oe,n as re,o as se}from"../chunks/scheduler.8c3d61f6.js";import{S as ae,i as ie,g as m,s as r,r as M,A as de,h as l,f as n,c as s,j as R,u as v,x as U,k as J,y as k,a as o,v as b,d as x,t as D,w as y}from"../chunks/index.da70eac4.js";import{D as ne}from"../chunks/Docstring.6b390b9a.js";import{C as me}from"../chunks/CodeBlock.00a903b3.js";import{H as W,E as le}from"../chunks/EditOnGithub.1e64e623.js";function fe(X){let a,E,H,L,f,P,c,Y='A Diffusion Transformer model for 3D video-like data was introduced in <a href="https://huggingface.co/papers/2412.03603" rel="nofollow">HunyuanVideo: A Systematic Framework For Large Video Generative Models</a> by Tencent.',z,u,Z="The model can be loaded with the following code snippet.",C,h,V,p,A,i,_,K,w,ee='A Transformer model for video-like data introduced in <a href="https://huggingface.co/genmo/mochi-1-preview" rel="nofollow">Mochi</a>.',I,g,S,d,T,Q,q,te='The output of <a href="/docs/diffusers/pr_10136/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',j,$,F,O,G;return f=new W({props:{title:"HunyuanVideoTransformer3DModel",local:"hunyuanvideotransformer3dmodel",headingTag:"h1"}}),h=new me({props:{code:"VE9ETw==",highlighted:"TODO",wrap:!1}}),p=new W({props:{title:"HunyuanVideoTransformer3DModel",local:"diffusers.MochiTransformer3DModel",headingTag:"h2"}}),_=new ne({props:{name:"class diffusers.MochiTransformer3DModel",anchor:"diffusers.MochiTransformer3DModel",parameters:[{name:"patch_size",val:": int = 2"},{name:"num_attention_heads",val:": int = 24"},{name:"attention_head_dim",val:": int = 128"},{name:"num_layers",val:": int = 48"},{name:"pooled_projection_dim",val:": int = 1536"},{name:"in_channels",val:": int = 12"},{name:"out_channels",val:": typing.Optional[int] = None"},{name:"qk_norm",val:": str = 'rms_norm'"},{name:"text_embed_dim",val:": int = 4096"},{name:"time_embed_dim",val:": int = 256"},{name:"activation_fn",val:": str = 'swiglu'"},{name:"max_sequence_length",val:": int = 256"}],parametersDescription:[{anchor:"diffusers.MochiTransformer3DModel.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.MochiTransformer3DModel.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.MochiTransformer3DModel.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.MochiTransformer3DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to <code>48</code>) &#x2014;
The number of layers of Transformer blocks to use.`,name:"num_layers"},{anchor:"diffusers.MochiTransformer3DModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>12</code>) &#x2014;
The number of channels in the input.`,name:"in_channels"},{anchor:"diffusers.MochiTransformer3DModel.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of channels in the output.`,name:"out_channels"},{anchor:"diffusers.MochiTransformer3DModel.qk_norm",description:`<strong>qk_norm</strong> (<code>str</code>, defaults to <code>&quot;rms_norm&quot;</code>) &#x2014;
The normalization layer to use.`,name:"qk_norm"},{anchor:"diffusers.MochiTransformer3DModel.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.MochiTransformer3DModel.time_embed_dim",description:`<strong>time_embed_dim</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014;
Output dimension of timestep embeddings.`,name:"time_embed_dim"},{anchor:"diffusers.MochiTransformer3DModel.activation_fn",description:`<strong>activation_fn</strong> (<code>str</code>, defaults to <code>&quot;swiglu&quot;</code>) &#x2014;
Activation function to use in feed-forward.`,name:"activation_fn"},{anchor:"diffusers.MochiTransformer3DModel.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014;
The maximum sequence length of text embeddings supported.`,name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_10136/src/diffusers/models/transformers/transformer_mochi.py#L225"}}),g=new W({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),T=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/pr_10136/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/vr_10136/src/diffusers/models/modeling_outputs.py#L20"}}),$=new le({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/hunyuan_video_transformer_3d.md"}}),{c(){a=m("meta"),E=r(),H=m("p"),L=r(),M(f.$$.fragment),P=r(),c=m("p"),c.innerHTML=Y,z=r(),u=m("p"),u.textContent=Z,C=r(),M(h.$$.fragment),V=r(),M(p.$$.fragment),A=r(),i=m("div"),M(_.$$.fragment),K=r(),w=m("p"),w.innerHTML=ee,I=r(),M(g.$$.fragment),S=r(),d=m("div"),M(T.$$.fragment),Q=r(),q=m("p"),q.innerHTML=te,j=r(),M($.$$.fragment),F=r(),O=m("p"),this.h()},l(e){const t=de("svelte-u9bgzb",document.head);a=l(t,"META",{name:!0,content:!0}),t.forEach(n),E=s(e),H=l(e,"P",{}),R(H).forEach(n),L=s(e),v(f.$$.fragment,e),P=s(e),c=l(e,"P",{"data-svelte-h":!0}),U(c)!=="svelte-fdngxv"&&(c.innerHTML=Y),z=s(e),u=l(e,"P",{"data-svelte-h":!0}),U(u)!=="svelte-1vuni30"&&(u.textContent=Z),C=s(e),v(h.$$.fragment,e),V=s(e),v(p.$$.fragment,e),A=s(e),i=l(e,"DIV",{class:!0});var N=R(i);v(_.$$.fragment,N),K=s(N),w=l(N,"P",{"data-svelte-h":!0}),U(w)!=="svelte-133wd4y"&&(w.innerHTML=ee),N.forEach(n),I=s(e),v(g.$$.fragment,e),S=s(e),d=l(e,"DIV",{class:!0});var B=R(d);v(T.$$.fragment,B),Q=s(B),q=l(B,"P",{"data-svelte-h":!0}),U(q)!=="svelte-1lq1m3h"&&(q.innerHTML=te),B.forEach(n),j=s(e),v($.$$.fragment,e),F=s(e),O=l(e,"P",{}),R(O).forEach(n),this.h()},h(){J(a,"name","hf:doc:metadata"),J(a,"content",ce),J(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(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){k(document.head,a),o(e,E,t),o(e,H,t),o(e,L,t),b(f,e,t),o(e,P,t),o(e,c,t),o(e,z,t),o(e,u,t),o(e,C,t),b(h,e,t),o(e,V,t),b(p,e,t),o(e,A,t),o(e,i,t),b(_,i,null),k(i,K),k(i,w),o(e,I,t),b(g,e,t),o(e,S,t),o(e,d,t),b(T,d,null),k(d,Q),k(d,q),o(e,j,t),b($,e,t),o(e,F,t),o(e,O,t),G=!0},p:re,i(e){G||(x(f.$$.fragment,e),x(h.$$.fragment,e),x(p.$$.fragment,e),x(_.$$.fragment,e),x(g.$$.fragment,e),x(T.$$.fragment,e),x($.$$.fragment,e),G=!0)},o(e){D(f.$$.fragment,e),D(h.$$.fragment,e),D(p.$$.fragment,e),D(_.$$.fragment,e),D(g.$$.fragment,e),D(T.$$.fragment,e),D($.$$.fragment,e),G=!1},d(e){e&&(n(E),n(H),n(L),n(P),n(c),n(z),n(u),n(C),n(V),n(A),n(i),n(I),n(S),n(d),n(j),n(F),n(O)),n(a),y(f,e),y(h,e),y(p,e),y(_),y(g,e),y(T),y($,e)}}}const ce='{"title":"HunyuanVideoTransformer3DModel","local":"hunyuanvideotransformer3dmodel","sections":[{"title":"HunyuanVideoTransformer3DModel","local":"diffusers.MochiTransformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function ue(X){return se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $e extends ae{constructor(a){super(),ie(this,a,ue,fe,oe,{})}}export{$e as component};
