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 上更新