Update pipeline.py
Browse files- pipeline.py +4 -0
pipeline.py
CHANGED
@@ -1491,6 +1491,8 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1491 |
|
1492 |
else:
|
1493 |
# predict the noise residual without contorlnet
|
|
|
|
|
1494 |
noise_pred = self.unet(
|
1495 |
latent_model_input,
|
1496 |
t,
|
@@ -1498,6 +1500,8 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1498 |
cross_attention_kwargs=cross_attention_kwargs,
|
1499 |
added_cond_kwargs=added_cond_kwargs,
|
1500 |
).sample
|
|
|
|
|
1501 |
|
1502 |
|
1503 |
if do_classifier_free_guidance:
|
|
|
1491 |
|
1492 |
else:
|
1493 |
# predict the noise residual without contorlnet
|
1494 |
+
torch.cuda.synchronize()
|
1495 |
+
unet_start = time.time()
|
1496 |
noise_pred = self.unet(
|
1497 |
latent_model_input,
|
1498 |
t,
|
|
|
1500 |
cross_attention_kwargs=cross_attention_kwargs,
|
1501 |
added_cond_kwargs=added_cond_kwargs,
|
1502 |
).sample
|
1503 |
+
torch.cuda.synchronize()
|
1504 |
+
print("unet time", time.time() - unet_start)
|
1505 |
|
1506 |
|
1507 |
if do_classifier_free_guidance:
|