Update pipeline_stable_diffusion_3_ipa.py
Browse files
pipeline_stable_diffusion_3_ipa.py
CHANGED
|
@@ -1214,8 +1214,9 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
|
|
| 1214 |
zeros_tensor = torch.zeros_like(average_image_embed)
|
| 1215 |
print('shape 3: ', zeros_tensor.shape)
|
| 1216 |
# 4. Concatenate the zeros and the average embedding
|
| 1217 |
-
clip_image_embeds = torch.cat([zeros_tensor, average_image_embed], dim=
|
| 1218 |
print('shape 4: ', clip_image_embeds.shape)
|
|
|
|
| 1219 |
#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]
|
| 1220 |
print('shape 5: ', clip_image_embeds.shape)
|
| 1221 |
|
|
@@ -1229,7 +1230,7 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
|
|
| 1229 |
print('shape 8: ', clip_image_embedsb.shape)
|
| 1230 |
|
| 1231 |
clip_image_embeds = clip_image_embedsb
|
| 1232 |
-
|
| 1233 |
#clip_image_embeds = torch.cat([torch.stack(image_prompt_embeds_list)], dim=0).mean(dim=0)
|
| 1234 |
|
| 1235 |
# 4. Prepare timesteps
|
|
|
|
| 1214 |
zeros_tensor = torch.zeros_like(average_image_embed)
|
| 1215 |
print('shape 3: ', zeros_tensor.shape)
|
| 1216 |
# 4. Concatenate the zeros and the average embedding
|
| 1217 |
+
clip_image_embeds = torch.cat([zeros_tensor, average_image_embed], dim=0)
|
| 1218 |
print('shape 4: ', clip_image_embeds.shape)
|
| 1219 |
+
'''
|
| 1220 |
#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]
|
| 1221 |
print('shape 5: ', clip_image_embeds.shape)
|
| 1222 |
|
|
|
|
| 1230 |
print('shape 8: ', clip_image_embedsb.shape)
|
| 1231 |
|
| 1232 |
clip_image_embeds = clip_image_embedsb
|
| 1233 |
+
'''
|
| 1234 |
#clip_image_embeds = torch.cat([torch.stack(image_prompt_embeds_list)], dim=0).mean(dim=0)
|
| 1235 |
|
| 1236 |
# 4. Prepare timesteps
|