Update pipeline_stable_diffusion_3_ipa.py
Browse files
pipeline_stable_diffusion_3_ipa.py
CHANGED
@@ -1189,8 +1189,11 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
|
|
1189 |
if linear_layer.weight.device.type == 'cpu':
|
1190 |
linear_layer.to('cuda')
|
1191 |
'''
|
|
|
|
|
|
|
1192 |
# Pass the concatenated embeddings through the linear layer
|
1193 |
-
clip_image_embeds = linear_layer(
|
1194 |
|
1195 |
# Add a ReLU activation for non-linearity (optional)
|
1196 |
#combined_embeds = torch.relu(combined_embeds)
|
|
|
1189 |
if linear_layer.weight.device.type == 'cpu':
|
1190 |
linear_layer.to('cuda')
|
1191 |
'''
|
1192 |
+
|
1193 |
+
batch_size = concatenated_embeds.shape[0]
|
1194 |
+
reshaped_embeds = concatenated_embeds.view(batch_size, input_dim)
|
1195 |
# Pass the concatenated embeddings through the linear layer
|
1196 |
+
clip_image_embeds = linear_layer(reshaped_embeds)
|
1197 |
|
1198 |
# Add a ReLU activation for non-linearity (optional)
|
1199 |
#combined_embeds = torch.relu(combined_embeds)
|