1inkusFace commited on
Commit
95b1b23
·
verified ·
1 Parent(s): 36b3e5b

Update pipeline_stable_diffusion_3_ipa.py

Browse files
Files changed (1) hide show
  1. pipeline_stable_diffusion_3_ipa.py +3 -1
pipeline_stable_diffusion_3_ipa.py CHANGED
@@ -1211,7 +1211,7 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
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=1) #.unsqueeze(0) # Add batch dimension after averaging
1215
  print('shape 2: ', average_image_embed.shape)
1216
  average_image_embedf = torch.mean(stacked_image_embeds, dim=1).unsqueeze(0) # Add batch dimension after averaging
1217
  print('shape 2a: ', average_image_embedf.shape)
@@ -1220,7 +1220,9 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
1220
  print('shape 3: ', zeros_tensor.shape)
1221
  # 4. Concatenate the zeros and the average embedding
1222
  clip_image_embeds = torch.cat([zeros_tensor, average_image_embed], dim=0)
 
1223
  print('shape 4: ', clip_image_embeds.shape)
 
1224
  '''
1225
  #clip_image_embeds = clip_image_embeds.unsqueeze(0) # Add a dimension at the beginning so now you have [1, 2*seq_len_img, embed_dim_img]
1226
  print('shape 5: ', clip_image_embeds.shape)
 
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)
1216
  average_image_embedf = torch.mean(stacked_image_embeds, dim=1).unsqueeze(0) # Add batch dimension after averaging
1217
  print('shape 2a: ', average_image_embedf.shape)
 
1220
  print('shape 3: ', zeros_tensor.shape)
1221
  # 4. Concatenate the zeros and the average embedding
1222
  clip_image_embeds = torch.cat([zeros_tensor, average_image_embed], dim=0)
1223
+ clip_image_embeds2 = torch.cat([zeros_tensor, average_image_embedf], dim=0)
1224
  print('shape 4: ', clip_image_embeds.shape)
1225
+ print('shape 4a: ', clip_image_embeds2.shape)
1226
  '''
1227
  #clip_image_embeds = clip_image_embeds.unsqueeze(0) # Add a dimension at the beginning so now you have [1, 2*seq_len_img, embed_dim_img]
1228
  print('shape 5: ', clip_image_embeds.shape)