1inkusFace commited on
Commit
7d818c8
·
verified ·
1 Parent(s): ad2fccd

Update pipeline_stable_diffusion_3_ipa.py

Browse files
Files changed (1) hide show
  1. pipeline_stable_diffusion_3_ipa.py +3 -1
pipeline_stable_diffusion_3_ipa.py CHANGED
@@ -1179,7 +1179,9 @@ class StableDiffusion3Pipeline(DiffusionPipeline, SD3LoraLoaderMixin, FromSingle
1179
 
1180
  # Create a linear layer
1181
  embedding_dim = concatenated_embeds.shape[-1] # Get the embedding dimension
1182
- linear_layer = nn.Linear(len(image_prompt_embeds_list) * embedding_dim, embedding_dim, dtype=torch.bfloat16).to('cuda')
 
 
1183
  # Move `concatenated_embeds` to the GPU if it's on the CPU
1184
  '''
1185
  if concatenated_embeds.device.type == 'cpu':
 
1179
 
1180
  # Create a linear layer
1181
  embedding_dim = concatenated_embeds.shape[-1] # Get the embedding dimension
1182
+ num_images = len(image_prompt_embeds_list)
1183
+
1184
+ linear_layer = nn.Linear(input_dim, embedding_dim, dtype=torch.bfloat16).to(device)
1185
  # Move `concatenated_embeds` to the GPU if it's on the CPU
1186
  '''
1187
  if concatenated_embeds.device.type == 'cpu':