MCPcopy Create free account
hub / github.com/AiuniAI/Unique3D / AttnConfig

Class AttnConfig

custum_3d_diffusion/custum_modules/unifield_processor.py:12–77  ·  view source on GitHub ↗

* CrossAttention: Attention module (inherits knowledge), LoRA module (achieves fine-tuning), IPAdapter module (achieves conceptual control). * SelfAttention: Attention module (inherits knowledge), LoRA module (achieves fine-tuning), Reference Attention module (achieves pixel-level c

Source from the content-addressed store, hash-verified

10
11@dataclass
12class AttnConfig:
13 """
14 * CrossAttention: Attention module (inherits knowledge), LoRA module (achieves fine-tuning), IPAdapter module (achieves conceptual control).
15 * SelfAttention: Attention module (inherits knowledge), LoRA module (achieves fine-tuning), Reference Attention module (achieves pixel-level control).
16 * Multiview Attention module: Multiview Attention module (achieves multi-view consistency).
17 * Cross Modality Attention module: Cross Modality Attention module (achieves multi-modality consistency).
18
19 For setups:
20 train_xxx_lr is implemented in the U-Net architecture.
21 enable_xxx_lora is implemented in the U-Net architecture.
22 enable_xxx_ip is implemented in the processor and U-Net architecture.
23 enable_xxx_ref_proj_in is implemented in the processor.
24 """
25 latent_size: int = 64
26
27 train_lr: float = 0
28 # for cross attention
29 # 0 learning rate for not training
30 train_cross_attn_lr: float = 0
31 train_cross_attn_lora_lr: float = 0
32 train_cross_attn_ip_lr: float = 0 # 0 for not trained
33 init_cross_attn_lora: bool = False
34 enable_cross_attn_lora: bool = False
35 init_cross_attn_ip: bool = False
36 enable_cross_attn_ip: bool = False
37 cross_attn_lora_rank: int = 64 # 0 for not enabled
38 cross_attn_lora_only_kv: bool = False
39 ipadapter_pretrained_name: str = "h94/IP-Adapter"
40 ipadapter_subfolder_name: str = "models"
41 ipadapter_weight_name: str = "ip-adapter-plus_sd15.safetensors"
42 ipadapter_effect_on: str = "all" # all, first
43
44 # for self attention
45 train_self_attn_lr: float = 0
46 train_self_attn_lora_lr: float = 0
47 init_self_attn_lora: bool = False
48 enable_self_attn_lora: bool = False
49 self_attn_lora_rank: int = 64
50 self_attn_lora_only_kv: bool = False
51
52 train_self_attn_ref_lr: float = 0
53 train_ref_unet_lr: float = 0
54 init_self_attn_ref: bool = False
55 enable_self_attn_ref: bool = False
56 self_attn_ref_other_model_name: str = ""
57 self_attn_ref_position: str = "attn1"
58 self_attn_ref_pixel_wise_crosspond: bool = False # enable pixel_wise_crosspond in refattn
59 self_attn_ref_chain_pos: str = "parralle" # before or parralle or after
60 self_attn_ref_effect_on: str = "all" # all or first, for _crosspond attn
61 self_attn_ref_zero_init: bool = True
62 use_simple3d_attn: bool = False
63
64 # for multiview attention
65 init_multiview_attn: bool = False
66 enable_multiview_attn: bool = False
67 multiview_attn_position: str = "attn1"
68 multiview_chain_pose: str = "parralle" # before or parralle or after
69 num_modalities: int = 1

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected