rahul7star linoyts HF Staff commited on
Commit
0577d13
·
verified ·
1 Parent(s): 06cd3be

change gpu duration calculation to dynamically adapt to the number of inference steps (#1)

Browse files

- change gpu duration calculation to dynamically adapt to the number of inference steps (30cdb92602b846b583c0780733d259974c0a50a0)


Co-authored-by: Linoy Tsaban <[email protected]>

Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -84,12 +84,10 @@ def get_duration(input_image, prompt, height, width,
84
  guidance_scale, steps,
85
  seed, randomize_seed,
86
  progress):
87
- if steps > 4 and duration_seconds > 2:
88
- return 90
89
- elif steps > 4 or duration_seconds > 2:
90
- return 75
91
  else:
92
- return 60
93
 
94
  @spaces.GPU(duration=get_duration)
95
  def generate_video(input_image, prompt, height, width,
 
84
  guidance_scale, steps,
85
  seed, randomize_seed,
86
  progress):
87
+ if duration_seconds <= 2.5
88
+ return steps * 18
 
 
89
  else:
90
+ return steps * 25
91
 
92
  @spaces.GPU(duration=get_duration)
93
  def generate_video(input_image, prompt, height, width,