File size: 745 Bytes
52bfca3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# app.py
import streamlit as st
from model import load_pipeline, generate_3d_gif
from PIL import Image

# Load pipeline once when the app starts
pipe = load_pipeline()

st.title("3D Model to GIF Generator")
prompt = st.text_input("Enter a prompt for the 3D model:", "a shark")

if st.button("Generate 3D GIF"):
    with st.spinner("Generating 3D model..."):
        gif_path = generate_3d_gif(pipe, prompt)
        
        # Display the GIF
        st.image(gif_path)
        
        # Provide a download link
        with open(gif_path, "rb") as file:
            st.download_button(
                label="Download GIF",
                data=file,
                file_name="generated_3d.gif",
                mime="image/gif"
            )