WanTransformer3DModel¶
A Diffusion Transformer model for 3D video-like data was introduced in Wan 2.1 by the Alibaba Wan Team.
The model can be loaded with the following code snippet.
from mindone.diffusers import WanTransformer3DModel
transformer = WanTransformer3DModel.from_pretrained("Wan-AI/Wan2.1-T2V-1.3B-Diffusers", subfolder="transformer", mindspore_dtype=ms.bfloat16)
mindone.diffusers.WanTransformer3DModel
¶
Bases: ModelMixin
, ConfigMixin
, PeftAdapterMixin
, FromOriginalModelMixin
A Transformer model for video-like data used in the Wan model.
PARAMETER | DESCRIPTION |
---|---|
patch_size |
3D patch dimensions for video embedding (t_patch, h_patch, w_patch).
TYPE:
|
num_attention_heads |
Fixed length for text embeddings.
TYPE:
|
attention_head_dim |
The number of channels in each head.
TYPE:
|
in_channels |
The number of channels in the input.
TYPE:
|
out_channels |
The number of channels in the output.
TYPE:
|
text_dim |
Input dimension for text embeddings.
TYPE:
|
freq_dim |
Dimension for sinusoidal time embeddings.
TYPE:
|
ffn_dim |
Intermediate dimension in feed-forward network.
TYPE:
|
num_layers |
The number of layers of transformer blocks to use.
TYPE:
|
window_size |
Window size for local attention (-1 indicates global attention).
TYPE:
|
cross_attn_norm |
Enable cross-attention normalization.
TYPE:
|
qk_norm |
Enable query/key normalization.
TYPE:
|
eps |
Epsilon value for normalization layers.
TYPE:
|
add_img_emb |
Whether to use img_emb.
TYPE:
|
added_kv_proj_dim |
The number of channels to use for the added key and value projections. If
TYPE:
|
Source code in mindone/diffusers/models/transformers/transformer_wan.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
|
mindone.diffusers.models.modeling_outputs.Transformer2DModelOutput
dataclass
¶
Bases: BaseOutput
The output of [Transformer2DModel
].
PARAMETER | DESCRIPTION |
---|---|
`(batch |
The hidden states output conditioned on the
TYPE:
|
Source code in mindone/diffusers/models/modeling_outputs.py
22 23 24 25 26 27 28 29 30 31 32 33 34 |
|