bennyguo commited on
Commit
0798bf7
·
1 Parent(s): 7f89ce5

Run image preprocessing on GPU

Browse files

Decorate on_image_change with @spaces.GPU so BiRefNet runs on the GPU
worker instead of falling back to the CPU-only main process.

Files changed (1) hide show
  1. app.py +1 -0
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."""