Diffusers 文件

LTXVideoTransformer3D模型

Hugging Face's logo
加入 Hugging Face 社群

並獲得增強的文件體驗

開始使用

LTXVideoTransformer3D模型

由 Lightricks 引入的 LTX 中用於 3D 資料的擴散 Transformer 模型。

該模型可以透過以下程式碼片段載入。

from diffusers import LTXVideoTransformer3DModel

transformer = LTXVideoTransformer3DModel.from_pretrained("Lightricks/LTX-Video", subfolder="transformer", torch_dtype=torch.bfloat16).to("cuda")

LTXVideoTransformer3DModel

class diffusers.LTXVideoTransformer3DModel

< >

( in_channels: int = 128 out_channels: int = 128 patch_size: int = 1 patch_size_t: int = 1 num_attention_heads: int = 32 attention_head_dim: int = 64 cross_attention_dim: int = 2048 num_layers: int = 28 activation_fn: str = 'gelu-approximate' qk_norm: str = 'rms_norm_across_heads' norm_elementwise_affine: bool = False norm_eps: float = 1e-06 caption_channels: int = 4096 attention_bias: bool = True attention_out_bias: bool = True )

引數

  • in_channels (int, 預設為 128) — 輸入中的通道數。
  • out_channels (int, 預設為 128) — 輸出中的通道數。
  • patch_size (int, 預設為 1) — 在補丁嵌入層中使用的空間補丁大小。
  • patch_size_t (int, 預設為 1) — 在補丁嵌入層中使用的時序補丁大小。
  • num_attention_heads (int, 預設為 32) — 用於多頭注意力的頭數。
  • attention_head_dim (int, 預設為 64) — 每個頭中的通道數。
  • cross_attention_dim (int, 預設為 2048 ) — 用於交叉注意力的通道數。
  • num_layers (int, 預設為 28) — 要使用的 Transformer 塊層數。
  • activation_fn (str, 預設為 "gelu-approximate") — 在前饋中使用的啟用函式。
  • qk_norm (str, 預設為 "rms_norm_across_heads") — 要使用的歸一化層。

用於 LTX 中的影片類資料的 Transformer 模型。

Transformer2DModelOutput

class diffusers.models.modeling_outputs.Transformer2DModelOutput

< >

( sample: torch.Tensor )

引數

  • sample (torch.Tensor, 形狀為 (batch_size, num_channels, height, width) 或(如果 Transformer2DModel 是離散的)(batch size, num_vector_embeds - 1, num_latent_pixels)) — 在 encoder_hidden_states 輸入上條件化的隱藏狀態輸出。如果為離散,則返回未去噪潛在畫素的機率分佈。

Transformer2DModel 的輸出。

< > 在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.