Vicente Alvarez commited on
Commit
6cb5ae5
·
1 Parent(s): fdf8bb8

Match Modal exactly: upsampler 1.0 + inference_mode workaround

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -47,6 +47,10 @@ import torch
47
  torch._dynamo.config.suppress_errors = True
48
  torch._dynamo.config.disable = True
49
 
 
 
 
 
50
  import spaces
51
  import gradio as gr
52
  import numpy as np
@@ -113,7 +117,7 @@ print("=" * 80)
113
 
114
  checkpoint_path = hf_hub_download(repo_id=CHECKPOINT_REPO, filename="sulphur_dev_bf16.safetensors")
115
  distilled_lora_path = hf_hub_download(repo_id=DISTILL_LORA_REPO, filename="distill_loras/ltx-2.3-22b-distilled-lora-1.1_fro90_ceil72_condsafe.safetensors")
116
- spatial_upsampler_path = hf_hub_download(repo_id=LTX_MODEL_REPO, filename="ltx-2.3-spatial-upscaler-x2-1.1.safetensors")
117
  gemma_root = snapshot_download(repo_id=GEMMA_REPO)
118
 
119
  print(f"Checkpoint: {checkpoint_path}")
 
47
  torch._dynamo.config.suppress_errors = True
48
  torch._dynamo.config.disable = True
49
 
50
+ # Critical workaround: Replace inference_mode with no_grad
51
+ # Avoids "inference tensor" failures in spatial upsampler and VAE decoder
52
+ torch.inference_mode = torch.no_grad
53
+
54
  import spaces
55
  import gradio as gr
56
  import numpy as np
 
117
 
118
  checkpoint_path = hf_hub_download(repo_id=CHECKPOINT_REPO, filename="sulphur_dev_bf16.safetensors")
119
  distilled_lora_path = hf_hub_download(repo_id=DISTILL_LORA_REPO, filename="distill_loras/ltx-2.3-22b-distilled-lora-1.1_fro90_ceil72_condsafe.safetensors")
120
+ spatial_upsampler_path = hf_hub_download(repo_id=LTX_MODEL_REPO, filename="ltx-2.3-spatial-upscaler-x2-1.0.safetensors")
121
  gemma_root = snapshot_download(repo_id=GEMMA_REPO)
122
 
123
  print(f"Checkpoint: {checkpoint_path}")