Eueuiaa commited on
Commit
9fddc3b
·
verified ·
1 Parent(s): 76ad878

Update api/ltx_server.py

Browse files
Files changed (1) hide show
  1. api/ltx_server.py +24 -23
api/ltx_server.py CHANGED
@@ -853,7 +853,7 @@ class VideoService:
853
  print(f"[DEBUG] Upscale de Latentes concluído em {time.perf_counter() - t_upscale:.2f}s")
854
  del base_latents; gc.collect(); torch.cuda.empty_cache()
855
 
856
- par = 0
857
  latents_cpu_up = upsampled_latents.detach().to("cpu", non_blocking=True)
858
  torch.cuda.empty_cache()
859
  try:
@@ -872,7 +872,7 @@ class VideoService:
872
 
873
  #latents_parts_up = [latents_cpu_up]
874
 
875
-
876
  for latents in latents_parts_up:
877
 
878
  # # --- ETAPA 3: REFINAMENTO DE TEXTURA (SECOND PASS) ---
@@ -896,28 +896,29 @@ class VideoService:
896
 
897
  second_pass_kwargs = call_kwargs.copy()
898
 
899
- if i==0:
900
- second_pass_kwargs.update({
901
- "conditioning_items": conditioning_items1
902
- "output_type": "latent",
903
- "width": second_pass_width,
904
- "height": second_pass_height,
905
- "num_frames": num_pixel_frames_part,
906
- "latents": latents, # O tensor upscaled
907
- "guidance_scale": float(guidance_scale),
908
- **second_pass_config
909
- })
910
  else:
911
- second_pass_kwargs.update({
912
- "conditioning_items": conditioning_items2
913
- "output_type": "latent",
914
- "width": second_pass_width,
915
- "height": second_pass_height,
916
- "num_frames": num_pixel_frames_part,
917
- "latents": latents, # O tensor upscaled
918
- "guidance_scale": float(guidance_scale),
919
- **second_pass_config
920
- })
 
921
 
922
  print(f"[DEBUG] Second Pass: Refinando em {width_padded}x{height_padded}...")
923
  final_latents = self.pipeline(**second_pass_kwargs).images
 
853
  print(f"[DEBUG] Upscale de Latentes concluído em {time.perf_counter() - t_upscale:.2f}s")
854
  del base_latents; gc.collect(); torch.cuda.empty_cache()
855
 
856
+
857
  latents_cpu_up = upsampled_latents.detach().to("cpu", non_blocking=True)
858
  torch.cuda.empty_cache()
859
  try:
 
872
 
873
  #latents_parts_up = [latents_cpu_up]
874
 
875
+ par = 0
876
  for latents in latents_parts_up:
877
 
878
  # # --- ETAPA 3: REFINAMENTO DE TEXTURA (SECOND PASS) ---
 
896
 
897
  second_pass_kwargs = call_kwargs.copy()
898
 
899
+ if par==0:
900
+ second_pass_kwargs.update({
901
+ "conditioning_items": conditioning_items1,
902
+ "output_type": "latent",
903
+ "width": second_pass_width,
904
+ "height": second_pass_height,
905
+ "num_frames": num_pixel_frames_part,
906
+ "latents": latents, # O tensor upscaled
907
+ "guidance_scale": float(guidance_scale),
908
+ **second_pass_config
909
+ })
910
  else:
911
+ second_pass_kwargs.update({
912
+ "conditioning_items": conditioning_items2,
913
+ "output_type": "latent",
914
+ "width": second_pass_width,
915
+ "height": second_pass_height,
916
+ "num_frames": num_pixel_frames_part,
917
+ "latents": latents, # O tensor upscaled
918
+ "guidance_scale": float(guidance_scale),
919
+ **second_pass_config
920
+ })
921
+ par+=1
922
 
923
  print(f"[DEBUG] Second Pass: Refinando em {width_padded}x{height_padded}...")
924
  final_latents = self.pipeline(**second_pass_kwargs).images