1inkusFace commited on
Commit
6cf2243
·
verified ·
1 Parent(s): 90b68be

Update pipeline_stable_diffusion_3_ipa.py

Browse files
Files changed (1) hide show
  1. pipeline_stable_diffusion_3_ipa.py +8 -11
pipeline_stable_diffusion_3_ipa.py CHANGED
@@ -1193,18 +1193,15 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
1193
  clip_image_embeds_5 = clip_image_embeds_5 * scale_5
1194
  image_prompt_embeds_list.append(clip_image_embeds_5)
1195
 
1196
- #clip_image_embeds_cat_list = torch.cat(image_prompt_embeds_list).mean(dim=0)
1197
- clip_image_embeds_cat_list = torch.cat(image_prompt_embeds_list, dim=1)
1198
- print('catted embeds list with meanout shape: ',clip_image_embeds_cat_list.shape)
1199
- #seq_len, _ = clip_image_embeds_cat_list.shape
1200
- #clip_image_embeds_cat_list_repeat = clip_image_embeds_cat_list.repeat(1, 1, 1)
1201
- clip_image_embeds_view = clip_image_embeds_cat_list #.unsqueeze(0) # Added unsqueeze here instead
1202
- #print('catted embeds unsqueeze shape: ',clip_image_embeds_view.shape)
1203
- #clip_image_embeds_view = clip_image_embeds_view.view(1, seq_len, -1)
1204
- #print('catted viewed: ',clip_image_embeds_view.shape)
1205
  zeros_tensor = torch.zeros_like(clip_image_embeds_view)
1206
- #zeros_tensor = torch.zeros_like(clip_image_embeds_view[:, :image_prompt_embeds_list[0].shape[1], :]) # Make zeros tensor match the sequence length of a single image embedding
1207
- print('zeros shape: ',zeros_tensor.shape)
1208
  clip_image_embeds = torch.cat([zeros_tensor, clip_image_embeds_view], dim=0)
1209
  print('embeds shape: ', clip_image_embeds.shape)
1210
 
 
1193
  clip_image_embeds_5 = clip_image_embeds_5 * scale_5
1194
  image_prompt_embeds_list.append(clip_image_embeds_5)
1195
 
1196
+ clip_image_embeds_cat_list = torch.cat(image_prompt_embeds_list).mean(dim=0)
1197
+ print('catted embeds list with mean: ',clip_image_embeds_cat_list.shape)
1198
+ seq_len, _ = clip_image_embeds_cat_list.shape
1199
+ clip_image_embeds_cat_list_repeat = clip_image_embeds_cat_list.repeat(1, 1, 1)
1200
+ print('catted embeds repeat: ',clip_image_embeds_cat_list_repeat.shape)
1201
+ clip_image_embeds_view = clip_image_embeds_cat_list_repeat.view(1, seq_len, -1)
1202
+ print('catted viewed: ',clip_image_embeds_view.shape)
 
 
1203
  zeros_tensor = torch.zeros_like(clip_image_embeds_view)
1204
+ print('zeros: ',zeros_tensor.shape)
 
1205
  clip_image_embeds = torch.cat([zeros_tensor, clip_image_embeds_view], dim=0)
1206
  print('embeds shape: ', clip_image_embeds.shape)
1207