Update pipeline_stable_diffusion_3_ipa.py
Browse files
pipeline_stable_diffusion_3_ipa.py
CHANGED
|
@@ -1178,11 +1178,11 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
|
|
| 1178 |
embedding_dim = concatenated_embeds.shape[-1] # Get the embedding dimension
|
| 1179 |
linear_layer = nn.Linear(embedding_dim * len(image_prompt_embeds_list), embedding_dim)
|
| 1180 |
# Move `concatenated_embeds` to the GPU if it's on the CPU
|
| 1181 |
-
if concatenated_embeds.device == 'cpu':
|
| 1182 |
concatenated_embeds = concatenated_embeds.to('cuda')
|
| 1183 |
|
| 1184 |
# Move the `linear_layer` weights and biases to the GPU if they're on the CPU
|
| 1185 |
-
if linear_layer.weight.device == 'cpu':
|
| 1186 |
linear_layer.to('cuda')
|
| 1187 |
# Pass the concatenated embeddings through the linear layer
|
| 1188 |
combined_embeds = linear_layer(concatenated_embeds)
|
|
|
|
| 1178 |
embedding_dim = concatenated_embeds.shape[-1] # Get the embedding dimension
|
| 1179 |
linear_layer = nn.Linear(embedding_dim * len(image_prompt_embeds_list), embedding_dim)
|
| 1180 |
# Move `concatenated_embeds` to the GPU if it's on the CPU
|
| 1181 |
+
if concatenated_embeds.device.type == 'cpu':
|
| 1182 |
concatenated_embeds = concatenated_embeds.to('cuda')
|
| 1183 |
|
| 1184 |
# Move the `linear_layer` weights and biases to the GPU if they're on the CPU
|
| 1185 |
+
if linear_layer.weight.device.type == 'cpu':
|
| 1186 |
linear_layer.to('cuda')
|
| 1187 |
# Pass the concatenated embeddings through the linear layer
|
| 1188 |
combined_embeds = linear_layer(concatenated_embeds)
|