Update api/ltx_server.py
Browse files- api/ltx_server.py +18 -15
api/ltx_server.py
CHANGED
|
@@ -416,25 +416,28 @@ class VideoService:
|
|
| 416 |
if num_latente_por_chunk >= sum_latent:
|
| 417 |
return [latents_brutos.clone()]
|
| 418 |
|
| 419 |
-
steps = (sum_latent
|
| 420 |
print("================PODA CAUSAL=================")
|
| 421 |
print(f"[DEBUG] TOTAL LATENTES = {sum_latent}")
|
| 422 |
print(f"[DEBUG] Num LATENTES por chunk = {num_latente_por_chunk}")
|
| 423 |
print(f"[DEBUG] Número de chunks = {steps}")
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
|
|
|
|
|
|
|
|
|
| 438 |
print("================PODA CAUSAL=================")
|
| 439 |
return chunks
|
| 440 |
|
|
|
|
| 416 |
if num_latente_por_chunk >= sum_latent:
|
| 417 |
return [latents_brutos.clone()]
|
| 418 |
|
| 419 |
+
steps = (sum_latent) // num_latente_por_chunk
|
| 420 |
print("================PODA CAUSAL=================")
|
| 421 |
print(f"[DEBUG] TOTAL LATENTES = {sum_latent}")
|
| 422 |
print(f"[DEBUG] Num LATENTES por chunk = {num_latente_por_chunk}")
|
| 423 |
print(f"[DEBUG] Número de chunks = {steps}")
|
| 424 |
+
|
| 425 |
+
start = 0
|
| 426 |
+
end = num_latente_por_chunk
|
| 427 |
+
if steps > 1:
|
| 428 |
+
while start+steps < sum_latent:
|
| 429 |
+
end = start+steps
|
| 430 |
+
if end+3>sum_latent:
|
| 431 |
+
end = sum_latent
|
| 432 |
+
start = end
|
| 433 |
+
chunk = latents_brutos[:, :, start:end-1, :, :].clone()
|
| 434 |
+
chunks.append(chunk)
|
| 435 |
+
print(f"[DEBUG] chunk{i+1}[:, :, {start}:{end-1}, :, :] = {chunk.shape[2]}")
|
| 436 |
+
start += steps
|
| 437 |
+
else:
|
| 438 |
+
print(f"[DEBUG] numero chunks minimo")
|
| 439 |
+
print(f"[DEBUG] latents_brutos[:, :, :, :, :] = {latents_brutos.shape[2]}")
|
| 440 |
+
chunks.append(latents_brutos)
|
| 441 |
print("================PODA CAUSAL=================")
|
| 442 |
return chunks
|
| 443 |
|