Spaces:
Sleeping
Sleeping
File size: 1,298 Bytes
c582cf1 c02aa1c 732d546 c02aa1c ff60146 c02aa1c c906021 c02aa1c e25cd92 c02aa1c c582cf1 c02aa1c |
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 28 29 30 31 32 33 34 35 36 37 |
import streamlit as st
from text_generation import generate_text
from image_generation import generate_image_from_text
from video_generation import generate_simple_video
from PIL import Image
# Main Streamlit app
st.title("Multifunction AI App")
# Ability Selection
option = st.sidebar.selectbox("Select Functionality", ("Text Generation", "Image Generation", "Video Generation"))
# Text Generation
if option == "Text Generation":
prompt = st.text_area("Input", "Type a prompt for text generation...")
max_length = st.slider("Max Length", min_value=10, max_value=100, value=50)
if st.button("Generate Text"):
generated_text = generate_text(prompt, max_length)
st.subheader("Generated Text")
st.write(generated_text)
# Image Generation
elif option == "Image Generation":
prompt = st.text_area("Input", "Type a prompt for image generation...")
if st.button("Generate Image"):
image = generate_image_from_text(prompt)
st.image(image, caption="Generated Image", use_column_width=True)
# Video Generation
elif option == "Video Generation":
prompt = st.text_area("Input", "Type a prompt for video generation...")
if st.button("Generate Video"):
video_path = generate_simple_video(prompt)
st.video(video_path) |