Spaces:
Running on Zero
Running on Zero
bennyguo commited on
Commit ·
0798bf7
1
Parent(s): 7f89ce5
Run image preprocessing on GPU
Browse filesDecorate on_image_change with @spaces.GPU so BiRefNet runs on the GPU
worker instead of falling back to the CPU-only main process.
app.py
CHANGED
|
@@ -85,6 +85,7 @@ def _viewer_iframe(ply_path: Path) -> str:
|
|
| 85 |
# Event handlers
|
| 86 |
# ----------------------------------------------------------------------------
|
| 87 |
|
|
|
|
| 88 |
def on_image_change(image):
|
| 89 |
"""Run preprocessing as soon as the input changes — gives the user instant
|
| 90 |
feedback on the matte/crop without waiting for the full generation."""
|
|
|
|
| 85 |
# Event handlers
|
| 86 |
# ----------------------------------------------------------------------------
|
| 87 |
|
| 88 |
+
@spaces.GPU
|
| 89 |
def on_image_change(image):
|
| 90 |
"""Run preprocessing as soon as the input changes — gives the user instant
|
| 91 |
feedback on the matte/crop without waiting for the full generation."""
|