Diffusers 文档
EasyAnimateTransformer3DModel
并获得增强的文档体验
开始使用
EasyAnimateTransformer3DModel
EasyAnimate 是阿里巴巴 PAI 团队引入的一个用于 3D 数据的 Diffusion Transformer 模型,可在 EasyAnimate 中找到。
该模型可以通过以下代码片段加载。
from diffusers import EasyAnimateTransformer3DModel
transformer = EasyAnimateTransformer3DModel.from_pretrained("alibaba-pai/EasyAnimateV5.1-12b-zh", subfolder="transformer", torch_dtype=torch.float16).to("cuda")
EasyAnimateTransformer3DModel
class diffusers.EasyAnimateTransformer3DModel
< 来源 >( num_attention_heads: int = 48 attention_head_dim: int = 64 in_channels: typing.Optional[int] = None out_channels: typing.Optional[int] = None patch_size: typing.Optional[int] = None sample_width: int = 90 sample_height: int = 60 activation_fn: str = 'gelu-approximate' timestep_activation_fn: str = 'silu' freq_shift: int = 0 num_layers: int = 48 mmdit_layers: int = 48 dropout: float = 0.0 time_embed_dim: int = 512 add_norm_text_encoder: bool = False text_embed_dim: int = 3584 text_embed_dim_t5: int = None norm_eps: float = 1e-05 norm_elementwise_affine: bool = True flip_sin_to_cos: bool = True time_position_encoding_type: str = '3d_rope' after_norm = False resize_inpaint_mask_directly: bool = True enable_text_attention_mask: bool = True add_noise_in_inpaint_model: bool = True )
参数
- num_attention_heads (
int
, 默认为48
) — 多头注意力使用的头数。 - attention_head_dim (
int
, 默认为64
) — 每个头中的通道数。 - in_channels (
int
, 默认为16
) — 输入中的通道数。 - out_channels (
int
, 可选, 默认为16
) — 输出中的通道数。 - patch_size (
int
, 默认为2
) — 补丁嵌入层中使用的补丁大小。 - sample_width (
int
, 默认为90
) — 输入潜在的宽度。 - sample_height (
int
, 默认为60
) — 输入潜在的高度。 - activation_fn (
str
, 默认为"gelu-approximate"
) — 前馈网络中使用的激活函数。 - timestep_activation_fn (
str
, 默认为"silu"
) — 生成时间步嵌入时使用的激活函数。 - num_layers (
int
, 默认为30
) — 使用的 Transformer 块层数。 - mmdit_layers (
int
, 默认为1000
) — 使用的多模态 Transformer 块层数。 - dropout (
float
, 默认为0.0
) — 使用的 dropout 概率。 - time_embed_dim (
int
, 默认为512
) — 时间步嵌入的输出维度。 - text_embed_dim (
int
, 默认为4096
) — 文本编码器中文本嵌入的输入维度。 - norm_eps (
float
, 默认为1e-5
) — 归一化层中使用的 epsilon 值。 - norm_elementwise_affine (
bool
, 默认为True
) — 是否在归一化层中使用逐元素仿射。 - flip_sin_to_cos (
bool
, 默认为True
) — 是否翻转时间嵌入中的正弦到余弦。 - time_position_encoding_type (
str
, 默认为3d_rope
) — 时间位置编码的类型。 - after_norm (
bool
, 默认为False
) — 归一化后应用的标志。 - resize_inpaint_mask_directly (
bool
, 默认为True
) — 直接调整图像修复掩码大小的标志。 - enable_text_attention_mask (
bool
, 默认为True
) — 启用文本注意力掩码的标志。 - add_noise_in_inpaint_model (
bool
, 默认为False
) — 在图像修复模型中添加噪声的标志。
EasyAnimate 中用于视频类数据的 Transformer 模型。
Transformer2DModelOutput
class diffusers.models.modeling_outputs.Transformer2DModelOutput
< 来源 >( sample: torch.Tensor )
参数
- sample (
torch.Tensor
,形状为(batch_size, num_channels, height, width)
或(batch size, num_vector_embeds - 1, num_latent_pixels)
如果 Transformer2DModel 是离散的) — 在encoder_hidden_states
输入上条件化的隐藏状态输出。如果是离散的,则返回未加噪的潜在像素的概率分布。
Transformer2DModel 的输出。