Spaces:
Running
on
Zero
Running
on
Zero
Update pipeline_stable_diffusion_3_ipa.py
Browse files
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 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
clip_image_embeds_view =
|
1202 |
-
|
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 |
-
|
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 |
|