Update pipeline.py
Browse files- pipeline.py +6 -6
pipeline.py
CHANGED
@@ -1528,13 +1528,13 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1528 |
torch.cuda.synchronize() # Synchronize GPU before batch addition
|
1529 |
time_batch_addition_start = time.time()
|
1530 |
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
|
1536 |
-
|
1537 |
-
|
1538 |
|
1539 |
torch.cuda.synchronize() # Synchronize GPU after batch addition
|
1540 |
time_batch_addition_end = time.time()
|
|
|
1528 |
torch.cuda.synchronize() # Synchronize GPU before batch addition
|
1529 |
time_batch_addition_start = time.time()
|
1530 |
|
1531 |
+
current_context_tensor = torch.tensor(current_context_indexes, device=latent_counter.device)
|
1532 |
+
# Perform batch addition
|
1533 |
+
noise_pred_uncond_sum[..., current_context_tensor, :, :] += noise_pred_uncond.transpose(1, 2)
|
1534 |
+
noise_pred_text_sum[..., current_context_tensor, :, :] += noise_pred_text.transpose(1, 2)
|
1535 |
|
1536 |
+
# Batch increment for latent_counter
|
1537 |
+
latent_counter[current_context_tensor] += 1
|
1538 |
|
1539 |
torch.cuda.synchronize() # Synchronize GPU after batch addition
|
1540 |
time_batch_addition_end = time.time()
|