Haoxin Chen commited on
Commit
4df5632
1 Parent(s): a67d617

update empty_cache

Browse files
Files changed (3) hide show
  1. app.py +3 -2
  2. i2v_test.py +1 -0
  3. t2v_test.py +1 -0
app.py CHANGED
@@ -41,7 +41,8 @@ def videocrafter_demo(result_dir='./tmp/'):
41
  fps = gr.Slider(minimum=4, maximum=32, step=1, label='fps', value=16, elem_id="fps")
42
  send_btn = gr.Button("Send")
43
  with gr.Tab(label='result'):
44
- output_video_1 = gr.Video().style(width=320)
 
45
  gr.Examples(examples=t2v_examples,
46
  inputs=[input_text,steps,cfg_scale,eta],
47
  outputs=[output_video_1],
@@ -71,7 +72,7 @@ def videocrafter_demo(result_dir='./tmp/'):
71
  i2v_end_btn = gr.Button("Send")
72
  with gr.Tab(label='Result'):
73
  with gr.Row():
74
- i2v_output_video = gr.Video(label="Generated Video").style(width=320)
75
 
76
  gr.Examples(examples=i2v_examples,
77
  inputs=[i2v_input_image, i2v_input_text, i2v_steps, i2v_cfg_scale, i2v_eta, i2v_fps],
 
41
  fps = gr.Slider(minimum=4, maximum=32, step=1, label='fps', value=16, elem_id="fps")
42
  send_btn = gr.Button("Send")
43
  with gr.Tab(label='result'):
44
+ with gr.Row():
45
+ output_video_1 = gr.Video().style(width=512)
46
  gr.Examples(examples=t2v_examples,
47
  inputs=[input_text,steps,cfg_scale,eta],
48
  outputs=[output_video_1],
 
72
  i2v_end_btn = gr.Button("Send")
73
  with gr.Tab(label='Result'):
74
  with gr.Row():
75
+ i2v_output_video = gr.Video(label="Generated Video").style(width=512)
76
 
77
  gr.Examples(examples=i2v_examples,
78
  inputs=[i2v_input_image, i2v_input_text, i2v_steps, i2v_cfg_scale, i2v_eta, i2v_fps],
i2v_test.py CHANGED
@@ -30,6 +30,7 @@ class Image2Video():
30
  self.save_fps = 8
31
 
32
  def get_image(self, image, prompt, steps=50, cfg_scale=12.0, eta=1.0, fps=16):
 
33
  gpu_id=0
34
  if steps > 60:
35
  steps = 60
 
30
  self.save_fps = 8
31
 
32
  def get_image(self, image, prompt, steps=50, cfg_scale=12.0, eta=1.0, fps=16):
33
+ torch.cuda.empty_cache()
34
  gpu_id=0
35
  if steps > 60:
36
  steps = 60
t2v_test.py CHANGED
@@ -28,6 +28,7 @@ class Text2Video():
28
  self.save_fps = 8
29
 
30
  def get_prompt(self, prompt, steps=50, cfg_scale=12.0, eta=1.0, fps=16):
 
31
  gpu_id=0
32
  if steps > 60:
33
  steps = 60
 
28
  self.save_fps = 8
29
 
30
  def get_prompt(self, prompt, steps=50, cfg_scale=12.0, eta=1.0, fps=16):
31
+ torch.cuda.empty_cache()
32
  gpu_id=0
33
  if steps > 60:
34
  steps = 60