Spaces:
Runtime error
Runtime error
RamAnanth1
commited on
Commit
β’
42eaaf0
1
Parent(s):
2317f16
Create gradio_videolora.py
Browse files- gradio_videolora.py +56 -0
gradio_videolora.py
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def create_demo(get_video_lora):
|
4 |
+
block = gr.Blocks(css='style.css').queue()
|
5 |
+
with block:
|
6 |
+
with gr.Group():
|
7 |
+
with gr.Box():
|
8 |
+
with gr.Row(elem_id='prompt-container').style(equal_height=True):
|
9 |
+
prompt = gr.Text(
|
10 |
+
label='Prompt',
|
11 |
+
show_label=False,
|
12 |
+
max_lines=1,
|
13 |
+
placeholder='Enter your prompt',
|
14 |
+
elem_id='prompt-text-input').style(container=False)
|
15 |
+
run_button = gr.Button('Generate video').style(
|
16 |
+
full_width=False)
|
17 |
+
result = gr.Video(label='Result', show_label=False, elem_id='gallery')
|
18 |
+
with gr.Accordion('Advanced options', open=False):
|
19 |
+
seed = gr.Slider(
|
20 |
+
label='Seed',
|
21 |
+
minimum=-1,
|
22 |
+
maximum=1000000,
|
23 |
+
step=1,
|
24 |
+
value=-1,
|
25 |
+
info='If set to -1, a different seed will be used each time.')
|
26 |
+
# num_frames = gr.Slider(
|
27 |
+
# label='Number of frames',
|
28 |
+
# minimum=16,
|
29 |
+
# maximum=MAX_NUM_FRAMES,
|
30 |
+
# step=1,
|
31 |
+
# value=16,
|
32 |
+
# info=
|
33 |
+
# 'Note that the content of the video also changes when you change the number of frames.'
|
34 |
+
# )
|
35 |
+
# num_inference_steps = gr.Slider(label='Number of inference steps',
|
36 |
+
# minimum=10,
|
37 |
+
# maximum=50,
|
38 |
+
# step=1,
|
39 |
+
# value=25)
|
40 |
+
|
41 |
+
inputs = [
|
42 |
+
prompt,
|
43 |
+
seed,
|
44 |
+
# num_frames,
|
45 |
+
# num_inference_steps,
|
46 |
+
]
|
47 |
+
gr.Examples(examples=[["A monkey is playing a piano, frozenmovie style", 431]],
|
48 |
+
inputs=inputs,
|
49 |
+
outputs=result,
|
50 |
+
fn=get_video_lora,
|
51 |
+
cache_examples=True)
|
52 |
+
|
53 |
+
prompt.submit(fn=get_video_lora, inputs=inputs, outputs=result)
|
54 |
+
run_button.click(fn=get_video_lora, inputs=inputs, outputs=result)
|
55 |
+
|
56 |
+
return block
|