eeuuia commited on
Commit
77294b1
·
verified ·
1 Parent(s): c66d2c2

Update api/ltx/ltx_utils.py

Browse files
Files changed (1) hide show
  1. api/ltx/ltx_utils.py +7 -7
api/ltx/ltx_utils.py CHANGED
@@ -108,15 +108,15 @@ def build_ltx_pipeline_on_cpu(config: Dict) -> Tuple[LTXVideoPipeline, Optional[
108
  prompt_enhancer_llm_model=None, prompt_enhancer_llm_tokenizer=None,
109
  )
110
 
111
- #latent_upsampler = None
112
- #if config.get("spatial_upscaler_model_path"):
113
- # spatial_path = config["spatial_upscaler_model_path"]
114
- # latent_upsampler = create_latent_upsampler(spatial_path, device="cpu")
115
- # if precision == "bfloat16":
116
- # latent_upsampler.to(torch.bfloat16)
117
 
118
  logging.info(f"LTX pipeline built on CPU in {time.perf_counter() - t0:.2f}s")
119
- return pipeline, _ #latent_upsampler
120
 
121
 
122
  # ==============================================================================
 
108
  prompt_enhancer_llm_model=None, prompt_enhancer_llm_tokenizer=None,
109
  )
110
 
111
+ latent_upsampler = None
112
+ if config.get("spatial_upscaler_model_path"):
113
+ spatial_path = config["spatial_upscaler_model_path"]
114
+ latent_upsampler = create_latent_upsampler(spatial_path, device="cpu")
115
+ if precision == "bfloat16":
116
+ latent_upsampler.to(torch.bfloat16)
117
 
118
  logging.info(f"LTX pipeline built on CPU in {time.perf_counter() - t0:.2f}s")
119
+ return pipeline, latent_upsampler
120
 
121
 
122
  # ==============================================================================