Spaces:
Paused
Paused
Update api/ltx_server_refactored.py
Browse files- api/ltx_server_refactored.py +10 -6
api/ltx_server_refactored.py
CHANGED
|
@@ -357,13 +357,17 @@ class VideoService:
|
|
| 357 |
if num_chunks == 0: raise ValueError("O prompt está vazio ou não contém linhas válidas.")
|
| 358 |
|
| 359 |
total_actual_frames = max(9, int(round((round(duration * FPS) - 1) / 8.0) * 8 + 1))
|
|
|
|
|
|
|
|
|
|
| 360 |
|
| 361 |
if num_chunks > 1:
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
frames_per_chunk =
|
| 366 |
-
frames_per_chunk_last =
|
|
|
|
| 367 |
else:
|
| 368 |
frames_per_chunk = total_actual_frames
|
| 369 |
frames_per_chunk_last = total_actual_frames
|
|
@@ -371,7 +375,7 @@ class VideoService:
|
|
| 371 |
frames_per_chunk = max(9, frames_per_chunk)
|
| 372 |
frames_per_chunk_last = max(9, frames_per_chunk_last)
|
| 373 |
|
| 374 |
-
poda_latents_num = overlap_frames
|
| 375 |
|
| 376 |
latentes_chunk_video = []
|
| 377 |
condition_item_latent_overlap = None
|
|
|
|
| 357 |
if num_chunks == 0: raise ValueError("O prompt está vazio ou não contém linhas válidas.")
|
| 358 |
|
| 359 |
total_actual_frames = max(9, int(round((round(duration * FPS) - 1) / 8.0) * 8 + 1))
|
| 360 |
+
num_tt = ((total_actual_frames//num_chunks)
|
| 361 |
+
num_tt = ((num_tt//8)*8)+1
|
| 362 |
+
|
| 363 |
|
| 364 |
if num_chunks > 1:
|
| 365 |
+
total_actual_frames = num_tt*num_chunks
|
| 366 |
+
total_blocks = num_chunks
|
| 367 |
+
frames_per_chunk = num_tt
|
| 368 |
+
frames_per_chunk = ((frames_per_chunk//8)*8)+1
|
| 369 |
+
frames_per_chunk_last = total_actual_frames - (frames_per_chunk*(num_chunks-1))
|
| 370 |
+
frames_per_chunk_last = ((frames_per_chunk_last//8)*8)+1
|
| 371 |
else:
|
| 372 |
frames_per_chunk = total_actual_frames
|
| 373 |
frames_per_chunk_last = total_actual_frames
|
|
|
|
| 375 |
frames_per_chunk = max(9, frames_per_chunk)
|
| 376 |
frames_per_chunk_last = max(9, frames_per_chunk_last)
|
| 377 |
|
| 378 |
+
poda_latents_num = overlap_frames
|
| 379 |
|
| 380 |
latentes_chunk_video = []
|
| 381 |
condition_item_latent_overlap = None
|