Mike0021 commited on
Commit
e75f5c9
·
verified ·
1 Parent(s): 511c02f

fix: remove CPU offload, use pipe.to(cuda) on xlarge for 22B model, adjust duration estimate

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -189,7 +189,6 @@ def _load_pipeline():
189
  adapter_name="3dreal-strong",
190
  weight_name="3DREAL-strong.safetensors",
191
  )
192
- _pipe.enable_model_cpu_offload()
193
  _pipe_lora_variant = None
194
 
195
 
@@ -278,9 +277,9 @@ def _estimate_duration(*args, **kwargs):
278
  num_inference_steps = int(num_inference_steps)
279
  except (TypeError, ValueError):
280
  return 240
281
- # 22B model with enable_model_cpu_offload(): first step ~28s (cold),
282
- # subsequent ~5s each, plus VAE decode + video encoding ~20s.
283
- base = 60 + num_inference_steps * 8
284
  frame_factor = max(1.0, num_frames / 41)
285
  return min(240, int(base * frame_factor))
286
 
@@ -318,6 +317,7 @@ def generate_video(
318
  prompt = _normalize_prompt(prompt)
319
 
320
  pipe = _select_lora(intensity)
 
321
 
322
  width, height = RESOLUTION_MAP.get(resolution, RESOLUTION_MAP["720p"])
323
  num_frames = _round_num_frames(num_frames)
 
189
  adapter_name="3dreal-strong",
190
  weight_name="3DREAL-strong.safetensors",
191
  )
 
192
  _pipe_lora_variant = None
193
 
194
 
 
277
  num_inference_steps = int(num_inference_steps)
278
  except (TypeError, ValueError):
279
  return 240
280
+ # 22B model on xlarge (96GB): pipe.to("cuda") ~20s cold start,
281
+ # ~3s per denoising step, VAE decode + video encoding ~15s.
282
+ base = 40 + num_inference_steps * 4
283
  frame_factor = max(1.0, num_frames / 41)
284
  return min(240, int(base * frame_factor))
285
 
 
317
  prompt = _normalize_prompt(prompt)
318
 
319
  pipe = _select_lora(intensity)
320
+ pipe.to("cuda")
321
 
322
  width, height = RESOLUTION_MAP.get(resolution, RESOLUTION_MAP["720p"])
323
  num_frames = _round_num_frames(num_frames)