Spaces:
Running
Running
Update
Browse files- app.py +26 -25
- 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.
|
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 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
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.
|
2 |
-
diffusers==0.
|
3 |
-
gradio==
|
4 |
-
huggingface-hub==0.
|
5 |
-
imageio[ffmpeg]==2.
|
6 |
-
spaces==0.
|
7 |
torch==2.0.0
|
8 |
torchvision==0.15.1
|
9 |
-
transformers==4.
|
|
|
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
|