Update pipeline_stable_diffusion_3_ipa.py
Browse files
pipeline_stable_diffusion_3_ipa.py
CHANGED
@@ -1195,16 +1195,16 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
|
|
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
|
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
|
1202 |
-
print('catted embeds
|
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: ',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 |
|
|
|
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 |
|