DawnC commited on
Commit
c79f29c
·
verified ·
1 Parent(s): c40071d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -17
app.py CHANGED
@@ -21,25 +21,13 @@ def launch_final_blend_sceneweaver(share: bool = True, debug: bool = False):
21
  ui = UIManager()
22
  print("✅ UIManager instance created successfully")
23
 
24
- # Pre-load inpainting pipeline on Hugging Face Spaces
25
- # This ensures first request doesn't timeout due to model loading
26
  if os.getenv('SPACE_ID'):
27
  print("\n🔧 Detected Hugging Face Spaces environment")
28
- print(" Pre-loading inpainting pipeline to avoid first-request timeout...")
29
- try:
30
- success = ui.sceneweaver.switch_to_inpainting_mode(
31
- conditioning_type='canny',
32
- progress_callback=lambda msg, pct: print(f" [{pct:3d}%] {msg}")
33
- )
34
- if success:
35
- print("✅ Inpainting pipeline pre-loaded successfully!")
36
- print(" All requests will now complete within 300s limit")
37
- else:
38
- print("⚠️ Pre-load failed, will load on first request")
39
- print(" (First inpainting request may timeout)")
40
- except Exception as e:
41
- print(f"⚠️ Pre-load warning: {e}")
42
- print(" Continuing anyway - will load on demand")
43
  print()
44
 
45
  # Launch UI
 
21
  ui = UIManager()
22
  print("✅ UIManager instance created successfully")
23
 
24
+ # Note: On Hugging Face Spaces, models will be loaded on-demand
25
+ # within @spaces.GPU decorated functions to comply with ZeroGPU requirements
26
  if os.getenv('SPACE_ID'):
27
  print("\n🔧 Detected Hugging Face Spaces environment")
28
+ print(" Models will load on-demand (ZeroGPU stateless requirement)")
29
+ print(" First inpainting request: ~7 steps (280s)")
30
+ print(" Subsequent requests: ~11 steps (245s)")
 
 
 
 
 
 
 
 
 
 
 
 
31
  print()
32
 
33
  # Launch UI