import{s as re,n as ne,o as ae}from"../chunks/scheduler.53228c21.js";import{S as se,i as oe,e as m,s as a,c as i,h as le,a as f,d as r,b as s,f as I,g as d,j as W,k as J,l as B,m as n,n as p,t as u,o as c,p as g}from"../chunks/index.100fac89.js";import{C as me}from"../chunks/CopyLLMTxtMenu.2cdbb51f.js";import{D as te}from"../chunks/Docstring.d46840f1.js";import{C as ie}from"../chunks/CodeBlock.d30a6509.js";import{H as N,E as fe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.3fcbbc76.js";function de(X){let o,U,E,j,h,Z,_,k,$,Y='A Diffusion Transformer model for 3D data from <a href="https://github.com/rhymes-ai/Allegro" rel="nofollow">Allegro</a> was introduced in <a href="https://huggingface.co/papers/2410.15458" rel="nofollow">Allegro: Open the Black Box of Commercial-Level Video Generation Model</a> by RhymesAI.',F,v,K="The model can be loaded with the following code snippet.",L,M,G,b,V,T,y,O,D,P,l,w,S,A,Q='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',z,x,R,C,q;return h=new me({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),_=new N({props:{title:"AllegroTransformer3DModel",local:"allegrotransformer3dmodel",headingTag:"h1"}}),M=new ie({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEFsbGVncm9UcmFuc2Zvcm1lcjNETW9kZWwlMEElMEF0cmFuc2Zvcm1lciUyMCUzRCUyMEFsbGVncm9UcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnJoeW1lcy1haSUyRkFsbGVncm8lMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ0cmFuc2Zvcm1lciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AllegroTransformer3DModel

transformer = AllegroTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;rhymes-ai/Allegro&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),b=new N({props:{title:"AllegroTransformer3DModel",local:"diffusers.AllegroTransformer3DModel",headingTag:"h2"}}),y=new te({props:{name:"class diffusers.AllegroTransformer3DModel",anchor:"diffusers.AllegroTransformer3DModel",parameters:[{name:"patch_size",val:": int = 2"},{name:"patch_size_t",val:": int = 1"},{name:"num_attention_heads",val:": int = 24"},{name:"attention_head_dim",val:": int = 96"},{name:"in_channels",val:": int = 4"},{name:"out_channels",val:": int = 4"},{name:"num_layers",val:": int = 32"},{name:"dropout",val:": float = 0.0"},{name:"cross_attention_dim",val:": int = 2304"},{name:"attention_bias",val:": bool = True"},{name:"sample_height",val:": int = 90"},{name:"sample_width",val:": int = 160"},{name:"sample_frames",val:": int = 22"},{name:"activation_fn",val:": str = 'gelu-approximate'"},{name:"norm_elementwise_affine",val:": bool = False"},{name:"norm_eps",val:": float = 1e-06"},{name:"caption_channels",val:": int = 4096"},{name:"interpolation_scale_h",val:": float = 2.0"},{name:"interpolation_scale_w",val:": float = 2.0"},{name:"interpolation_scale_t",val:": float = 2.2"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_allegro.py#L176"}}),D=new N({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),w=new te({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"}}),x=new fe({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/allegro_transformer3d.md"}}),{c(){o=m("meta"),U=a(),E=m("p"),j=a(),i(h.$$.fragment),Z=a(),i(_.$$.fragment),k=a(),$=m("p"),$.innerHTML=Y,F=a(),v=m("p"),v.textContent=K,L=a(),i(M.$$.fragment),G=a(),i(b.$$.fragment),V=a(),T=m("div"),i(y.$$.fragment),O=a(),i(D.$$.fragment),P=a(),l=m("div"),i(w.$$.fragment),S=a(),A=m("p"),A.innerHTML=Q,z=a(),i(x.$$.fragment),R=a(),C=m("p"),this.h()},l(e){const t=le("svelte-u9bgzb",document.head);o=f(t,"META",{name:!0,content:!0}),t.forEach(r),U=s(e),E=f(e,"P",{}),I(E).forEach(r),j=s(e),d(h.$$.fragment,e),Z=s(e),d(_.$$.fragment,e),k=s(e),$=f(e,"P",{"data-svelte-h":!0}),W($)!=="svelte-x6xll5"&&($.innerHTML=Y),F=s(e),v=f(e,"P",{"data-svelte-h":!0}),W(v)!=="svelte-1vuni30"&&(v.textContent=K),L=s(e),d(M.$$.fragment,e),G=s(e),d(b.$$.fragment,e),V=s(e),T=f(e,"DIV",{class:!0});var ee=I(T);d(y.$$.fragment,ee),ee.forEach(r),O=s(e),d(D.$$.fragment,e),P=s(e),l=f(e,"DIV",{class:!0});var H=I(l);d(w.$$.fragment,H),S=s(H),A=f(H,"P",{"data-svelte-h":!0}),W(A)!=="svelte-1x8c0js"&&(A.innerHTML=Q),H.forEach(r),z=s(e),d(x.$$.fragment,e),R=s(e),C=f(e,"P",{}),I(C).forEach(r),this.h()},h(){J(o,"name","hf:doc:metadata"),J(o,"content",pe),J(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(l,"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){B(document.head,o),n(e,U,t),n(e,E,t),n(e,j,t),p(h,e,t),n(e,Z,t),p(_,e,t),n(e,k,t),n(e,$,t),n(e,F,t),n(e,v,t),n(e,L,t),p(M,e,t),n(e,G,t),p(b,e,t),n(e,V,t),n(e,T,t),p(y,T,null),n(e,O,t),p(D,e,t),n(e,P,t),n(e,l,t),p(w,l,null),B(l,S),B(l,A),n(e,z,t),p(x,e,t),n(e,R,t),n(e,C,t),q=!0},p:ne,i(e){q||(u(h.$$.fragment,e),u(_.$$.fragment,e),u(M.$$.fragment,e),u(b.$$.fragment,e),u(y.$$.fragment,e),u(D.$$.fragment,e),u(w.$$.fragment,e),u(x.$$.fragment,e),q=!0)},o(e){c(h.$$.fragment,e),c(_.$$.fragment,e),c(M.$$.fragment,e),c(b.$$.fragment,e),c(y.$$.fragment,e),c(D.$$.fragment,e),c(w.$$.fragment,e),c(x.$$.fragment,e),q=!1},d(e){e&&(r(U),r(E),r(j),r(Z),r(k),r($),r(F),r(v),r(L),r(G),r(V),r(T),r(O),r(P),r(l),r(z),r(R),r(C)),r(o),g(h,e),g(_,e),g(M,e),g(b,e),g(y),g(D,e),g(w),g(x,e)}}}const pe='{"title":"AllegroTransformer3DModel","local":"allegrotransformer3dmodel","sections":[{"title":"AllegroTransformer3DModel","local":"diffusers.AllegroTransformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function ue(X){return ae(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Me extends se{constructor(o){super(),oe(this,o,ue,de,re,{})}}export{Me as component};
