Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -27,17 +27,7 @@ pipe = JoyImageEditPlusPipeline.from_pretrained(
|
|
| 27 |
pipe.enable_model_cpu_offload()
|
| 28 |
|
| 29 |
|
| 30 |
-
|
| 31 |
-
"""Estimate the GPU duration needed based on step count and image count.
|
| 32 |
-
|
| 33 |
-
Accepts *args/**kwargs because Gradio passes progress= positionally.
|
| 34 |
-
"""
|
| 35 |
-
n_imgs = len(images) if images else 0
|
| 36 |
-
# ~1s per step for 16B transformer + 8B text encoder + VAE, plus overhead
|
| 37 |
-
return min(300, 60 + int(num_inference_steps * 3.5) + n_imgs * 10)
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
@spaces.GPU(duration=_estimate_duration)
|
| 41 |
def generate(
|
| 42 |
images,
|
| 43 |
prompt: str,
|
|
|
|
| 27 |
pipe.enable_model_cpu_offload()
|
| 28 |
|
| 29 |
|
| 30 |
+
@spaces.GPU(duration=300)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
def generate(
|
| 32 |
images,
|
| 33 |
prompt: str,
|