import{s as ee,n as te,o as re}from"../chunks/scheduler.8c3d61f6.js";import{S as se,i as ae,g as m,s as a,r as M,A as ne,h as i,f as r,c as n,j as z,u as b,x as J,k as H,y as W,a as s,v as T,d as y,t as D,w}from"../chunks/index.da70eac4.js";import{D as Q}from"../chunks/Docstring.6b390b9a.js";import{C as oe}from"../chunks/CodeBlock.00a903b3.js";import{H as B,E as le}from"../chunks/EditOnGithub.1e64e623.js";function me(N){let o,U,A,C,f,j,d,S='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.',Z,p,X="The model can be loaded with the following code snippet.",k,u,F,c,G,g,h,V,_,L,l,$,I,x,Y='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',O,v,P,E,R;return f=new B({props:{title:"AllegroTransformer3DModel",local:"allegrotransformer3dmodel",headingTag:"h1"}}),u=new oe({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}}),c=new B({props:{title:"AllegroTransformer3DModel",local:"diffusers.AllegroTransformer3DModel",headingTag:"h2"}}),h=new Q({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"}}),_=new B({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),$=new Q({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"}}),v=new le({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/allegro_transformer3d.md"}}),{c(){o=m("meta"),U=a(),A=m("p"),C=a(),M(f.$$.fragment),j=a(),d=m("p"),d.innerHTML=S,Z=a(),p=m("p"),p.textContent=X,k=a(),M(u.$$.fragment),F=a(),M(c.$$.fragment),G=a(),g=m("div"),M(h.$$.fragment),V=a(),M(_.$$.fragment),L=a(),l=m("div"),M($.$$.fragment),I=a(),x=m("p"),x.innerHTML=Y,O=a(),M(v.$$.fragment),P=a(),E=m("p"),this.h()},l(e){const t=ne("svelte-u9bgzb",document.head);o=i(t,"META",{name:!0,content:!0}),t.forEach(r),U=n(e),A=i(e,"P",{}),z(A).forEach(r),C=n(e),b(f.$$.fragment,e),j=n(e),d=i(e,"P",{"data-svelte-h":!0}),J(d)!=="svelte-x6xll5"&&(d.innerHTML=S),Z=n(e),p=i(e,"P",{"data-svelte-h":!0}),J(p)!=="svelte-1vuni30"&&(p.textContent=X),k=n(e),b(u.$$.fragment,e),F=n(e),b(c.$$.fragment,e),G=n(e),g=i(e,"DIV",{class:!0});var K=z(g);b(h.$$.fragment,K),K.forEach(r),V=n(e),b(_.$$.fragment,e),L=n(e),l=i(e,"DIV",{class:!0});var q=z(l);b($.$$.fragment,q),I=n(q),x=i(q,"P",{"data-svelte-h":!0}),J(x)!=="svelte-1x8c0js"&&(x.innerHTML=Y),q.forEach(r),O=n(e),b(v.$$.fragment,e),P=n(e),E=i(e,"P",{}),z(E).forEach(r),this.h()},h(){H(o,"name","hf:doc:metadata"),H(o,"content",ie),H(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(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){W(document.head,o),s(e,U,t),s(e,A,t),s(e,C,t),T(f,e,t),s(e,j,t),s(e,d,t),s(e,Z,t),s(e,p,t),s(e,k,t),T(u,e,t),s(e,F,t),T(c,e,t),s(e,G,t),s(e,g,t),T(h,g,null),s(e,V,t),T(_,e,t),s(e,L,t),s(e,l,t),T($,l,null),W(l,I),W(l,x),s(e,O,t),T(v,e,t),s(e,P,t),s(e,E,t),R=!0},p:te,i(e){R||(y(f.$$.fragment,e),y(u.$$.fragment,e),y(c.$$.fragment,e),y(h.$$.fragment,e),y(_.$$.fragment,e),y($.$$.fragment,e),y(v.$$.fragment,e),R=!0)},o(e){D(f.$$.fragment,e),D(u.$$.fragment,e),D(c.$$.fragment,e),D(h.$$.fragment,e),D(_.$$.fragment,e),D($.$$.fragment,e),D(v.$$.fragment,e),R=!1},d(e){e&&(r(U),r(A),r(C),r(j),r(d),r(Z),r(p),r(k),r(F),r(G),r(g),r(V),r(L),r(l),r(O),r(P),r(E)),r(o),w(f,e),w(u,e),w(c,e),w(h),w(_,e),w($),w(v,e)}}}const ie='{"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 fe(N){return re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class he extends se{constructor(o){super(),ae(this,o,fe,me,ee,{})}}export{he as component};
