Attention Processor¶
An attention processor is a class for applying different types of attention mechanisms.
mindone.diffusers.models.attention_processor.AttnProcessor
¶
Default processor for performing attention-related computations.
Source code in mindone/diffusers/models/attention_processor.py
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 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 |
|
mindone.diffusers.models.attention_processor.AttnAddedKVProcessor
¶
Processor for performing attention-related computations with extra learnable key and value matrices for the text encoder.
Source code in mindone/diffusers/models/attention_processor.py
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 |
|
mindone.diffusers.models.attention_processor.CustomDiffusionAttnProcessor
¶
Bases: Cell
Processor for implementing attention for the Custom Diffusion method.
PARAMETER | DESCRIPTION |
---|---|
train_kv |
Whether to newly train the key and value matrices corresponding to the text features.
TYPE:
|
train_q_out |
Whether to newly train query matrices corresponding to the latent image features.
TYPE:
|
hidden_size |
The hidden size of the attention layer.
TYPE:
|
cross_attention_dim |
The number of channels in the
TYPE:
|
out_bias |
Whether to include the bias parameter in
TYPE:
|
dropout |
The dropout probability to use.
TYPE:
|
Source code in mindone/diffusers/models/attention_processor.py
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 |
|
mindone.diffusers.models.attention_processor.XFormersAttnProcessor
¶
Processor for implementing memory efficient attention using xFormers-like interface.
PARAMETER | DESCRIPTION |
---|---|
attention_op |
The base
operator to
use as the attention operator. It is recommended to set to
TYPE:
|
Source code in mindone/diffusers/models/attention_processor.py
1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 |
|