EuuIia commited on
Commit
bb04f38
·
verified ·
1 Parent(s): 07bb098

Update api/ltx_server.py

Browse files
Files changed (1) hide show
  1. api/ltx_server.py +11 -8
api/ltx_server.py CHANGED
@@ -426,15 +426,18 @@ class VideoService:
426
 
427
  if steps > 1:
428
  i = 0
 
429
  while i < steps:
430
- start = i*num_latente_por_chunk
431
- end = (start+num_latente_por_chunk)-1
432
- if i+1 >= steps:
433
- end = sum_latent-1
434
- chunk = latents_brutos[:, :, start:end, :, :].clone()
435
- chunks.append(chunk)
436
- print(f"[DEBUG] chunk{i+1}[:, :, {start}:{end}, :, :] = {chunk.shape[2]}")
437
- i += 1
 
 
438
  else:
439
  print(f"[DEBUG] numero chunks minimo")
440
  print(f"[DEBUG] latents_brutos[:, :, :, :, :] = {latents_brutos.shape[2]}")
 
426
 
427
  if steps > 1:
428
  i = 0
429
+ end=1
430
  while i < steps:
431
+ start = end-1
432
+ end += num_latente_por_chunk
433
+ if end+2>=sum_latent:
434
+ end = sum_latent-1
435
+ i = steps
436
+ else:
437
+ i += 1
438
+ chunk = latents_brutos[:, :, start:end, :, :].clone()
439
+ chunks.append(chunk)
440
+ print(f"[DEBUG] chunk{i}[:, :, {start}:{end}, :, :] = {chunk.shape[2]}")
441
  else:
442
  print(f"[DEBUG] numero chunks minimo")
443
  print(f"[DEBUG] latents_brutos[:, :, :, :, :] = {latents_brutos.shape[2]}")