CogView4Transformer2DModel¶
A Diffusion Transformer model for 2D data from CogView4
The model can be loaded with the following code snippet.
from mindone.diffusers import CogView4Transformer2DModel
transformer = CogView4Transformer2DModel.from_pretrained("THUDM/CogView4-6B", subfolder="transformer", mindspore_dtype=ms.bfloat16)
mindone.diffusers.models.transformers.CogView4Transformer2DModel
¶
Bases: ModelMixin
, ConfigMixin
, PeftAdapterMixin
PARAMETER | DESCRIPTION |
---|---|
patch_size
|
The size of the patches to use in the patch embedding layer.
TYPE:
|
in_channels
|
The number of channels in the input.
TYPE:
|
num_layers
|
The number of layers of Transformer blocks to use.
TYPE:
|
attention_head_dim
|
The number of channels in each head.
TYPE:
|
num_attention_heads
|
The number of heads to use for multi-head attention.
TYPE:
|
out_channels
|
The number of channels in the output.
TYPE:
|
text_embed_dim
|
Input dimension of text embeddings from the text encoder.
TYPE:
|
time_embed_dim
|
Output dimension of timestep embeddings.
TYPE:
|
condition_dim
|
The embedding dimension of the input SDXL-style resolution conditions (original_size, target_size, crop_coords).
TYPE:
|
pos_embed_max_size
|
The maximum resolution of the positional embeddings, from which slices of shape
TYPE:
|
sample_size
|
The base resolution of input latents. If height/width is not provided during generation, this value is used
to determine the resolution as
TYPE:
|
Source code in mindone/diffusers/models/transformers/transformer_cogview4.py
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 |
|
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
24 25 26 27 28 29 30 31 32 33 34 35 36 |
|