Spaces:
Runtime error
Runtime error
import gradio as gr | |
def create_demo(get_video_control): | |
block = gr.Blocks(css='style.css').queue() | |
with block: | |
with gr.Group(): | |
prompt = gr.Text( | |
label='Prompt', | |
show_label=False, | |
max_lines=1, | |
placeholder='Enter your prompt', | |
elem_id='prompt-text-input').style(container=False) | |
input_video = gr.Video(label='Input Video') | |
run_button = gr.Button('Generate video') | |
result = gr.Video(label='Result', show_label=False, elem_id='gallery') | |
with gr.Accordion('Advanced options', open=False): | |
seed = gr.Slider( | |
label='Seed', | |
minimum=-1, | |
maximum=1000000, | |
step=1, | |
value=-1, | |
info='If set to -1, a different seed will be used each time.') | |
sampling_steps = gr.Slider(label='Number of sampling steps', | |
minimum=10, | |
maximum=100, | |
step=5, | |
value=50) | |
inputs = [ | |
prompt, | |
input_video, | |
seed, | |
sampling_steps | |
# num_frames, | |
# num_inference_steps, | |
] | |
gr.Examples(examples=[ | |
], | |
inputs=inputs, | |
outputs=result, | |
fn=get_video_control, | |
cache_examples=True) | |
prompt.submit(fn=get_video_control, inputs=inputs, outputs=result) | |
run_button.click(fn=get_video_control, inputs=inputs, outputs=result) | |
return block |