1inkusFace commited on
Commit
3c78b83
·
verified ·
1 Parent(s): ba76ef1

Update pipeline_stable_diffusion_3_ipa.py

Browse files
Files changed (1) hide show
  1. pipeline_stable_diffusion_3_ipa.py +1 -9
pipeline_stable_diffusion_3_ipa.py CHANGED
@@ -1175,15 +1175,7 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
1175
  image_prompt_embeds_list.append(image_prompt_embeds_5)
1176
 
1177
  # Concatenate the image embeddings
1178
- concatenated_embeds = torch.cat(image_prompt_embeds_list, dim=1) # Concatenate along dimension 1
1179
- embedding_dim = concatenated_embeds.shape[-1] # Get the embedding dimension
1180
-
1181
- total_embedding_dim = concatenated_embeds.shape
1182
- linear_layer = nn.Linear(embedding_dim * len(image_prompt_embeds_list), embedding_dim * len(image_prompt_embeds_list), dtype=self.dtype).to(self.device)
1183
- clip_image_embeds = linear_layer(concatenated_embeds)
1184
-
1185
- # Add a ReLU activation for non-linearity (optional)
1186
- #combined_embeds = torch.relu(combined_embeds)
1187
 
1188
  # 4. Prepare timesteps
1189
  timesteps, num_inference_steps = retrieve_timesteps(self.scheduler, num_inference_steps, device, timesteps)
 
1175
  image_prompt_embeds_list.append(image_prompt_embeds_5)
1176
 
1177
  # Concatenate the image embeddings
1178
+ clip_image_embeds = torch.mean(torch.stack(image_prompt_embeds_list), dim=0)
 
 
 
 
 
 
 
 
1179
 
1180
  # 4. Prepare timesteps
1181
  timesteps, num_inference_steps = retrieve_timesteps(self.scheduler, num_inference_steps, device, timesteps)