Other time
Browse files
app.py
CHANGED
|
@@ -14,7 +14,6 @@ import numpy as np
|
|
| 14 |
import argparse
|
| 15 |
import random
|
| 16 |
import math
|
| 17 |
-
import time
|
| 18 |
# 20250506 pftq: Added for video input loading
|
| 19 |
import decord
|
| 20 |
# 20250506 pftq: Added for progress bars in video_encode
|
|
@@ -665,7 +664,6 @@ def worker_video(input_video, prompt, n_prompt, seed, batch, resolution, total_s
|
|
| 665 |
#save_bcthw_as_mp4(vae_decode(video_latents, vae).cpu(), os.path.join(outputs_folder, f'{job_id}_input_video.mp4'), fps=fps, crf=mp4_crf) # 20250507 pftq: test fast movement corrupted by vae encoding if vae batch size too low
|
| 666 |
|
| 667 |
for section_index in range(total_latent_sections):
|
| 668 |
-
start = time.time()
|
| 669 |
if stream.input_queue.top() == 'end':
|
| 670 |
stream.output_queue.push(('end', None))
|
| 671 |
return
|
|
@@ -745,9 +743,6 @@ def worker_video(input_video, prompt, n_prompt, seed, batch, resolution, total_s
|
|
| 745 |
|
| 746 |
# 20250507 pftq: Fix for <=1 sec videos.
|
| 747 |
max_frames = min(latent_window_size * 4 - 3, history_latents.shape[2] * 4)
|
| 748 |
-
end = time.time()
|
| 749 |
-
secondes = int(end - start)
|
| 750 |
-
print("££££££££££££££££££££££££££££££££££££££££ " + str(secondes))
|
| 751 |
|
| 752 |
generated_latents = sample_hunyuan(
|
| 753 |
transformer=transformer,
|
|
@@ -778,6 +773,7 @@ def worker_video(input_video, prompt, n_prompt, seed, batch, resolution, total_s
|
|
| 778 |
clean_latent_4x_indices=clean_latent_4x_indices,
|
| 779 |
callback=callback,
|
| 780 |
)
|
|
|
|
| 781 |
|
| 782 |
total_generated_latent_frames += int(generated_latents.shape[2])
|
| 783 |
history_latents = torch.cat([history_latents, generated_latents.to(history_latents)], dim=2)
|
|
@@ -826,6 +822,9 @@ def worker_video(input_video, prompt, n_prompt, seed, batch, resolution, total_s
|
|
| 826 |
print(f'Decoded. Current latent shape {real_history_latents.shape}; pixel shape {history_pixels.shape}')
|
| 827 |
|
| 828 |
stream.output_queue.push(('file', output_filename))
|
|
|
|
|
|
|
|
|
|
| 829 |
|
| 830 |
seed = (seed + 1) % np.iinfo(np.int32).max
|
| 831 |
|
|
|
|
| 14 |
import argparse
|
| 15 |
import random
|
| 16 |
import math
|
|
|
|
| 17 |
# 20250506 pftq: Added for video input loading
|
| 18 |
import decord
|
| 19 |
# 20250506 pftq: Added for progress bars in video_encode
|
|
|
|
| 664 |
#save_bcthw_as_mp4(vae_decode(video_latents, vae).cpu(), os.path.join(outputs_folder, f'{job_id}_input_video.mp4'), fps=fps, crf=mp4_crf) # 20250507 pftq: test fast movement corrupted by vae encoding if vae batch size too low
|
| 665 |
|
| 666 |
for section_index in range(total_latent_sections):
|
|
|
|
| 667 |
if stream.input_queue.top() == 'end':
|
| 668 |
stream.output_queue.push(('end', None))
|
| 669 |
return
|
|
|
|
| 743 |
|
| 744 |
# 20250507 pftq: Fix for <=1 sec videos.
|
| 745 |
max_frames = min(latent_window_size * 4 - 3, history_latents.shape[2] * 4)
|
|
|
|
|
|
|
|
|
|
| 746 |
|
| 747 |
generated_latents = sample_hunyuan(
|
| 748 |
transformer=transformer,
|
|
|
|
| 773 |
clean_latent_4x_indices=clean_latent_4x_indices,
|
| 774 |
callback=callback,
|
| 775 |
)
|
| 776 |
+
start = time.time()
|
| 777 |
|
| 778 |
total_generated_latent_frames += int(generated_latents.shape[2])
|
| 779 |
history_latents = torch.cat([history_latents, generated_latents.to(history_latents)], dim=2)
|
|
|
|
| 822 |
print(f'Decoded. Current latent shape {real_history_latents.shape}; pixel shape {history_pixels.shape}')
|
| 823 |
|
| 824 |
stream.output_queue.push(('file', output_filename))
|
| 825 |
+
end = time.time()
|
| 826 |
+
secondes = int(end - start)
|
| 827 |
+
print("££££££££££££££££££££££££££££££££££££££££ " + str(secondes))
|
| 828 |
|
| 829 |
seed = (seed + 1) % np.iinfo(np.int32).max
|
| 830 |
|