add end_pos in CNAttnProcessor

pull/39/head
陈书睿 2023-09-06 10:44:04 +08:00
parent 852cd6a6a4
commit 23f44cc242
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ class IPAdapter:
scale=1.0,num_tokens= self.num_tokens).to(self.device, dtype=torch.float16)
unet.set_attn_processor(attn_procs)
if hasattr(self.pipe, "controlnet"):
self.pipe.controlnet.set_attn_processor(CNAttnProcessor())
self.pipe.controlnet.set_attn_processor(CNAttnProcessor(num_tokens= self.num_tokens))
def load_ip_adapter(self):
state_dict = torch.load(self.ip_ckpt, map_location="cpu")