hysts HF staff commited on
Commit
87dffe1
1 Parent(s): 6bd54f1
Files changed (2) hide show
  1. app.py +26 -25
  2. requirements.txt +7 -7
app.py CHANGED
@@ -52,6 +52,7 @@ def generate(
52
  seed: int,
53
  num_frames: int,
54
  num_inference_steps: int,
 
55
  ) -> str:
56
  generator = torch.Generator().manual_seed(seed)
57
  frames = pipe(
@@ -78,7 +79,7 @@ with gr.Blocks(css="style.css") as demo:
78
  elem_id="duplicate-button",
79
  visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
80
  )
81
- with gr.Box():
82
  with gr.Row():
83
  prompt = gr.Text(
84
  label="Prompt",
@@ -89,30 +90,30 @@ with gr.Blocks(css="style.css") as demo:
89
  )
90
  run_button = gr.Button("Generate video", scale=0)
91
  result = gr.Video(label="Result", show_label=False)
92
- with gr.Accordion("Advanced options", open=False):
93
- seed = gr.Slider(
94
- label="Seed",
95
- minimum=0,
96
- maximum=MAX_SEED,
97
- step=1,
98
- value=0,
99
- )
100
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
101
- num_frames = gr.Slider(
102
- label="Number of frames",
103
- minimum=24,
104
- maximum=MAX_NUM_FRAMES,
105
- step=1,
106
- value=24,
107
- info="Note that the content of the video also changes when you change the number of frames.",
108
- )
109
- num_inference_steps = gr.Slider(
110
- label="Number of inference steps",
111
- minimum=10,
112
- maximum=50,
113
- step=1,
114
- value=25,
115
- )
116
 
117
  inputs = [
118
  prompt,
 
52
  seed: int,
53
  num_frames: int,
54
  num_inference_steps: int,
55
+ progress=gr.Progress(track_tqdm=True),
56
  ) -> str:
57
  generator = torch.Generator().manual_seed(seed)
58
  frames = pipe(
 
79
  elem_id="duplicate-button",
80
  visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
81
  )
82
+ with gr.Group():
83
  with gr.Row():
84
  prompt = gr.Text(
85
  label="Prompt",
 
90
  )
91
  run_button = gr.Button("Generate video", scale=0)
92
  result = gr.Video(label="Result", show_label=False)
93
+ with gr.Accordion("Advanced options", open=False):
94
+ seed = gr.Slider(
95
+ label="Seed",
96
+ minimum=0,
97
+ maximum=MAX_SEED,
98
+ step=1,
99
+ value=0,
100
+ )
101
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
102
+ num_frames = gr.Slider(
103
+ label="Number of frames",
104
+ minimum=24,
105
+ maximum=MAX_NUM_FRAMES,
106
+ step=1,
107
+ value=24,
108
+ info="Note that the content of the video also changes when you change the number of frames.",
109
+ )
110
+ num_inference_steps = gr.Slider(
111
+ label="Number of inference steps",
112
+ minimum=10,
113
+ maximum=50,
114
+ step=1,
115
+ value=25,
116
+ )
117
 
118
  inputs = [
119
  prompt,
requirements.txt CHANGED
@@ -1,9 +1,9 @@
1
- accelerate==0.23.0
2
- diffusers==0.21.2
3
- gradio==3.45.2
4
- huggingface-hub==0.17.2
5
- imageio[ffmpeg]==2.31.3
6
- spaces==0.15.0
7
  torch==2.0.0
8
  torchvision==0.15.1
9
- transformers==4.33.2
 
1
+ accelerate==0.25.0
2
+ diffusers==0.24.0
3
+ gradio==4.8.0
4
+ huggingface-hub==0.19.4
5
+ imageio[ffmpeg]==2.33.1
6
+ spaces==0.18.0
7
  torch==2.0.0
8
  torchvision==0.15.1
9
+ transformers==4.36.0