Buckets:
WanAnimateTransformer3DModel
A Diffusion Transformer model for 3D video-like data was introduced in Wan Animate by the Alibaba Wan Team.
The model can be loaded with the following code snippet.
from diffusers import WanAnimateTransformer3DModel
transformer = WanAnimateTransformer3DModel.from_pretrained("Wan-AI/Wan2.2-Animate-14B-Diffusers", subfolder="transformer", torch_dtype=torch.bfloat16)
WanAnimateTransformer3DModel[[diffusers.WanAnimateTransformer3DModel]]
- patch_size (
tuple[int], defaults to(1, 2, 2)) -- 3D patch dimensions for video embedding (t_patch, h_patch, w_patch). - num_attention_heads (
int, defaults to40) -- Fixed length for text embeddings. - attention_head_dim (
int, defaults to128) -- The number of channels in each head. - in_channels (
int, defaults to16) -- The number of channels in the input. - out_channels (
int, defaults to16) -- The number of channels in the output. - text_dim (
int, defaults to512) -- Input dimension for text embeddings. - freq_dim (
int, defaults to256) -- Dimension for sinusoidal time embeddings. - ffn_dim (
int, defaults to13824) -- Intermediate dimension in feed-forward network. - num_layers (
int, defaults to40) -- The number of layers of transformer blocks to use. - window_size (
tuple[int], defaults to(-1, -1)) -- Window size for local attention (-1 indicates global attention). - cross_attn_norm (
bool, defaults toTrue) -- Enable cross-attention normalization. - qk_norm (
bool, defaults toTrue) -- Enable query/key normalization. - eps (
float, defaults to1e-6) -- Epsilon value for normalization layers. - image_dim (
int, optional, defaults to1280) -- The number of channels to use for the image embedding. IfNone, no projection is used. - added_kv_proj_dim (
int, optional, defaults to5120) -- The number of channels to use for the added key and value projections. IfNone, no projection is used.
A Transformer model for video-like data used in the WanAnimate model.
- hidden_states (
torch.Tensorof shape(B, 2C + 4, T + 1, H, W)) -- Input noisy video latents of shape(B, 2C + 4, T + 1, H, W), where B is the batch size, C is the number of latent channels (16 for Wan VAE), T is the number of latent frames in an inference segment, H is the latent height, and W is the latent width. - timestep -- (
torch.LongTensor): The current timestep in the denoising loop. - encoder_hidden_states (
torch.Tensor) -- Text embeddings from the text encoder (umT5 for Wan Animate). - encoder_hidden_states_image (
torch.Tensor) -- CLIP visual features of the reference (character) image. - pose_hidden_states (
torch.Tensorof shape(B, C, T, H, W)) -- Pose video latents. TODO: description - face_pixel_values (
torch.Tensorof shape(B, C', S, H', W')) -- Face video in pixel space (not latent space). Typically C' = 3 and H' and W' are the height/width of the face video in pixels. Here S is the inference segment length, usually set to 77. - motion_encode_batch_size (
int, optional) -- The batch size for batched encoding of the face video via the motion encoder. Will default toself.config.motion_encoder_batch_sizeif not set. - return_dict (
bool, optional, defaults toTrue) -- Whether to return the output as a dict or tuple. - attention_kwargs (
dict, optional) -- A kwargs dictionary that if specified is passed along to theAttentionProcessoras defined underself.processorin diffusers.models.attention_processor.~models.transformer_2d.Transformer2DModelOutputortupleIfreturn_dictis True, a~models.transformer_2d.Transformer2DModelOutputwhosesampleis the denoised video latent is returned, otherwise a plaintuplewhose first element is that tensor is returned.
Forward pass of Wan2.2-Animate transformer model.
Transformer2DModelOutput[[diffusers.models.modeling_outputs.Transformer2DModelOutput]]
- sample (
torch.Tensorof shape(batch_size, num_channels, height, width)or(batch size, num_vector_embeds - 1, num_latent_pixels)if Transformer2DModel is discrete) -- The hidden states output conditioned on theencoder_hidden_statesinput. If discrete, returns probability distributions for the unnoised latent pixels.
The output of Transformer2DModel.
Xet Storage Details
- Size:
- 4.76 kB
- Xet hash:
- 872fc67009d3c86085d2a9902c9f6940a919d0c7fde84c13ae889f4a92851fa1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.