Kvikontent commited on
Commit
87048a2
·
1 Parent(s): 08164b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -1,5 +1,8 @@
1
  import streamlit as st
2
  import replicate
 
 
 
3
 
4
  # Set the replicate API token
5
  import os
@@ -18,7 +21,7 @@ st.write("Fill in the input parameters and click on the button to run the Stable
18
  cond_aug = st.number_input("Conditioning Augmentation", value=0.02)
19
  decoding_t = st.number_input("Decoding Time", value=7)
20
  input_image = st.text_input("Input Image URL", "https://example.com/s-widua-icjKmXvsO7U-unsplash.jpg")
21
- video_length = st.selectbox("Video Length", ["14_frames_with_svd", "other_options"])
22
  sizing_strategy = st.selectbox("Sizing Strategy", ["maintain_aspect_ratio", "other_options"])
23
  motion_bucket_id = st.number_input("Motion Bucket ID", value=127)
24
  frames_per_second = st.number_input("Frames Per Second", value=6)
@@ -35,5 +38,11 @@ input_params = {
35
 
36
  if st.button("Run Model"):
37
  output_result = run_replicate_model(input_params)
38
- st.write("Output:")
39
- st.code(output_result, language="json")
 
 
 
 
 
 
 
1
  import streamlit as st
2
  import replicate
3
+ import requests
4
+ from PIL import Image
5
+ from io import BytesIO
6
 
7
  # Set the replicate API token
8
  import os
 
21
  cond_aug = st.number_input("Conditioning Augmentation", value=0.02)
22
  decoding_t = st.number_input("Decoding Time", value=7)
23
  input_image = st.text_input("Input Image URL", "https://example.com/s-widua-icjKmXvsO7U-unsplash.jpg")
24
+ video_length = st.selectbox("Video Length", ["14_frames_with_svd", "25_frames_with_svd_xt"])
25
  sizing_strategy = st.selectbox("Sizing Strategy", ["maintain_aspect_ratio", "other_options"])
26
  motion_bucket_id = st.number_input("Motion Bucket ID", value=127)
27
  frames_per_second = st.number_input("Frames Per Second", value=6)
 
38
 
39
  if st.button("Run Model"):
40
  output_result = run_replicate_model(input_params)
41
+ st.write("Output Video:")
42
+
43
+ try:
44
+ response = requests.get(output_result)
45
+ video_bytes = BytesIO(response.content)
46
+ st.video(video_bytes)
47
+ except Exception as e:
48
+ st.write("Unable to display the video.")