Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -167,7 +167,7 @@ def generate_random_string(length):
|
|
167 |
characters = str(ascii_letters + digits)
|
168 |
return ''.join(random.choice(characters) for _ in range(length))
|
169 |
|
170 |
-
def pipe_generate(img,p1,p2,
|
171 |
global last_motion
|
172 |
global pipe
|
173 |
|
@@ -235,8 +235,8 @@ def handle_generate(*_inp):
|
|
235 |
|
236 |
pipe_out = pipe_generate(*inp)
|
237 |
|
238 |
-
name = generate_random_string(12) + ( ".png" if inp[
|
239 |
-
if inp[
|
240 |
pipe_out.save(name)
|
241 |
else:
|
242 |
export_to_video(pipe_out,name,fps=fps)
|
@@ -295,7 +295,7 @@ def ui():
|
|
295 |
prompt2.submit
|
296 |
],
|
297 |
fn=handle_generate,
|
298 |
-
inputs=[img,prompt,prompt2,
|
299 |
outputs=[res_img,res_vid]
|
300 |
)
|
301 |
demo.queue().launch()
|
|
|
167 |
characters = str(ascii_letters + digits)
|
168 |
return ''.join(random.choice(characters) for _ in range(length))
|
169 |
|
170 |
+
def pipe_generate(img,p1,p2,time,title):
|
171 |
global last_motion
|
172 |
global pipe
|
173 |
|
|
|
235 |
|
236 |
pipe_out = pipe_generate(*inp)
|
237 |
|
238 |
+
name = generate_random_string(12) + ( ".png" if inp[3] == 0 else ".mp4" )
|
239 |
+
if inp[3] == 0.0:
|
240 |
pipe_out.save(name)
|
241 |
else:
|
242 |
export_to_video(pipe_out,name,fps=fps)
|
|
|
295 |
prompt2.submit
|
296 |
],
|
297 |
fn=handle_generate,
|
298 |
+
inputs=[img,prompt,prompt2,time,title],
|
299 |
outputs=[res_img,res_vid]
|
300 |
)
|
301 |
demo.queue().launch()
|