Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -61,8 +61,12 @@ def get_duration(prompt, height, width, negative_prompt, duration_seconds, guida
|
|
61 |
|
62 |
# Gradio inference function with spaces GPU decorator
|
63 |
@spaces.GPU(duration=get_duration)
|
64 |
-
def generate_video(prompt, height, width, negative_prompt, duration_seconds,
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
current_seed = random.randint(0, MAX_SEED) if randomize_seed else int(seed)
|
67 |
|
68 |
output_frames_list = pipe(
|
@@ -81,8 +85,8 @@ def generate_video(prompt, height, width, negative_prompt, duration_seconds, gui
|
|
81 |
|
82 |
export_to_video(output_frames_list, video_path, fps=FIXED_FPS)
|
83 |
|
84 |
-
|
85 |
-
|
86 |
|
87 |
# Build Gradio UI with all parameters
|
88 |
with gr.Blocks(css="body { max-width: 100vw; overflow-x: hidden; }") as demo:
|
|
|
61 |
|
62 |
# Gradio inference function with spaces GPU decorator
|
63 |
@spaces.GPU(duration=get_duration)
|
64 |
+
def generate_video(prompt, height, width, negative_prompt, duration_seconds,
|
65 |
+
guidance_scale, steps, seed, randomize_seed,
|
66 |
+
progress=gr.Progress(track_tqdm=True)):
|
67 |
+
|
68 |
+
num_frames = np.clip(int(round(duration_seconds * FIXED_FPS)),
|
69 |
+
MIN_FRAMES_MODEL, MAX_FRAMES_MODEL)
|
70 |
current_seed = random.randint(0, MAX_SEED) if randomize_seed else int(seed)
|
71 |
|
72 |
output_frames_list = pipe(
|
|
|
85 |
|
86 |
export_to_video(output_frames_list, video_path, fps=FIXED_FPS)
|
87 |
|
88 |
+
# Return seed as string to avoid TypeError
|
89 |
+
return video_path, str(current_seed)
|
90 |
|
91 |
# Build Gradio UI with all parameters
|
92 |
with gr.Blocks(css="body { max-width: 100vw; overflow-x: hidden; }") as demo:
|