Yaron Koresh commited on
Commit
72683cf
·
verified ·
1 Parent(s): 8cf7e8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -52,7 +52,6 @@ adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-
52
  # variable data
53
 
54
  last_motion=""
55
- result = []
56
 
57
  # precision data
58
 
@@ -248,18 +247,14 @@ def handle_generate(*_inp):
248
 
249
  """)
250
 
251
- ln = len(result)
252
- pipe_out = [pipe_generate(*inp) for i in range(ln)]
253
 
254
- names = []
255
- for i in pipe_out:
256
- name = generate_random_string(12) + ( ".png" if time == 0 else ".gif" )
257
- if inp[4] == 0.0:
258
- i.save(name)
259
- else:
260
- export_to_gif(i,name,fps=fps)
261
- names.append( name )
262
- return names
263
 
264
  def ui():
265
  global result
@@ -319,7 +314,7 @@ def ui():
319
  interactive=True
320
  )
321
  with gr.Row():
322
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=True, type='filepath', show_share_button=False))
323
  with gr.Row():
324
  run_button = gr.Button("Start!",elem_classes="btn",scale=0)
325
 
 
52
  # variable data
53
 
54
  last_motion=""
 
55
 
56
  # precision data
57
 
 
247
 
248
  """)
249
 
250
+ pipe_out = pipe_generate(*inp)
 
251
 
252
+ name = generate_random_string(12) + ( ".png" if time == 0 else ".gif" )
253
+ if inp[4] == 0.0:
254
+ pipeout.save(name)
255
+ else:
256
+ export_to_gif(pipeout,name,fps=fps)
257
+ return name
 
 
 
258
 
259
  def ui():
260
  global result
 
314
  interactive=True
315
  )
316
  with gr.Row():
317
+ result = gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=True, type='filepath', show_share_button=False)
318
  with gr.Row():
319
  run_button = gr.Button("Start!",elem_classes="btn",scale=0)
320