Update pipeline_stable_diffusion_3_ipa.py
Browse files
pipeline_stable_diffusion_3_ipa.py
CHANGED
@@ -1176,9 +1176,10 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
|
|
1176 |
|
1177 |
# Concatenate the image embeddings
|
1178 |
concatenated_embeds = torch.cat(image_prompt_embeds_list, dim=1) # Concatenate along dimension 1
|
|
|
1179 |
|
1180 |
total_embedding_dim = concatenated_embeds.shape
|
1181 |
-
linear_layer = nn.Linear(total_embedding_dim,
|
1182 |
clip_image_embeds = linear_layer(concatenated_embeds)
|
1183 |
|
1184 |
# Add a ReLU activation for non-linearity (optional)
|
|
|
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(total_embedding_dim, embedding_dim, dtype=self.dtype).to(self.device)
|
1183 |
clip_image_embeds = linear_layer(concatenated_embeds)
|
1184 |
|
1185 |
# Add a ReLU activation for non-linearity (optional)
|