Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
#
|
| 25 |
-
#
|
| 26 |
if os.getenv('SPACE_ID'):
|
| 27 |
print("\n🔧 Detected Hugging Face Spaces environment")
|
| 28 |
-
print("
|
| 29 |
-
|
| 30 |
-
|
| 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
|