(self,
freeze_model='crossattn-kv',
cond_stage_trainable=False,
add_token=False,
attention_store_step=False,
attention_store_background_mask=False,
check_token_attn=False,
all_step_attention_store=False,
new1_IoU=False,
gaussian=False,
new1_subject_IoU=False,
qv_k=False,
IoU_alpha=1,
self_filter=False,
new2_subject=False,
IoU_between_subject=False,
random_change_subject_prompt=False,
attn16=False,
attn_list=[16,32,64],
attn16_weight=0.1,
store_list=[64,256,1024,4096],
new3_subject=False,
between_subject_only_intersection=False,
twice_filter=False,
*args, **kwargs)
| 121 | |
| 122 | class CustomDiffusion(LatentDiffusion): |
| 123 | def __init__(self, |
| 124 | freeze_model='crossattn-kv', |
| 125 | cond_stage_trainable=False, |
| 126 | add_token=False, |
| 127 | attention_store_step=False, |
| 128 | attention_store_background_mask=False, |
| 129 | check_token_attn=False, |
| 130 | all_step_attention_store=False, |
| 131 | new1_IoU=False, |
| 132 | gaussian=False, |
| 133 | new1_subject_IoU=False, |
| 134 | qv_k=False, |
| 135 | IoU_alpha=1, |
| 136 | self_filter=False, |
| 137 | new2_subject=False, |
| 138 | IoU_between_subject=False, |
| 139 | random_change_subject_prompt=False, |
| 140 | attn16=False, |
| 141 | attn_list=[16,32,64], |
| 142 | attn16_weight=0.1, |
| 143 | store_list=[64,256,1024,4096], |
| 144 | new3_subject=False, |
| 145 | between_subject_only_intersection=False, |
| 146 | twice_filter=False, |
| 147 | *args, **kwargs): |
| 148 | self.freeze_model = freeze_model |
| 149 | self.add_token = add_token |
| 150 | self.cond_stage_trainable = cond_stage_trainable |
| 151 | self.attention_store_background_mask = attention_store_background_mask |
| 152 | |
| 153 | super().__init__(cond_stage_trainable=cond_stage_trainable, *args, **kwargs) |
| 154 | |
| 155 | self.new1_IoU = new1_IoU |
| 156 | self.new1_subject_IoU = new1_subject_IoU |
| 157 | self.gaussian = gaussian |
| 158 | self.qv_k = qv_k |
| 159 | self.IoU_alpha = IoU_alpha |
| 160 | self.self_filter = self_filter |
| 161 | self.new2_subject = new2_subject |
| 162 | self.IoU_between_subject = IoU_between_subject |
| 163 | self.random_change_subject_prompt = random_change_subject_prompt |
| 164 | self.attn16 = attn16 |
| 165 | self.attn_list = attn_list |
| 166 | self.attn16_weight = attn16_weight |
| 167 | self.store_list = store_list |
| 168 | self.new3_subject = new3_subject |
| 169 | self.between_subject_only_intersection = between_subject_only_intersection |
| 170 | self.twice_filter = twice_filter |
| 171 | # print(self_filter) |
| 172 | if attention_store_background_mask or attention_store_step: |
| 173 | controller = CDAttentionStore() |
| 174 | self.controller = controller |
| 175 | elif check_token_attn: |
| 176 | controller = AttentionStore(all_step_attention_store=all_step_attention_store) |
| 177 | self.controller = controller |
| 178 | else: |
| 179 | self.controller = None |
| 180 |
nothing calls this directly
no test coverage detected