1inkusFace commited on
Commit
97f63b2
·
verified ·
1 Parent(s): 2be201f

Update pipeline_stable_diffusion_3_ipa.py

Browse files
Files changed (1) hide show
  1. pipeline_stable_diffusion_3_ipa.py +2 -2
pipeline_stable_diffusion_3_ipa.py CHANGED
@@ -1205,11 +1205,11 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
1205
  # FAILS clip_image_embeds = torch.cat(torch.stack(image_prompt_embeds_list), dim=0).mean(dim=0)
1206
  # FAILS TIMESTEPS clip_image_embeds = torch.cat(image_prompt_embeds_list, dim=0).mean(dim=0)
1207
 
1208
- clip_image_embedsl = self.encode_clip_image_emb(clip_image, device, dtype)
1209
- print('old method shape: ', clip_image_embedsl.shape)
1210
  # 1. Stack the image embeddings
1211
  stacked_image_embeds = torch.stack(image_prompt_embeds_list)
 
1212
  print('shape 1: ', stacked_image_embeds.shape)
 
1213
  # 2. Calculate the mean of the stacked embeddings
1214
  average_image_embed = torch.mean(stacked_image_embeds, dim=0) #.unsqueeze(0) # Add batch dimension after averaging
1215
  print('shape 2: ', average_image_embed.shape)
 
1205
  # FAILS clip_image_embeds = torch.cat(torch.stack(image_prompt_embeds_list), dim=0).mean(dim=0)
1206
  # FAILS TIMESTEPS clip_image_embeds = torch.cat(image_prompt_embeds_list, dim=0).mean(dim=0)
1207
 
 
 
1208
  # 1. Stack the image embeddings
1209
  stacked_image_embeds = torch.stack(image_prompt_embeds_list)
1210
+ stacked_image_embedsg = torch.cat(image_prompt_embeds_list, dim=1)
1211
  print('shape 1: ', stacked_image_embeds.shape)
1212
+ print('shape 1a: ', stacked_image_embedsg.shape)
1213
  # 2. Calculate the mean of the stacked embeddings
1214
  average_image_embed = torch.mean(stacked_image_embeds, dim=0) #.unsqueeze(0) # Add batch dimension after averaging
1215
  print('shape 2: ', average_image_embed.shape)