xinyuanc91 commited on
Commit
083293a
Β·
1 Parent(s): 676a71f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -22,9 +22,9 @@ h1 {
22
  }
23
  """
24
 
25
- def infer(prompt, image_inp, seed_inp, ddim_steps,width,height):
26
  setup_seed(seed_inp)
27
- args.num_sampling_steps = ddim_steps
28
  img = cv2.imread(image_inp)
29
  new_size = [height,width]
30
  args.image_size = new_size
@@ -106,12 +106,12 @@ with gr.Blocks(css='style.css') as demo:
106
 
107
  with gr.Row():
108
  # control_task = gr.Dropdown(label="Task", choices=["Text-2-video", "Image-2-video"], value="Text-2-video", multiselect=False, elem_id="controltask-in")
109
- ddim_steps = gr.Slider(label='Steps', minimum=50, maximum=300, value=250, step=1)
110
  seed_inp = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, value=250, elem_id="seed-in")
111
  with gr.Row():
112
  width = gr.Slider(label='width',minimum=1,maximum=2000,value=512,step=1)
113
  height = gr.Slider(label='height',minimum=1,maximum=2000,value=320,step=1)
114
- # ddim_steps = gr.Slider(label='Steps', minimum=50, maximum=300, value=250, step=1)
115
 
116
 
117
 
@@ -119,14 +119,14 @@ with gr.Blocks(css='style.css') as demo:
119
  # clean_btn = gr.Button("Clean video")
120
 
121
  video_out = gr.Video(label="Video result", elem_id="video-output", width = 800)
122
- inputs = [prompt,image_inp, seed_inp, ddim_steps,width,height]
123
  outputs = [video_out]
124
  ex = gr.Examples(
125
- examples = [["./The_picture_shows_the_beauty_of_the_sea_.jpg","A video of the beauty of the sea",123,250,560,240],
126
- ["./The_picture_shows_the_beauty_of_the_sea.png","A video of the beauty of the sea",123,250,560,240],
127
  ["./Close-up_essence_is_poured_from_bottleKodak_Vision.png","A video of close-up essence is poured from bottleKodak Vision",123,250,560,240]],
128
  fn = infer,
129
- inputs = [image_inp, prompt, seed_inp, ddim_steps,width,height],
130
  outputs=[video_out],
131
  cache_examples=False
132
 
 
22
  }
23
  """
24
 
25
+ def infer(prompt, image_inp, seed_inp, sampling_steps,width,height):
26
  setup_seed(seed_inp)
27
+ args.num_sampling_steps = sampling_steps
28
  img = cv2.imread(image_inp)
29
  new_size = [height,width]
30
  args.image_size = new_size
 
106
 
107
  with gr.Row():
108
  # control_task = gr.Dropdown(label="Task", choices=["Text-2-video", "Image-2-video"], value="Text-2-video", multiselect=False, elem_id="controltask-in")
109
+ sampling_steps = gr.Slider(label='Steps', minimum=50, maximum=300, value=250, step=1)
110
  seed_inp = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, value=250, elem_id="seed-in")
111
  with gr.Row():
112
  width = gr.Slider(label='width',minimum=1,maximum=2000,value=512,step=1)
113
  height = gr.Slider(label='height',minimum=1,maximum=2000,value=320,step=1)
114
+ # sampling_steps = gr.Slider(label='Steps', minimum=50, maximum=300, value=250, step=1)
115
 
116
 
117
 
 
119
  # clean_btn = gr.Button("Clean video")
120
 
121
  video_out = gr.Video(label="Video result", elem_id="video-output", width = 800)
122
+ inputs = [prompt,image_inp, seed_inp, sampling_steps,width,height]
123
  outputs = [video_out]
124
  ex = gr.Examples(
125
+ examples = [["./input/i2v/The_picture_shows_the_beauty_of_the_sea_and_at_the_same.png","A video of the beauty of the sea",123,250,560,240],
126
+ ["./The_picture_shows_the_beauty_of_the_sea.png","A video of the beauty of the sea",14717,250,560,240],
127
  ["./Close-up_essence_is_poured_from_bottleKodak_Vision.png","A video of close-up essence is poured from bottleKodak Vision",123,250,560,240]],
128
  fn = infer,
129
+ inputs = [image_inp, prompt, seed_inp, sampling_steps,width,height],
130
  outputs=[video_out],
131
  cache_examples=False
132