ford442 commited on
Commit
067016d
·
verified ·
1 Parent(s): 76f396c

Update ip_adapter/ip_adapter.py

Browse files
Files changed (1) hide show
  1. ip_adapter/ip_adapter.py +1 -2
ip_adapter/ip_adapter.py CHANGED
@@ -267,9 +267,8 @@ class IPAdapterXL(IPAdapter):
267
  uncond_image_prompt_embeds_list.append(uncond_image_prompt_embeds_5)
268
 
269
  image_prompt_embeds = torch.cat(image_prompt_embeds_list).mean(dim=0).unsqueeze(0)
270
- #image_prompt_embeds = torch.cat(image_prompt_embeds_list).unsqueeze(0)
271
  bs_embed, seq_len, _ = image_prompt_embeds.shape
272
- #image_prompt_embeds = image_prompt_embeds.repeat(1, num_samples, 1)
273
  image_prompt_embeds = image_prompt_embeds.view(bs_embed * num_samples, seq_len, -1)
274
 
275
  uncond_image_prompt_embeds = torch.cat(uncond_image_prompt_embeds_list).mean(dim=0).unsqueeze(0)
 
267
  uncond_image_prompt_embeds_list.append(uncond_image_prompt_embeds_5)
268
 
269
  image_prompt_embeds = torch.cat(image_prompt_embeds_list).mean(dim=0).unsqueeze(0)
 
270
  bs_embed, seq_len, _ = image_prompt_embeds.shape
271
+ image_prompt_embeds = image_prompt_embeds.repeat(1, num_samples, 1)
272
  image_prompt_embeds = image_prompt_embeds.view(bs_embed * num_samples, seq_len, -1)
273
 
274
  uncond_image_prompt_embeds = torch.cat(uncond_image_prompt_embeds_list).mean(dim=0).unsqueeze(0)