Update pipeline.py
Browse files- pipeline.py +1 -5
pipeline.py
CHANGED
@@ -1416,8 +1416,7 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1416 |
|
1417 |
# foreach context group seperately denoise the current timestep
|
1418 |
for context_group in range(len(context_indexes[i])):
|
1419 |
-
# calculate to current indexes, considering
|
1420 |
-
prep_time = time.time()
|
1421 |
current_context_indexes = context_indexes[i][context_group]
|
1422 |
|
1423 |
# select the relevent context from the latents
|
@@ -1426,7 +1425,6 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1426 |
# expand the latents if we are doing classifier free guidance
|
1427 |
latent_model_input = torch.cat([current_context_latents] * 2) if do_classifier_free_guidance else current_context_latents
|
1428 |
latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
|
1429 |
-
print("prep time", time.time() - prep_time)
|
1430 |
|
1431 |
|
1432 |
if self.controlnet != None and i < int(control_end*len(timesteps)):
|
@@ -1485,7 +1483,6 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1485 |
print("unet time", time.time() - unet_start)
|
1486 |
|
1487 |
else:
|
1488 |
-
unet_start = time.time()
|
1489 |
# predict the noise residual without contorlnet
|
1490 |
noise_pred = self.unet(
|
1491 |
latent_model_input,
|
@@ -1494,7 +1491,6 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1494 |
cross_attention_kwargs=cross_attention_kwargs,
|
1495 |
added_cond_kwargs=added_cond_kwargs,
|
1496 |
).sample
|
1497 |
-
print("unet time", time.time() - unet_start)
|
1498 |
|
1499 |
# sum the noise predictions for the unconditional and text conditioned noise
|
1500 |
start_guidance_time = time.time()
|
|
|
1416 |
|
1417 |
# foreach context group seperately denoise the current timestep
|
1418 |
for context_group in range(len(context_indexes[i])):
|
1419 |
+
# calculate to current indexes, considering overlapa
|
|
|
1420 |
current_context_indexes = context_indexes[i][context_group]
|
1421 |
|
1422 |
# select the relevent context from the latents
|
|
|
1425 |
# expand the latents if we are doing classifier free guidance
|
1426 |
latent_model_input = torch.cat([current_context_latents] * 2) if do_classifier_free_guidance else current_context_latents
|
1427 |
latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
|
|
|
1428 |
|
1429 |
|
1430 |
if self.controlnet != None and i < int(control_end*len(timesteps)):
|
|
|
1483 |
print("unet time", time.time() - unet_start)
|
1484 |
|
1485 |
else:
|
|
|
1486 |
# predict the noise residual without contorlnet
|
1487 |
noise_pred = self.unet(
|
1488 |
latent_model_input,
|
|
|
1491 |
cross_attention_kwargs=cross_attention_kwargs,
|
1492 |
added_cond_kwargs=added_cond_kwargs,
|
1493 |
).sample
|
|
|
1494 |
|
1495 |
# sum the noise predictions for the unconditional and text conditioned noise
|
1496 |
start_guidance_time = time.time()
|