Buckets:
| import{s as te,n as oe,o as ne}from"../chunks/scheduler.53228c21.js";import{S as re,i as se,e as i,s as r,c as M,h as ae,a as m,d as o,b as s,f as U,g as D,j as G,k as F,l as c,m as a,n as y,t as I,o as w,p as k}from"../chunks/index.cac5d66a.js";import{C as de}from"../chunks/CopyLLMTxtMenu.0ef49226.js";import{D as Z}from"../chunks/Docstring.9de32ff4.js";import{H as ee,E as ie}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.48d5cb47.js";function me(W){let d,L,P,C,u,E,h,q,p,J='A transformer for image-like data from <a href="https://github.com/ideogram-oss/ideogram-4" rel="nofollow">Ideogram 4</a>.',O,g,N,n,_,V,$,Q="The flow-matching transformer backbone used by the Ideogram 4 pipeline.",j,x,X=`The transformer operates on a single packed sequence containing both text-conditioning tokens (produced by a | |
| multimodal text encoder) and the patchified image latents. Per-token indicators distinguish the two roles, and a | |
| block-diagonal attention mask derived from <code>segment_ids</code> restricts each sample to attend only to itself within a | |
| packed batch.`,B,l,T,K,v,Y="Predict the flow-matching velocity for the image-token positions of the packed sequence.",A,b,R,z,H;return u=new de({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new ee({props:{title:"Ideogram4Transformer2DModel",local:"ideogram4transformer2dmodel",headingTag:"h1"}}),g=new ee({props:{title:"Ideogram4Transformer2DModel",local:"diffusers.Ideogram4Transformer2DModel",headingTag:"h2"}}),_=new Z({props:{name:"class diffusers.Ideogram4Transformer2DModel",anchor:"diffusers.Ideogram4Transformer2DModel",parameters:[{name:"in_channels",val:": int = 128"},{name:"num_layers",val:": int = 34"},{name:"attention_head_dim",val:": int = 256"},{name:"num_attention_heads",val:": int = 18"},{name:"intermediate_size",val:": int = 12288"},{name:"adaln_dim",val:": int = 512"},{name:"llm_features_dim",val:": int = 53248"},{name:"rope_theta",val:": int = 5000000"},{name:"mrope_section",val:": tuple = (24, 20, 20)"},{name:"norm_eps",val:": float = 1e-05"}],parametersDescription:[{anchor:"diffusers.Ideogram4Transformer2DModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to 128) — | |
| Latent channel count after patchification (<code>ae_channels * patch_size ** 2</code>).`,name:"in_channels"},{anchor:"diffusers.Ideogram4Transformer2DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to 34) — | |
| Number of transformer blocks.`,name:"num_layers"},{anchor:"diffusers.Ideogram4Transformer2DModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code>, defaults to 256) — | |
| Dimension of each attention head; the total hidden size is <code>attention_head_dim * num_attention_heads</code>.`,name:"attention_head_dim"},{anchor:"diffusers.Ideogram4Transformer2DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, defaults to 18) — | |
| Number of attention heads.`,name:"num_attention_heads"},{anchor:"diffusers.Ideogram4Transformer2DModel.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, defaults to 12288) — | |
| Feed-forward hidden size used by the SwiGLU MLP inside each block.`,name:"intermediate_size"},{anchor:"diffusers.Ideogram4Transformer2DModel.adaln_dim",description:`<strong>adaln_dim</strong> (<code>int</code>, defaults to 512) — | |
| Dimensionality of the conditioning vector consumed by the AdaLN modulations.`,name:"adaln_dim"},{anchor:"diffusers.Ideogram4Transformer2DModel.llm_features_dim",description:`<strong>llm_features_dim</strong> (<code>int</code>, defaults to 53248) — | |
| Dimensionality of the per-token text features fed into the model (typically a concatenation of hidden | |
| states from several layers of the text encoder).`,name:"llm_features_dim"},{anchor:"diffusers.Ideogram4Transformer2DModel.rope_theta",description:`<strong>rope_theta</strong> (<code>int</code>, defaults to 5_000_000) — | |
| Base used by the multi-axis rotary position embedding.`,name:"rope_theta"},{anchor:"diffusers.Ideogram4Transformer2DModel.mrope_section",description:`<strong>mrope_section</strong> (<code>tuple[int, int, int]</code>, defaults to <code>(24, 20, 20)</code>) — | |
| Number of frequencies allocated to each of the (t, h, w) axes of MRoPE.`,name:"mrope_section"},{anchor:"diffusers.Ideogram4Transformer2DModel.norm_eps",description:`<strong>norm_eps</strong> (<code>float</code>, defaults to 1e-5) — | |
| Epsilon used by the RMSNorm modules inside the transformer blocks.`,name:"norm_eps"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/transformers/transformer_ideogram4.py#L273"}}),T=new Z({props:{name:"forward",anchor:"diffusers.Ideogram4Transformer2DModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"timestep",val:": Tensor"},{name:"encoder_hidden_states",val:": Tensor"},{name:"position_ids",val:": Tensor"},{name:"segment_ids",val:": Tensor"},{name:"indicator",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.Ideogram4Transformer2DModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, in_channels)</code>) — | |
| Packed sequence of patchified noisy image tokens. Non-image positions are masked out internally.`,name:"hidden_states"},{anchor:"diffusers.Ideogram4Transformer2DModel.forward.timestep",description:`<strong>timestep</strong> (<code>torch.Tensor</code> of shape <code>(batch_size,)</code> or <code>(batch_size, sequence_length)</code>) — | |
| Flow-matching time in <code>[0, 1]</code> (0 is pure noise, 1 is clean data).`,name:"timestep"},{anchor:"diffusers.Ideogram4Transformer2DModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, llm_features_dim)</code>) — | |
| Per-token text conditioning features. Non-text positions are masked out internally.`,name:"encoder_hidden_states"},{anchor:"diffusers.Ideogram4Transformer2DModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, 3)</code>) — | |
| <code>(t, h, w)</code> coordinates consumed by the multi-axis RoPE.`,name:"position_ids"},{anchor:"diffusers.Ideogram4Transformer2DModel.forward.segment_ids",description:`<strong>segment_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) — | |
| Per-token sample id within a packed batch. Positions sharing a <code>segment_id</code> attend to each other.`,name:"segment_ids"},{anchor:"diffusers.Ideogram4Transformer2DModel.forward.indicator",description:`<strong>indicator</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) — | |
| Per-token role: <code>LLM_TOKEN_INDICATOR</code> (text) or <code>OUTPUT_IMAGE_INDICATOR</code> (image).`,name:"indicator"},{anchor:"diffusers.Ideogram4Transformer2DModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to return a <a href="/docs/diffusers/pr_13921/en/api/models/consisid_transformer3d#diffusers.models.modeling_outputs.Transformer2DModelOutput">Transformer2DModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/transformers/transformer_ideogram4.py#L368",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/diffusers/pr_13921/en/api/models/consisid_transformer3d#diffusers.models.modeling_outputs.Transformer2DModelOutput" | |
| >Transformer2DModelOutput</a> or a <code>tuple</code> whose first element is a tensor of shape | |
| <code>(batch_size, sequence_length, in_channels)</code> in the model’s compute dtype. Only positions tagged with | |
| <code>OUTPUT_IMAGE_INDICATOR</code> carry meaningful velocity predictions.</p> | |
| `}}),b=new ie({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/ideogram4_transformer2d.md"}}),{c(){d=i("meta"),L=r(),P=i("p"),C=r(),M(u.$$.fragment),E=r(),M(h.$$.fragment),q=r(),p=i("p"),p.innerHTML=J,O=r(),M(g.$$.fragment),N=r(),n=i("div"),M(_.$$.fragment),V=r(),$=i("p"),$.textContent=Q,j=r(),x=i("p"),x.innerHTML=X,B=r(),l=i("div"),M(T.$$.fragment),K=r(),v=i("p"),v.textContent=Y,A=r(),M(b.$$.fragment),R=r(),z=i("p"),this.h()},l(e){const t=ae("svelte-u9bgzb",document.head);d=m(t,"META",{name:!0,content:!0}),t.forEach(o),L=s(e),P=m(e,"P",{}),U(P).forEach(o),C=s(e),D(u.$$.fragment,e),E=s(e),D(h.$$.fragment,e),q=s(e),p=m(e,"P",{"data-svelte-h":!0}),G(p)!=="svelte-1wccyzl"&&(p.innerHTML=J),O=s(e),D(g.$$.fragment,e),N=s(e),n=m(e,"DIV",{class:!0});var f=U(n);D(_.$$.fragment,f),V=s(f),$=m(f,"P",{"data-svelte-h":!0}),G($)!=="svelte-kdxio6"&&($.textContent=Q),j=s(f),x=m(f,"P",{"data-svelte-h":!0}),G(x)!=="svelte-k1l7p9"&&(x.innerHTML=X),B=s(f),l=m(f,"DIV",{class:!0});var S=U(l);D(T.$$.fragment,S),K=s(S),v=m(S,"P",{"data-svelte-h":!0}),G(v)!=="svelte-gmxmy1"&&(v.textContent=Y),S.forEach(o),f.forEach(o),A=s(e),D(b.$$.fragment,e),R=s(e),z=m(e,"P",{}),U(z).forEach(o),this.h()},h(){F(d,"name","hf:doc:metadata"),F(d,"content",ce),F(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(n,"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){c(document.head,d),a(e,L,t),a(e,P,t),a(e,C,t),y(u,e,t),a(e,E,t),y(h,e,t),a(e,q,t),a(e,p,t),a(e,O,t),y(g,e,t),a(e,N,t),a(e,n,t),y(_,n,null),c(n,V),c(n,$),c(n,j),c(n,x),c(n,B),c(n,l),y(T,l,null),c(l,K),c(l,v),a(e,A,t),y(b,e,t),a(e,R,t),a(e,z,t),H=!0},p:oe,i(e){H||(I(u.$$.fragment,e),I(h.$$.fragment,e),I(g.$$.fragment,e),I(_.$$.fragment,e),I(T.$$.fragment,e),I(b.$$.fragment,e),H=!0)},o(e){w(u.$$.fragment,e),w(h.$$.fragment,e),w(g.$$.fragment,e),w(_.$$.fragment,e),w(T.$$.fragment,e),w(b.$$.fragment,e),H=!1},d(e){e&&(o(L),o(P),o(C),o(E),o(q),o(p),o(O),o(N),o(n),o(A),o(R),o(z)),o(d),k(u,e),k(h,e),k(g,e),k(_),k(T),k(b,e)}}}const ce='{"title":"Ideogram4Transformer2DModel","local":"ideogram4transformer2dmodel","sections":[{"title":"Ideogram4Transformer2DModel","local":"diffusers.Ideogram4Transformer2DModel","sections":[],"depth":2}],"depth":1}';function le(W){return ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _e extends re{constructor(d){super(),se(this,d,le,me,te,{})}}export{_e as component}; | |
Xet Storage Details
- Size:
- 10.7 kB
- Xet hash:
- fbf2b0d0ae41cdb79b10c66593779500e2b0c8f83ddfe2ebfe4acbb6d78a0a0e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.