SahaniJi commited on
Commit
a6977ca
·
verified ·
1 Parent(s): 9809882

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
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.Group():
90
- with gr.Row():
91
- prompt = gr.Textbox(label='Prompt', elem_id="gr-input", placeholder="Enter text to generate video...")
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
- submit = gr.Button("Generate Video", variant='primary', elem_id="gr-button")
125
- video = gr.Video(label='AnimateDiff-Lightning', autoplay=True, height=512, width=512, elem_id="gr-video")
 
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")