Spaces:
Running on Zero
Running on Zero
fix(spaces): bump @spaces.GPU duration 300s → 600s
Browse filesLipsync hit GPU task aborted exactly at the 300s wall. The workflow runs:
init/load (~3 min on cold cache) + sampler 1 (~50s) + sampler 2 (~30s) +
VAE decode + ffmpeg audio-mux. Total ran 305s — killed mid-mux just as
the video was about to land on disk.
The duration param is a timeout, not a billing cap (HF bills actual
usage). Bumping to 600s (10 min) gives heavy modes — lipsync, future
keyframe and style transfer with bigger workflows — headroom on cold
caches without affecting lighter T2V calls (those still finish in ~30s
and release the GPU back to the pool immediately).
- backend.py +7 -4
backend.py
CHANGED
|
@@ -65,9 +65,12 @@ def _identity(fn):
|
|
| 65 |
|
| 66 |
# ZeroGPU's startup detector scans loaded modules for spaces.GPU-wrapped
|
| 67 |
# functions. The decorator must be applied at module load time — runtime
|
| 68 |
-
# wrapping inside a request handler isn't detected.
|
| 69 |
-
#
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
|
| 73 |
@_GPU
|
|
@@ -359,7 +362,7 @@ class ComfyUILibraryBackend:
|
|
| 359 |
# ProgressBar class reads, but is the documented API.
|
| 360 |
comfy.utils.set_progress_bar_global_hook(_hook)
|
| 361 |
# _execute_workflow is module-level and decorated with
|
| 362 |
-
# @spaces.GPU(duration=
|
| 363 |
# heavy compute run on a borrowed H200. Off-Spaces it's a
|
| 364 |
# plain call. Returns the video path directly (computed
|
| 365 |
# inside the GPU context so the executor's history is fresh).
|
|
|
|
| 65 |
|
| 66 |
# ZeroGPU's startup detector scans loaded modules for spaces.GPU-wrapped
|
| 67 |
# functions. The decorator must be applied at module load time — runtime
|
| 68 |
+
# wrapping inside a request handler isn't detected. `duration` is the per-call
|
| 69 |
+
# timeout, NOT a billing cap (HF bills actual usage). Setting it generously
|
| 70 |
+
# (10 min) so heavy modes like lipsync (audio encoder + extra LoRAs + VAE
|
| 71 |
+
# decode + ffmpeg mux) don't hit the 300s wall mid-mux. Light modes return
|
| 72 |
+
# in ~30-60s and free the GPU back into the pool.
|
| 73 |
+
_GPU = spaces.GPU(duration=600) if (spaces is not None and _on_spaces()) else _identity
|
| 74 |
|
| 75 |
|
| 76 |
@_GPU
|
|
|
|
| 362 |
# ProgressBar class reads, but is the documented API.
|
| 363 |
comfy.utils.set_progress_bar_global_hook(_hook)
|
| 364 |
# _execute_workflow is module-level and decorated with
|
| 365 |
+
# @spaces.GPU(duration=600) on Spaces — that's what makes the
|
| 366 |
# heavy compute run on a borrowed H200. Off-Spaces it's a
|
| 367 |
# plain call. Returns the video path directly (computed
|
| 368 |
# inside the GPU context so the executor's history is fresh).
|