Spaces:
Running
Running
This PR automatically plays the output
#54
by
Fabrice-TIERCELIN
- opened
app.py
CHANGED
@@ -152,8 +152,11 @@ threading.Thread(target=delete_old_files, daemon=True).start()
|
|
152 |
|
153 |
with gr.Blocks() as demo:
|
154 |
gr.Markdown("""
|
155 |
-
<div style="text-align: center; font-size: 32px; font-weight: bold; margin-bottom:
|
156 |
-
CogVideoX-2B
|
|
|
|
|
|
|
157 |
</div>
|
158 |
<div style="text-align: center;">
|
159 |
<a href="https://huggingface.co/THUDM/CogVideoX-2b">🤗 Model Hub</a> |
|
@@ -167,23 +170,23 @@ with gr.Blocks() as demo:
|
|
167 |
""")
|
168 |
with gr.Row():
|
169 |
with gr.Column():
|
170 |
-
prompt = gr.Textbox(label="Prompt (
|
171 |
with gr.Row():
|
172 |
gr.Markdown(
|
173 |
"✨Upon pressing the enhanced prompt button, we will use [GLM-4 Model](https://github.com/THUDM/GLM-4) to polish the prompt and overwrite the original one.")
|
174 |
-
enhance_button = gr.Button("✨ Enhance Prompt(
|
175 |
|
176 |
with gr.Column():
|
177 |
gr.Markdown("**Optional Parameters** (default values are recommended)<br>"
|
178 |
"Turn Inference Steps larger if you want more detailed video, but it will be slower.<br>"
|
179 |
-
"50 steps are recommended for most cases.
|
180 |
with gr.Row():
|
181 |
num_inference_steps = gr.Number(label="Inference Steps", value=50)
|
182 |
guidance_scale = gr.Number(label="Guidance Scale", value=6.0)
|
183 |
-
generate_button = gr.Button("🎬 Generate Video")
|
184 |
|
185 |
with gr.Column():
|
186 |
-
video_output = gr.Video(label="CogVideoX Generate Video", width=720, height=480)
|
187 |
with gr.Row():
|
188 |
download_video_button = gr.File(label="📥 Download Video", visible=False)
|
189 |
download_gif_button = gr.File(label="📥 Download GIF", visible=False)
|
|
|
152 |
|
153 |
with gr.Blocks() as demo:
|
154 |
gr.Markdown("""
|
155 |
+
<div style="text-align: center; font-size: 32px; font-weight: bold; margin-bottom: 10px;">
|
156 |
+
CogVideoX-2B
|
157 |
+
</div>
|
158 |
+
<div style="text-align: center; margin-bottom: 20px;">
|
159 |
+
Generates a 720x480 video of 50 frames based on your description
|
160 |
</div>
|
161 |
<div style="text-align: center;">
|
162 |
<a href="https://huggingface.co/THUDM/CogVideoX-2b">🤗 Model Hub</a> |
|
|
|
170 |
""")
|
171 |
with gr.Row():
|
172 |
with gr.Column():
|
173 |
+
prompt = gr.Textbox(label="Prompt (less than 200 words)", placeholder="Enter your prompt here", lines=5)
|
174 |
with gr.Row():
|
175 |
gr.Markdown(
|
176 |
"✨Upon pressing the enhanced prompt button, we will use [GLM-4 Model](https://github.com/THUDM/GLM-4) to polish the prompt and overwrite the original one.")
|
177 |
+
enhance_button = gr.Button("✨ Enhance Prompt (optional)")
|
178 |
|
179 |
with gr.Column():
|
180 |
gr.Markdown("**Optional Parameters** (default values are recommended)<br>"
|
181 |
"Turn Inference Steps larger if you want more detailed video, but it will be slower.<br>"
|
182 |
+
"50 steps are recommended for most cases. Will cause 120 seconds for inference.<br>")
|
183 |
with gr.Row():
|
184 |
num_inference_steps = gr.Number(label="Inference Steps", value=50)
|
185 |
guidance_scale = gr.Number(label="Guidance Scale", value=6.0)
|
186 |
+
generate_button = gr.Button("🎬 Generate Video", variant="primary")
|
187 |
|
188 |
with gr.Column():
|
189 |
+
video_output = gr.Video(label="CogVideoX Generate Video", width=720, height=480, autoplay=True)
|
190 |
with gr.Row():
|
191 |
download_video_button = gr.File(label="📥 Download Video", visible=False)
|
192 |
download_gif_button = gr.File(label="📥 Download GIF", visible=False)
|