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

Update api/ltx/ltx_utils.py

Browse files
Files changed (1) hide show
  1. api/ltx/ltx_utils.py +5 -2
api/ltx/ltx_utils.py CHANGED
@@ -109,8 +109,11 @@ def build_ltx_pipeline_on_cpu(config: Dict) -> Tuple[LTXVideoPipeline, Optional[
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)
 
109
  )
110
 
111
  latent_upsampler = None
112
+ if config.get("spatial_upscaler_model_path"):
113
+ spatial_path_str = hf_hub_download(repo_id=LTX_REPO_ID, filename=config["spatial_upscaler_model_path"], cache_dir=CACHE_DIR)
114
+ spatial_path = Path(spatial_path_str)
115
+ if not ckpt_path.is_file():
116
+ raise FileNotFoundError(f"Main checkpoint file not found: {spatial_path}")
117
  latent_upsampler = create_latent_upsampler(spatial_path, device="cpu")
118
  if precision == "bfloat16":
119
  latent_upsampler.to(torch.bfloat16)