Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,14 +82,23 @@ css = """
|
|
| 82 |
.gr-video {margin-top: 20px;}
|
| 83 |
.gr-examples {margin-top: 30px;}
|
| 84 |
.gr-examples .gr-example {display: inline-block; width: 100%; text-align: center; padding: 10px; background: #eaeaea; border-radius: 5px; margin-bottom: 10px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
"""
|
| 86 |
|
| 87 |
with gr.Blocks(css=css) as demo:
|
| 88 |
gr.HTML("<h1>Instant⚡ Text to Video</h1>")
|
| 89 |
-
with gr.
|
| 90 |
-
with gr.
|
| 91 |
-
prompt = gr.Textbox(label='Prompt',
|
| 92 |
-
with gr.Row():
|
| 93 |
select_base = gr.Dropdown(
|
| 94 |
label='Base model',
|
| 95 |
choices=["Cartoon", "Realistic", "3d", "Anime"],
|
|
@@ -121,8 +130,9 @@ with gr.Blocks(css=css) as demo:
|
|
| 121 |
interactive=True,
|
| 122 |
elem_id="gr-input"
|
| 123 |
)
|
| 124 |
-
|
| 125 |
-
|
|
|
|
| 126 |
|
| 127 |
prompt.submit(fn=generate_image, inputs=[prompt, select_base, select_motion, select_step], outputs=video)
|
| 128 |
submit.click(fn=generate_image, inputs=[prompt, select_base, select_motion, select_step], outputs=video, api_name="instant_video")
|
|
|
|
| 82 |
.gr-video {margin-top: 20px;}
|
| 83 |
.gr-examples {margin-top: 30px;}
|
| 84 |
.gr-examples .gr-example {display: inline-block; width: 100%; text-align: center; padding: 10px; background: #eaeaea; border-radius: 5px; margin-bottom: 10px;}
|
| 85 |
+
|
| 86 |
+
.container {display: flex; flex-wrap: wrap;}
|
| 87 |
+
.inputs, .output {padding: 20px;}
|
| 88 |
+
.inputs {flex: 1; min-width: 300px;}
|
| 89 |
+
.output {flex: 1; min-width: 300px;}
|
| 90 |
+
|
| 91 |
+
@media (max-width: 768px) {
|
| 92 |
+
.container {flex-direction: column-reverse;}
|
| 93 |
+
}
|
| 94 |
+
.svelte-1ybb3u7, .svelte-1clup3e {display: none !important;}
|
| 95 |
"""
|
| 96 |
|
| 97 |
with gr.Blocks(css=css) as demo:
|
| 98 |
gr.HTML("<h1>Instant⚡ Text to Video</h1>")
|
| 99 |
+
with gr.Row(elem_id="container"):
|
| 100 |
+
with gr.Column(elem_id="inputs"):
|
| 101 |
+
prompt = gr.Textbox(label='Prompt', placeholder="Enter text to generate video...", elem_id="gr-input")
|
|
|
|
| 102 |
select_base = gr.Dropdown(
|
| 103 |
label='Base model',
|
| 104 |
choices=["Cartoon", "Realistic", "3d", "Anime"],
|
|
|
|
| 130 |
interactive=True,
|
| 131 |
elem_id="gr-input"
|
| 132 |
)
|
| 133 |
+
submit = gr.Button("Generate Video", variant='primary', elem_id="gr-button")
|
| 134 |
+
with gr.Column(elem_id="output"):
|
| 135 |
+
video = gr.Video(label='AnimateDiff-Lightning', autoplay=True, height=512, width=512, elem_id="gr-video")
|
| 136 |
|
| 137 |
prompt.submit(fn=generate_image, inputs=[prompt, select_base, select_motion, select_step], outputs=video)
|
| 138 |
submit.click(fn=generate_image, inputs=[prompt, select_base, select_motion, select_step], outputs=video, api_name="instant_video")
|