seawolf2357 commited on
Commit
f29d9ae
·
verified ·
1 Parent(s): 305c6a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -162,14 +162,9 @@ def update_dimensions_from_image(image_list):
162
 
163
  return new_width, new_height
164
 
165
- def get_duration(prompt_embeds, image_list, width, height, num_inference_steps, guidance_scale, seed, use_turbo, progress=gr.Progress(track_tqdm=True)):
166
- num_images = 0 if image_list is None else len(image_list)
167
- step_duration = 1 + 0.8 * num_images
168
- if use_turbo:
169
- return max(30, 8 * step_duration + 10)
170
- return max(65, num_inference_steps * step_duration + 10)
171
-
172
- @spaces.GPU(duration=get_duration)
173
  def generate_image(prompt_embeds, image_list, width, height, num_inference_steps, guidance_scale, seed, use_turbo, progress=gr.Progress(track_tqdm=True)):
174
  prompt_embeds = prompt_embeds.to(device)
175
 
 
162
 
163
  return new_width, new_height
164
 
165
+ # ⚠️ spaces.GPU duration은 정수(초)만 가능, 함수는 지원 안됨
166
+ # Turbo 모드: ~30초, Standard 모드: ~65초 안전하게 120초 설정
167
+ @spaces.GPU(duration=120)
 
 
 
 
 
168
  def generate_image(prompt_embeds, image_list, width, height, num_inference_steps, guidance_scale, seed, use_turbo, progress=gr.Progress(track_tqdm=True)):
169
  prompt_embeds = prompt_embeds.to(device)
170