ConsisIDTransformer3DModel¶
A Diffusion Transformer model for 3D data from ConsisID was introduced in Identity-Preserving Text-to-Video Generation by Frequency Decomposition by Peking University & University of Rochester & etc.
The model can be loaded with the following code snippet.
from mindone.diffusers import ConsisIDTransformer3DModel
transformer = ConsisIDTransformer3DModel.from_pretrained("BestWishYsh/ConsisID-preview", subfolder="transformer", mindspore_dtype=mindspore.bfloat16)
mindone.diffusers.models.transformers.ConsisIDTransformer3DModel
¶
Bases: ModelMixin
, ConfigMixin
, PeftAdapterMixin
A Transformer model for video-like data in ConsisID.
PARAMETER | DESCRIPTION |
---|---|
num_attention_heads
|
The number of heads to use for multi-head attention.
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:
|
flip_sin_to_cos
|
Whether to flip the sin to cos in the time embedding.
TYPE:
|
time_embed_dim
|
Output dimension of timestep embeddings.
TYPE:
|
text_embed_dim
|
Input dimension of text embeddings from the text encoder.
TYPE:
|
num_layers
|
The number of layers of Transformer blocks to use.
TYPE:
|
dropout
|
The dropout probability to use.
TYPE:
|
attention_bias
|
Whether to use bias in the attention projection layers.
TYPE:
|
sample_width
|
The width of the input latents.
TYPE:
|
sample_height
|
The height of the input latents.
TYPE:
|
sample_frames
|
The number of frames in the input latents. Note that this parameter was incorrectly initialized to 49 instead of 13 because ConsisID processed 13 latent frames at once in its default and recommended settings, but cannot be changed to the correct value to ensure backwards compatibility. To create a transformer with K latent frames, the correct value to pass here would be: ((K - 1) * temporal_compression_ratio + 1).
TYPE:
|
patch_size
|
The size of the patches to use in the patch embedding layer.
TYPE:
|
temporal_compression_ratio
|
The compression ratio across the temporal dimension. See documentation for
TYPE:
|
max_text_seq_length
|
The maximum sequence length of the input text embeddings.
TYPE:
|
activation_fn
|
Activation function to use in feed-forward.
TYPE:
|
timestep_activation_fn
|
Activation function to use when generating the timestep embeddings.
TYPE:
|
norm_elementwise_affine
|
Whether to use elementwise affine in normalization layers.
TYPE:
|
norm_eps
|
The epsilon value to use in normalization layers.
TYPE:
|
spatial_interpolation_scale
|
Scaling factor to apply in 3D positional embeddings across spatial dimensions.
TYPE:
|
temporal_interpolation_scale
|
Scaling factor to apply in 3D positional embeddings across temporal dimensions.
TYPE:
|
is_train_face
|
Whether to use enable the identity-preserving module during the training process. When set to
TYPE:
|
is_kps
|
Whether to enable keypoint for global facial extractor. If
TYPE:
|
cross_attn_interval
|
The interval between cross-attention layers in the Transformer architecture. A larger value may reduce the frequency of cross-attention computations, which can help reduce computational overhead.
TYPE:
|
cross_attn_dim_head
|
The dimensionality of each attention head in the cross-attention layers of the Transformer architecture. A larger value increases the capacity to attend to more complex patterns, but also increases memory and computation costs.
TYPE:
|
cross_attn_num_heads
|
The number of attention heads in the cross-attention layers. More heads allow for more parallel attention mechanisms, capturing diverse relationships between different components of the input, but can also increase computational requirements.
TYPE:
|
LFE_id_dim
|
The dimensionality of the identity vector used in the Local Facial Extractor (LFE). This vector represents the identity features of a face, which are important for tasks like face recognition and identity preservation across different frames.
TYPE:
|
LFE_vit_dim
|
The dimension of the vision transformer (ViT) output used in the Local Facial Extractor (LFE). This value dictates the size of the transformer-generated feature vectors that will be processed for facial feature extraction.
TYPE:
|
LFE_depth
|
The number of layers in the Local Facial Extractor (LFE). Increasing the depth allows the model to capture more complex representations of facial features, but also increases the computational load.
TYPE:
|
LFE_dim_head
|
The dimensionality of each attention head in the Local Facial Extractor (LFE). This parameter affects how finely the model can process and focus on different parts of the facial features during the extraction process.
TYPE:
|
LFE_num_heads
|
The number of attention heads in the Local Facial Extractor (LFE). More heads can improve the model's ability to capture diverse facial features, but at the cost of increased computational complexity.
TYPE:
|
LFE_num_id_token
|
The number of identity tokens used in the Local Facial Extractor (LFE). This defines how many identity-related tokens the model will process to ensure face identity preservation during feature extraction.
TYPE:
|
LFE_num_querie
|
The number of query tokens used in the Local Facial Extractor (LFE). These tokens are used to capture high-frequency face-related information that aids in accurate facial feature extraction.
TYPE:
|
LFE_output_dim
|
The output dimension of the Local Facial Extractor (LFE). This dimension determines the size of the feature vectors produced by the LFE module, which will be used for subsequent tasks such as face recognition or tracking.
TYPE:
|
LFE_ff_mult
|
The multiplication factor applied to the feed-forward network's hidden layer size in the Local Facial Extractor (LFE). A higher value increases the model's capacity to learn more complex facial feature transformations, but also increases the computation and memory requirements.
TYPE:
|
LFE_num_scale
|
The number of different scales visual feature. A higher value increases the model's capacity to learn more complex facial feature transformations, but also increases the computation and memory requirements.
TYPE:
|
local_face_scale
|
A scaling factor used to adjust the importance of local facial features in the model. This can influence how strongly the model focuses on high frequency face-related content.
TYPE:
|
Source code in mindone/diffusers/models/transformers/consisid_transformer_3d.py
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 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 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 |
|
mindone.diffusers.models.transformers.ConsisIDTransformer3DModel.attn_processors
property
¶
RETURNS | DESCRIPTION |
---|---|
Dict[str, AttentionProcessor]
|
|
Dict[str, AttentionProcessor]
|
indexed by its weight name. |
mindone.diffusers.models.transformers.ConsisIDTransformer3DModel.set_attn_processor(processor)
¶
Sets the attention processor to use to compute attention.
PARAMETER | DESCRIPTION |
---|---|
processor
|
The instantiated processor class or a dictionary of processor classes that will be set as the processor
for all If
TYPE:
|
Source code in mindone/diffusers/models/transformers/consisid_transformer_3d.py
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
|
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 |
|