Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -42,23 +42,21 @@ st.title("Image to Video")
|
|
42 |
|
43 |
file_name = st.file_uploader("Upload an image")
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
col1,
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
)
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
export_to_video(video, "output.mp4", fps=8)
|
|
|
42 |
|
43 |
file_name = st.file_uploader("Upload an image")
|
44 |
|
45 |
+
if file_name is not None:
|
46 |
+
col1, col2 = st.columns(2)
|
47 |
+
image = load_image(image=file_name.name)
|
48 |
+
col1.image(image, use_container_width=True)
|
49 |
+
|
50 |
+
video = pipe(
|
51 |
+
prompt=prompt,
|
52 |
+
image=image,
|
53 |
+
num_videos_per_prompt=1,
|
54 |
+
num_inference_steps=50,
|
55 |
+
num_frames=49,
|
56 |
+
guidance_scale=6,
|
57 |
+
generator=torch.Generator(device="cuda").manual_seed(42),
|
58 |
+
).frames[0]
|
59 |
+
|
60 |
+
col2.video(video, use_container_width=True)
|
61 |
+
|
62 |
+
export_to_video(video, "output.mp4", fps=8)
|
|
|
|