RamAnanth1 commited on
Commit
9c6d3b9
β€’
1 Parent(s): 1f4dc2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -67
app.py CHANGED
@@ -115,77 +115,16 @@ def get_video(prompt, seed):
115
  )
116
  return save_results(samples)
117
 
 
 
118
  DESCRIPTION = '# [Latent Video Diffusion Models](https://github.com/VideoCrafter/VideoCrafter)'
119
  DESCRIPTION += '\n<p>πŸ€—πŸ€—πŸ€— VideoCrafter is an open-source video generation and editing toolbox for crafting video content. This model can only be used for non-commercial purposes. To learn more about the model, take a look at the <a href="https://github.com/VideoCrafter/VideoCrafter" style="text-decoration: underline;" target="_blank">model card</a>.</p>'
120
 
121
  with gr.Blocks(css='style.css') as demo:
122
  gr.Markdown(DESCRIPTION)
123
- with gr.Group():
124
- with gr.Box():
125
- with gr.Row(elem_id='prompt-container').style(equal_height=True):
126
- prompt = gr.Text(
127
- label='Prompt',
128
- show_label=False,
129
- max_lines=1,
130
- placeholder='Enter your prompt',
131
- elem_id='prompt-text-input').style(container=False)
132
- run_button = gr.Button('Generate video').style(
133
- full_width=False)
134
- result = gr.Video(label='Result', show_label=False, elem_id='gallery')
135
- with gr.Accordion('Advanced options', open=False):
136
- seed = gr.Slider(
137
- label='Seed',
138
- minimum=-1,
139
- maximum=1000000,
140
- step=1,
141
- value=-1,
142
- info='If set to -1, a different seed will be used each time.')
143
- # num_frames = gr.Slider(
144
- # label='Number of frames',
145
- # minimum=16,
146
- # maximum=MAX_NUM_FRAMES,
147
- # step=1,
148
- # value=16,
149
- # info=
150
- # 'Note that the content of the video also changes when you change the number of frames.'
151
- # )
152
- # num_inference_steps = gr.Slider(label='Number of inference steps',
153
- # minimum=10,
154
- # maximum=50,
155
- # step=1,
156
- # value=25)
157
-
158
- inputs = [
159
- prompt,
160
- seed,
161
- # num_frames,
162
- # num_inference_steps,
163
- ]
164
- gr.Examples(examples=[["Astronaut riding a horse", 10431]],
165
- inputs=inputs,
166
- outputs=result,
167
- fn=get_video,
168
- cache_examples=True)
169
-
170
- prompt.submit(fn=get_video, inputs=inputs, outputs=result)
171
- run_button.click(fn=get_video, inputs=inputs, outputs=result)
172
-
173
- # with gr.Accordion(label='Biases and content acknowledgment', open=False):
174
- # gr.HTML("""<div class="acknowledgments">
175
- # <h4>Biases and content acknowledgment</h4>
176
- # <p>
177
- # Despite how impressive being able to turn text into video is, beware to the fact that this model may output content that reinforces or exacerbates societal biases. The training data includes LAION5B, ImageNet, Webvid and other public datasets. The model was not trained to realistically represent people or events, so using it to generate such content is beyond the model's capabilities.
178
- # </p>
179
- # <p>
180
- # It is not intended to generate content that is demeaning or harmful to people or their environment, culture, religion, etc. Similarly, it is not allowed to generate pornographic, violent and bloody content generation. <b>The model is meant for research purposes</b>.
181
- # </p>
182
- # <p>
183
- # To learn more about the model, head to its <a href="https://huggingface.co/damo-vilab/modelscope-damo-text-to-video-synthesis" style="text-decoration: underline;" target="_blank">model card</a>.
184
- # </p>
185
- # </div>
186
- # """)
187
-
188
-
189
- demo.queue(api_open=False, max_size=15).launch()
190
 
 
191
 
 
115
  )
116
  return save_results(samples)
117
 
118
+ from gradio_t2v import create_demo as create_demo_basic
119
+
120
  DESCRIPTION = '# [Latent Video Diffusion Models](https://github.com/VideoCrafter/VideoCrafter)'
121
  DESCRIPTION += '\n<p>πŸ€—πŸ€—πŸ€— VideoCrafter is an open-source video generation and editing toolbox for crafting video content. This model can only be used for non-commercial purposes. To learn more about the model, take a look at the <a href="https://github.com/VideoCrafter/VideoCrafter" style="text-decoration: underline;" target="_blank">model card</a>.</p>'
122
 
123
  with gr.Blocks(css='style.css') as demo:
124
  gr.Markdown(DESCRIPTION)
125
+ with gr.Tabs():
126
+ with gr.TabItem('Basic Text2Video'):
127
+ create_demo_basic(get_video)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
+ demo.queue(api_open=False).launch()
130