Buckets:

HuggingFaceDocBuilder's picture
download
raw
17.2 kB
import{s as fe,n as pe,o as he}from"../chunks/scheduler.53228c21.js";import{S as ue,i as _e,e as i,s as n,c,h as ge,a as d,d as t,b as r,f as I,g as f,j as R,k as C,l as p,m as s,n as h,t as u,o as _,p as g}from"../chunks/index.cac5d66a.js";import{C as Te}from"../chunks/CopyLLMTxtMenu.5ac9ab94.js";import{D as ne}from"../chunks/Docstring.8a316450.js";import{C as ye}from"../chunks/CodeBlock.606cbaf4.js";import{H as re,E as Me}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.92b2cd9d.js";function be(ae){let l,V,z,E,y,q,M,B,b,ie='A 14B Real-Time Autogressive Diffusion Transformer model (support T2V, I2V and V2V) for 3D video-like data from <a href="https://github.com/PKU-YuanGroup/Helios" rel="nofollow">Helios</a> was introduced in <a href="https://huggingface.co/papers/2603.04379" rel="nofollow">Helios: Real Real-Time Long Video Generation Model</a> by Peking University &amp; ByteDance &amp; etc.',X,v,de="The model can be loaded with the following code snippet.",G,$,L,D,F,a,w,ee,j,le="A Transformer model for video-like data used in the Helios model.",oe,T,x,te,k,me='The <a href="/docs/diffusers/pr_13813/en/api/models/helios_transformer3d#diffusers.HeliosTransformer3DModel">HeliosTransformer3DModel</a> forward method.',Y,H,P,m,J,se,N,ce='The output of <a href="/docs/diffusers/pr_13813/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',Q,Z,S,U,O;return y=new Te({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),M=new re({props:{title:"HeliosTransformer3DModel",local:"heliostransformer3dmodel",headingTag:"h1"}}),$=new ye({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEhlbGlvc1RyYW5zZm9ybWVyM0RNb2RlbCUwQSUwQSUyMyUyMEJlc3QlMjBRdWFsaXR5JTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBIZWxpb3NUcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkJlc3RXaXNoWXNoJTJGSGVsaW9zLUJhc2UlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ0cmFuc2Zvcm1lciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYpJTBBJTIzJTIwSW50ZXJtZWRpYXRlJTIwV2VpZ2h0JTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBIZWxpb3NUcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkJlc3RXaXNoWXNoJTJGSGVsaW9zLU1pZCUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnRyYW5zZm9ybWVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEElMjMlMjBCZXN0JTIwRWZmaWNpZW5jeSUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwSGVsaW9zVHJhbnNmb3JtZXIzRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJCZXN0V2lzaFlzaCUyRkhlbGlvcy1EaXN0aWxsZWQlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ0cmFuc2Zvcm1lciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> HeliosTransformer3DModel
<span class="hljs-comment"># Best Quality</span>
transformer = HeliosTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;BestWishYsh/Helios-Base&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-comment"># Intermediate Weight</span>
transformer = HeliosTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;BestWishYsh/Helios-Mid&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-comment"># Best Efficiency</span>
transformer = HeliosTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;BestWishYsh/Helios-Distilled&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)`,lang:"python",wrap:!1}}),D=new re({props:{title:"HeliosTransformer3DModel",local:"diffusers.HeliosTransformer3DModel",headingTag:"h2"}}),w=new ne({props:{name:"class diffusers.HeliosTransformer3DModel",anchor:"diffusers.HeliosTransformer3DModel",parameters:[{name:"patch_size",val:": tuple = (1, 2, 2)"},{name:"num_attention_heads",val:": int = 40"},{name:"attention_head_dim",val:": int = 128"},{name:"in_channels",val:": int = 16"},{name:"out_channels",val:": int = 16"},{name:"text_dim",val:": int = 4096"},{name:"freq_dim",val:": int = 256"},{name:"ffn_dim",val:": int = 13824"},{name:"num_layers",val:": int = 40"},{name:"cross_attn_norm",val:": bool = True"},{name:"qk_norm",val:": str | None = 'rms_norm_across_heads'"},{name:"eps",val:": float = 1e-06"},{name:"added_kv_proj_dim",val:": int | None = None"},{name:"rope_dim",val:": tuple = (44, 42, 42)"},{name:"rope_theta",val:": float = 10000.0"},{name:"guidance_cross_attn",val:": bool = True"},{name:"zero_history_timestep",val:": bool = True"},{name:"has_multi_term_memory_patch",val:": bool = True"},{name:"is_amplify_history",val:": bool = False"},{name:"history_scale_mode",val:": str = 'per_head'"}],parametersDescription:[{anchor:"diffusers.HeliosTransformer3DModel.patch_size",description:`<strong>patch_size</strong> (<code>tuple[int]</code>, defaults to <code>(1, 2, 2)</code>) &#x2014;
3D patch dimensions for video embedding (t_patch, h_patch, w_patch).`,name:"patch_size"},{anchor:"diffusers.HeliosTransformer3DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, defaults to <code>40</code>) &#x2014;
Fixed length for text embeddings.`,name:"num_attention_heads"},{anchor:"diffusers.HeliosTransformer3DModel.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.HeliosTransformer3DModel.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.HeliosTransformer3DModel.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.HeliosTransformer3DModel.text_dim",description:`<strong>text_dim</strong> (<code>int</code>, defaults to <code>512</code>) &#x2014;
Input dimension for text embeddings.`,name:"text_dim"},{anchor:"diffusers.HeliosTransformer3DModel.freq_dim",description:`<strong>freq_dim</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014;
Dimension for sinusoidal time embeddings.`,name:"freq_dim"},{anchor:"diffusers.HeliosTransformer3DModel.ffn_dim",description:`<strong>ffn_dim</strong> (<code>int</code>, defaults to <code>13824</code>) &#x2014;
Intermediate dimension in feed-forward network.`,name:"ffn_dim"},{anchor:"diffusers.HeliosTransformer3DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to <code>40</code>) &#x2014;
The number of layers of transformer blocks to use.`,name:"num_layers"},{anchor:"diffusers.HeliosTransformer3DModel.window_size",description:`<strong>window_size</strong> (<code>tuple[int]</code>, defaults to <code>(-1, -1)</code>) &#x2014;
Window size for local attention (-1 indicates global attention).`,name:"window_size"},{anchor:"diffusers.HeliosTransformer3DModel.cross_attn_norm",description:`<strong>cross_attn_norm</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Enable cross-attention normalization.`,name:"cross_attn_norm"},{anchor:"diffusers.HeliosTransformer3DModel.qk_norm",description:`<strong>qk_norm</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Enable query/key normalization.`,name:"qk_norm"},{anchor:"diffusers.HeliosTransformer3DModel.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to <code>1e-6</code>) &#x2014;
Epsilon value for normalization layers.`,name:"eps"},{anchor:"diffusers.HeliosTransformer3DModel.add_img_emb",description:`<strong>add_img_emb</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use img_emb.`,name:"add_img_emb"},{anchor:"diffusers.HeliosTransformer3DModel.added_kv_proj_dim",description:`<strong>added_kv_proj_dim</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of channels to use for the added key and value projections. If <code>None</code>, no projection is used.`,name:"added_kv_proj_dim"}],source:"https://github.com/huggingface/diffusers/blob/vr_13813/src/diffusers/models/transformers/transformer_helios.py#L497"}}),x=new ne({props:{name:"forward",anchor:"diffusers.HeliosTransformer3DModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"timestep",val:": LongTensor"},{name:"encoder_hidden_states",val:": Tensor"},{name:"indices_hidden_states",val:" = None"},{name:"indices_latents_history_short",val:" = None"},{name:"indices_latents_history_mid",val:" = None"},{name:"indices_latents_history_long",val:" = None"},{name:"latents_history_short",val:" = None"},{name:"latents_history_mid",val:" = None"},{name:"latents_history_long",val:" = None"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"}],parametersDescription:[{anchor:"diffusers.HeliosTransformer3DModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, num_frames, height, width)</code>) &#x2014;
Input <code>hidden_states</code>.`,name:"hidden_states"},{anchor:"diffusers.HeliosTransformer3DModel.forward.timestep",description:`<strong>timestep</strong> (<code>torch.LongTensor</code>) &#x2014;
Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.HeliosTransformer3DModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_len, embed_dims)</code>) &#x2014;
Conditional embeddings (embeddings computed from the input conditions such as prompts) to use.`,name:"encoder_hidden_states"},{anchor:"diffusers.HeliosTransformer3DModel.forward.indices_hidden_states",description:`<strong>indices_hidden_states</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Frame indices for <code>hidden_states</code> used to compute the rotary positional embeddings.`,name:"indices_hidden_states"},{anchor:"diffusers.HeliosTransformer3DModel.forward.indices_latents_history_short",description:`<strong>indices_latents_history_short</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Frame indices for the short history latents.`,name:"indices_latents_history_short"},{anchor:"diffusers.HeliosTransformer3DModel.forward.indices_latents_history_mid",description:`<strong>indices_latents_history_mid</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Frame indices for the mid history latents.`,name:"indices_latents_history_mid"},{anchor:"diffusers.HeliosTransformer3DModel.forward.indices_latents_history_long",description:`<strong>indices_latents_history_long</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Frame indices for the long history latents.`,name:"indices_latents_history_long"},{anchor:"diffusers.HeliosTransformer3DModel.forward.latents_history_short",description:`<strong>latents_history_short</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Short history latents conditioning.`,name:"latents_history_short"},{anchor:"diffusers.HeliosTransformer3DModel.forward.latents_history_mid",description:`<strong>latents_history_mid</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Mid history latents conditioning.`,name:"latents_history_mid"},{anchor:"diffusers.HeliosTransformer3DModel.forward.latents_history_long",description:`<strong>latents_history_long</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Long history latents conditioning.`,name:"latents_history_long"},{anchor:"diffusers.HeliosTransformer3DModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~models.transformer_2d.Transformer2DModelOutput</code> instead of a plain
tuple.`,name:"return_dict"},{anchor:"diffusers.HeliosTransformer3DModel.forward.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/vr_13813/src/diffusers/models/transformers/transformer_helios.py#L657",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is True, an <code>~models.transformer_2d.Transformer2DModelOutput</code> is returned, otherwise a
<code>tuple</code> where the first element is the sample tensor.</p>
`}}),H=new re({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),J=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_13813/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_13813/src/diffusers/models/modeling_outputs.py#L21"}}),Z=new Me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/helios_transformer3d.md"}}),{c(){l=i("meta"),V=n(),z=i("p"),E=n(),c(y.$$.fragment),q=n(),c(M.$$.fragment),B=n(),b=i("p"),b.innerHTML=ie,X=n(),v=i("p"),v.textContent=de,G=n(),c($.$$.fragment),L=n(),c(D.$$.fragment),F=n(),a=i("div"),c(w.$$.fragment),ee=n(),j=i("p"),j.textContent=le,oe=n(),T=i("div"),c(x.$$.fragment),te=n(),k=i("p"),k.innerHTML=me,Y=n(),c(H.$$.fragment),P=n(),m=i("div"),c(J.$$.fragment),se=n(),N=i("p"),N.innerHTML=ce,Q=n(),c(Z.$$.fragment),S=n(),U=i("p"),this.h()},l(e){const o=ge("svelte-u9bgzb",document.head);l=d(o,"META",{name:!0,content:!0}),o.forEach(t),V=r(e),z=d(e,"P",{}),I(z).forEach(t),E=r(e),f(y.$$.fragment,e),q=r(e),f(M.$$.fragment,e),B=r(e),b=d(e,"P",{"data-svelte-h":!0}),R(b)!=="svelte-148zs2y"&&(b.innerHTML=ie),X=r(e),v=d(e,"P",{"data-svelte-h":!0}),R(v)!=="svelte-1vuni30"&&(v.textContent=de),G=r(e),f($.$$.fragment,e),L=r(e),f(D.$$.fragment,e),F=r(e),a=d(e,"DIV",{class:!0});var W=I(a);f(w.$$.fragment,W),ee=r(W),j=d(W,"P",{"data-svelte-h":!0}),R(j)!=="svelte-1um4p8x"&&(j.textContent=le),oe=r(W),T=d(W,"DIV",{class:!0});var A=I(T);f(x.$$.fragment,A),te=r(A),k=d(A,"P",{"data-svelte-h":!0}),R(k)!=="svelte-1de304g"&&(k.innerHTML=me),A.forEach(t),W.forEach(t),Y=r(e),f(H.$$.fragment,e),P=r(e),m=d(e,"DIV",{class:!0});var K=I(m);f(J.$$.fragment,K),se=r(K),N=d(K,"P",{"data-svelte-h":!0}),R(N)!=="svelte-zeg0js"&&(N.innerHTML=ce),K.forEach(t),Q=r(e),f(Z.$$.fragment,e),S=r(e),U=d(e,"P",{}),I(U).forEach(t),this.h()},h(){C(l,"name","hf:doc:metadata"),C(l,"content",ve),C(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(m,"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,o){p(document.head,l),s(e,V,o),s(e,z,o),s(e,E,o),h(y,e,o),s(e,q,o),h(M,e,o),s(e,B,o),s(e,b,o),s(e,X,o),s(e,v,o),s(e,G,o),h($,e,o),s(e,L,o),h(D,e,o),s(e,F,o),s(e,a,o),h(w,a,null),p(a,ee),p(a,j),p(a,oe),p(a,T),h(x,T,null),p(T,te),p(T,k),s(e,Y,o),h(H,e,o),s(e,P,o),s(e,m,o),h(J,m,null),p(m,se),p(m,N),s(e,Q,o),h(Z,e,o),s(e,S,o),s(e,U,o),O=!0},p:pe,i(e){O||(u(y.$$.fragment,e),u(M.$$.fragment,e),u($.$$.fragment,e),u(D.$$.fragment,e),u(w.$$.fragment,e),u(x.$$.fragment,e),u(H.$$.fragment,e),u(J.$$.fragment,e),u(Z.$$.fragment,e),O=!0)},o(e){_(y.$$.fragment,e),_(M.$$.fragment,e),_($.$$.fragment,e),_(D.$$.fragment,e),_(w.$$.fragment,e),_(x.$$.fragment,e),_(H.$$.fragment,e),_(J.$$.fragment,e),_(Z.$$.fragment,e),O=!1},d(e){e&&(t(V),t(z),t(E),t(q),t(B),t(b),t(X),t(v),t(G),t(L),t(F),t(a),t(Y),t(P),t(m),t(Q),t(S),t(U)),t(l),g(y,e),g(M,e),g($,e),g(D,e),g(w),g(x),g(H,e),g(J),g(Z,e)}}}const ve='{"title":"HeliosTransformer3DModel","local":"heliostransformer3dmodel","sections":[{"title":"HeliosTransformer3DModel","local":"diffusers.HeliosTransformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function $e(ae){return he(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class je extends ue{constructor(l){super(),_e(this,l,$e,be,fe,{})}}export{je as component};

Xet Storage Details

Size:
17.2 kB
·
Xet hash:
9681e0a617457b942eb7c990fe27ca8311ccb1f7ebc8fcc3437aec2654684b71

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.