ford442 commited on
Commit
e5028dc
·
verified ·
1 Parent(s): 90b7914

Update ip_adapter/ip_adapter.py

Browse files
Files changed (1) hide show
  1. ip_adapter/ip_adapter.py +1 -1
ip_adapter/ip_adapter.py CHANGED
@@ -216,7 +216,7 @@ class IPAdapterXL(IPAdapter):
216
  print('Using secondary image.')
217
  image_prompt_embeds_1, uncond_image_prompt_embeds = self.get_image_embeds(pil_image)
218
  image_prompt_embeds_2, uncond_image_prompt_embeds_2 = self.get_image_embeds(pil_image_2)
219
- image_prompt_embeds = torch.cat(image_prompt_embeds_1,image_prompt_embeds_2).mean(dim=0).unsqueeze(0)
220
  bs_embed, seq_len, _ = image_prompt_embeds.shape
221
  image_prompt_embeds = image_prompt_embeds.repeat(1, num_samples, 1)
222
  image_prompt_embeds = image_prompt_embeds.view(bs_embed * num_samples, seq_len, -1)
 
216
  print('Using secondary image.')
217
  image_prompt_embeds_1, uncond_image_prompt_embeds = self.get_image_embeds(pil_image)
218
  image_prompt_embeds_2, uncond_image_prompt_embeds_2 = self.get_image_embeds(pil_image_2)
219
+ image_prompt_embeds = torch.cat((image_prompt_embeds_1,image_prompt_embeds_2)).mean(dim=0).unsqueeze(0)
220
  bs_embed, seq_len, _ = image_prompt_embeds.shape
221
  image_prompt_embeds = image_prompt_embeds.repeat(1, num_samples, 1)
222
  image_prompt_embeds = image_prompt_embeds.view(bs_embed * num_samples, seq_len, -1)