CosmosTransformer3DModel¶
A Diffusion Transformer model for 3D video-like data was introduced in Cosmos World Foundation Model Platform for Physical AI by NVIDIA.
The model can be loaded with the following code snippet.
import mindspore
from mindone.diffusers import CosmosTransformer3DModel
transformer = CosmosTransformer3DModel.from_pretrained("nvidia/Cosmos-1.0-Diffusion-7B-Text2World", subfolder="transformer", mindspore_dtype=mindspore.bfloat16)
mindone.diffusers.CosmosTransformer3DModel
¶
Bases: ModelMixin
, ConfigMixin
A Transformer model for video-like data used in Cosmos.
PARAMETER | DESCRIPTION |
---|---|
in_channels
|
The number of channels in the input.
TYPE:
|
out_channels
|
The number of channels in the output.
TYPE:
|
num_attention_heads
|
The number of heads to use for multi-head attention.
TYPE:
|
attention_head_dim
|
The number of channels in each attention head.
TYPE:
|
num_layers
|
The number of layers of transformer blocks to use.
TYPE:
|
mlp_ratio
|
The ratio of the hidden layer size to the input size in the feedforward network.
TYPE:
|
text_embed_dim
|
Input dimension of text embeddings from the text encoder.
TYPE:
|
adaln_lora_dim
|
The hidden dimension of the Adaptive LayerNorm LoRA layer.
TYPE:
|
max_size
|
The maximum size of the input latent tensors in the temporal, height, and width dimensions.
TYPE:
|
patch_size
|
The patch size to use for patchifying the input latent tensors in the temporal, height, and width dimensions.
TYPE:
|
rope_scale
|
The scaling factor to use for RoPE in the temporal, height, and width dimensions.
TYPE:
|
concat_padding_mask
|
Whether to concatenate the padding mask to the input latent tensors.
TYPE:
|
extra_pos_embed_type
|
The type of extra positional embeddings to use. Can be one of
TYPE:
|
Source code in mindone/diffusers/models/transformers/transformer_cosmos.py
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 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 |
|