multimodalart HF Staff commited on
Commit
9b2ac8f
·
verified ·
1 Parent(s): fb38ba8

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +1 -11
app.py CHANGED
@@ -27,17 +27,7 @@ pipe = JoyImageEditPlusPipeline.from_pretrained(
27
  pipe.enable_model_cpu_offload()
28
 
29
 
30
- def _estimate_duration(images, prompt, num_inference_steps, guidance_scale, seed, negative_prompt, randomize_seed, *args, **kwargs):
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,