Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -334,7 +334,7 @@ logger.info("Manual diff_b/diff patches applied.")
|
|
334 |
|
335 |
# --- Gradio Interface Function ---
|
336 |
@spaces.GPU
|
337 |
-
def generate_video(prompt, negative_prompt, height, width, num_frames, guidance_scale, fps):
|
338 |
logger.info("Starting video generation...")
|
339 |
logger.info(f" Prompt: {prompt}")
|
340 |
logger.info(f" Negative Prompt: {negative_prompt if negative_prompt else 'None'}")
|
@@ -355,6 +355,7 @@ def generate_video(prompt, negative_prompt, height, width, num_frames, guidance_
|
|
355 |
width=width,
|
356 |
num_frames=num_frames,
|
357 |
guidance_scale=float(guidance_scale),
|
|
|
358 |
).frames
|
359 |
|
360 |
if not output_frames_list or not output_frames_list[0]:
|
@@ -393,6 +394,7 @@ with gr.Blocks() as demo:
|
|
393 |
with gr.Row():
|
394 |
num_frames_input = gr.Slider(minimum=16, maximum=100, step=1, value=25, label="Number of Frames") # Reduced default for faster demo
|
395 |
fps_input = gr.Slider(minimum=5, maximum=30, step=1, value=15, label="Output FPS")
|
|
|
396 |
guidance_scale_input = gr.Slider(minimum=1.0, maximum=20.0, step=0.5, value=5.0, label="Guidance Scale")
|
397 |
|
398 |
generate_button = gr.Button("Generate Video", variant="primary")
|
@@ -416,12 +418,12 @@ with gr.Blocks() as demo:
|
|
416 |
|
417 |
gr.Examples(
|
418 |
examples=[
|
419 |
-
["A panda eating bamboo in a lush forest, cinematic lighting", default_negative_prompt, 480, 832, 25, 5.0, 15],
|
420 |
-
["A majestic eagle soaring over snowy mountains", default_negative_prompt, 512, 768, 30, 7.0, 12],
|
421 |
-
["Timelapse of a flower blooming, vibrant colors", "static, ugly", 384, 640, 40, 6.0, 20],
|
422 |
-
["Astronaut walking on the moon, Earth in the background, highly detailed", default_negative_prompt, 480, 832, 20, 5.5, 10],
|
423 |
],
|
424 |
-
inputs=[prompt_input, negative_prompt_input, height_input, width_input, num_frames_input, guidance_scale_input, fps_input],
|
425 |
outputs=video_output,
|
426 |
fn=generate_video,
|
427 |
cache_examples=False
|
|
|
334 |
|
335 |
# --- Gradio Interface Function ---
|
336 |
@spaces.GPU
|
337 |
+
def generate_video(prompt, negative_prompt, height, width, num_frames, guidance_scale, steps, fps):
|
338 |
logger.info("Starting video generation...")
|
339 |
logger.info(f" Prompt: {prompt}")
|
340 |
logger.info(f" Negative Prompt: {negative_prompt if negative_prompt else 'None'}")
|
|
|
355 |
width=width,
|
356 |
num_frames=num_frames,
|
357 |
guidance_scale=float(guidance_scale),
|
358 |
+
num_inference_steps=steps
|
359 |
).frames
|
360 |
|
361 |
if not output_frames_list or not output_frames_list[0]:
|
|
|
394 |
with gr.Row():
|
395 |
num_frames_input = gr.Slider(minimum=16, maximum=100, step=1, value=25, label="Number of Frames") # Reduced default for faster demo
|
396 |
fps_input = gr.Slider(minimum=5, maximum=30, step=1, value=15, label="Output FPS")
|
397 |
+
steps = gr.Slider(minimum=1.0, maximum=30.0, value=4.0, label="Steps")
|
398 |
guidance_scale_input = gr.Slider(minimum=1.0, maximum=20.0, step=0.5, value=5.0, label="Guidance Scale")
|
399 |
|
400 |
generate_button = gr.Button("Generate Video", variant="primary")
|
|
|
418 |
|
419 |
gr.Examples(
|
420 |
examples=[
|
421 |
+
["A panda eating bamboo in a lush forest, cinematic lighting", default_negative_prompt, 480, 832, 25, 5.0, 4, 15],
|
422 |
+
["A majestic eagle soaring over snowy mountains", default_negative_prompt, 512, 768, 30, 7.0, 4, 12],
|
423 |
+
["Timelapse of a flower blooming, vibrant colors", "static, ugly", 384, 640, 40, 6.0, 4, 20],
|
424 |
+
["Astronaut walking on the moon, Earth in the background, highly detailed", default_negative_prompt, 480, 832, 20, 5.5, 4, 10],
|
425 |
],
|
426 |
+
inputs=[prompt_input, negative_prompt_input, height_input, width_input, num_frames_input, guidance_scale_input, steps, fps_input],
|
427 |
outputs=video_output,
|
428 |
fn=generate_video,
|
429 |
cache_examples=False
|