Spaces:
Sleeping
Sleeping
import streamlit as st | |
import time | |
from PIL import Image | |
st.set_page_config( | |
page_title="MeiGen-MultiTalk Demo", | |
page_icon="π¬", | |
layout="centered" | |
) | |
def process_inputs(image, audio, prompt): | |
"""Process the inputs and return a result""" | |
if image is None: | |
return "β Please upload an image" | |
if audio is None: | |
return "β Please upload an audio file" | |
if not prompt: | |
return "β Please enter a prompt" | |
# Simulate processing | |
with st.spinner("Processing..."): | |
time.sleep(2) | |
return f"""β Video generation request processed! | |
**Input received:** | |
- Image: β Uploaded ({image.size} pixels) | |
- Audio: β Uploaded | |
- Prompt: {prompt} | |
**Note:** This is a demo interface. The actual video generation would require: | |
1. Loading the MeiGen-MultiTalk model | |
2. Processing the input image and audio | |
3. Generating the video using the model | |
4. Returning the generated video file | |
The model files are not included in this demo due to size constraints. | |
Ready for implementation! π¬""" | |
# Main app | |
st.title("π¬ MeiGen-MultiTalk Demo") | |
st.markdown("Generate talking videos from images and audio using AI") | |
# Create columns for layout | |
col1, col2 = st.columns(2) | |
with col1: | |
st.header("π Input Files") | |
# Image upload | |
uploaded_image = st.file_uploader( | |
"Choose a reference image", | |
type=['png', 'jpg', 'jpeg'], | |
help="Upload a clear, front-facing photo" | |
) | |
if uploaded_image is not None: | |
image = Image.open(uploaded_image) | |
st.image(image, caption="Uploaded Image", use_column_width=True) | |
# Audio upload | |
uploaded_audio = st.file_uploader( | |
"Choose an audio file", | |
type=['mp3', 'wav', 'ogg'], | |
help="Upload clear audio without background noise" | |
) | |
if uploaded_audio is not None: | |
st.audio(uploaded_audio, format='audio/wav') | |
# Prompt input | |
prompt = st.text_area( | |
"Enter a prompt", | |
value="A person talking", | |
placeholder="Describe the desired video...", | |
help="Be specific about the desired talking style" | |
) | |
with col2: | |
st.header("π₯ Results") | |
if st.button("π¬ Generate Video", type="primary"): | |
if uploaded_image is not None and uploaded_audio is not None and prompt: | |
result = process_inputs( | |
Image.open(uploaded_image), | |
uploaded_audio, | |
prompt | |
) | |
st.success("Processing complete!") | |
st.text_area("Generation Log", result, height=300) | |
else: | |
st.error("Please upload both image and audio files, and enter a prompt") | |
# Tips section | |
st.markdown("---") | |
st.markdown("### π Tips for Best Results") | |
st.markdown(""" | |
- **Image**: Use clear, front-facing photos with good lighting | |
- **Audio**: Ensure clean audio without background noise | |
- **Prompt**: Be specific about the desired talking style | |
- **Format**: Supported image formats: PNG, JPG, JPEG | |
- **Audio**: Supported audio formats: MP3, WAV, OGG | |
""") | |
st.markdown("---") | |
st.markdown("*This is a demo interface ready for model integration.*") | |
# Minimal test version |