Diffusers documentation
LatteTransformer3DModel
LatteTransformer3DModel
Latte의 3D 데이터를 위한 Diffusion Transformer 모델입니다.
LatteTransformer3DModel
클래스 diffusers.LatteTransformer3DModel
< source >( num_attention_heads: int = 16attention_head_dim: int = 88in_channels: int | None = Noneout_channels: int | None = Nonenum_layers: int = 1dropout: float = 0.0cross_attention_dim: int | None = Noneattention_bias: bool = Falsesample_size: int = 64patch_size: int | None = Noneactivation_fn: str = 'geglu'num_embeds_ada_norm: int | None = Nonenorm_type: str = 'layer_norm'norm_elementwise_affine: bool = Truenorm_eps: float = 1e-05caption_channels: int = Nonevideo_length: int = 16 )
forward
< source >( hidden_states: Tensortimestep: typing.Optional[torch.LongTensor] = Noneencoder_hidden_states: typing.Optional[torch.Tensor] = Noneencoder_attention_mask: typing.Optional[torch.Tensor] = Noneenable_temporal_attentions: bool = Truereturn_dict: bool = True )
매개변수
- hidden_states (
torch.Tensor, shape(batch size, channel, num_frame, height, width)) — 입력hidden_states. - timestep (
torch.LongTensor, 선택 사항) — 디노이징 단계를 나타내는 데 사용됩니다.AdaLayerNorm에서 임베딩으로 적용될 선택적 timestep입니다. - encoder_hidden_states (
torch.FloatTensor, shape(batch size, sequence len, embed dims), 선택 사항) — 크로스 어텐션 레이어에 사용되는 조건부 임베딩입니다. 지정되지 않으면 크로스 어텐션은 기본적으로 셀프 어텐션으로 동작합니다. - encoder_attention_mask (
torch.Tensor, 선택 사항) — 에 적용되는 크로스 어텐션 마스크encoder_hidden_states. 두 가지 형식을 지원합니다:- Mask
(batcheight, sequence_length)True = 유지, False = 제거. - Bias
(batcheight, 1, sequence_length)0 = 유지, -10000 = 폐기.
ndim == 2인 경우: 마스크로 해석된 후, 위 형식과 일관된 바이어스로 변환됩니다. 이 바이어스는 크로스 어텐션 점수에 추가됩니다. - Mask
- enable_temporal_attentions —
(
bool, 선택 사항, 기본값True): temporal attentions를 활성화할지 여부. - return_dict (
bool, 선택 사항, 기본값True) — 단순 tuple 대신~models.unet_2d_condition.UNet2DConditionOutput를 반환할지 여부.
LatteTransformer3DModel의 forward 메서드입니다.