HunyuanVideoTransformer3DModel¶
A Diffusion Transformer model for 3D video-like data was introduced in HunyuanVideo: A Systematic Framework For Large Video Generative Models by Tencent.
The model can be loaded with the following code snippet.
from mindone.diffusers import HunyuanVideoTransformer3DModel
import mindspore as ms
transformer = HunyuanVideoTransformer3DModel.from_pretrained("hunyuanvideo-community/HunyuanVideo", subfolder="transformer", mindspore_dtype=ms.bfloat16)
mindone.diffusers.HunyuanVideoTransformer3DModel
¶
Bases: ModelMixin
, ConfigMixin
, PeftAdapterMixin
, FromOriginalModelMixin
A Transformer model for video-like data used in HunyuanVideo.
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 head.
TYPE:
|
num_layers |
The number of layers of dual-stream blocks to use.
TYPE:
|
num_single_layers |
The number of layers of single-stream blocks to use.
TYPE:
|
num_refiner_layers |
The number of layers of refiner blocks to use.
TYPE:
|
mlp_ratio |
The ratio of the hidden layer size to the input size in the feedforward network.
TYPE:
|
patch_size |
The size of the spatial patches to use in the patch embedding layer.
TYPE:
|
patch_size_t |
The size of the tmeporal patches to use in the patch embedding layer.
TYPE:
|
qk_norm |
The normalization to use for the query and key projections in the attention layers.
TYPE:
|
guidance_embeds |
Whether to use guidance embeddings in the model.
TYPE:
|
text_embed_dim |
Input dimension of text embeddings from the text encoder.
TYPE:
|
pooled_projection_dim |
The dimension of the pooled projection of the text embeddings.
TYPE:
|
rope_theta |
The value of theta to use in the RoPE layer.
TYPE:
|
rope_axes_dim |
The dimensions of the axes to use in the RoPE layer.
TYPE:
|
Source code in mindone/diffusers/models/transformers/transformer_hunyuan_video.py
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 |
|
mindone.diffusers.HunyuanVideoTransformer3DModel.attn_processors: Dict[str, AttentionProcessor]
property
¶
RETURNS | DESCRIPTION |
---|---|
Dict[str, AttentionProcessor]
|
|
Dict[str, AttentionProcessor]
|
indexed by its weight name. |
mindone.diffusers.HunyuanVideoTransformer3DModel.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/transformer_hunyuan_video.py
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 |
|
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 |
|