import gradio as gr from PIL import Image # Summary and video URL summary = """In a quaint village surrounded by rolling hills, young Tom struggled with the tough soil in his family's garden. One day, a peddler arrived selling various items, including magical seeds. Tom purchased a packet and planted them in his garden. To everyone's surprise, the seeds grew into vibrant and lush plants, transforming the barren garden into a wonder. The remarkable growth of these plants brought the community together, with neighbors sharing seeds and gardening tips. Inspired by the peddler, Tom later became a peddler himself, spreading joy and community spirit by selling magic seeds to other villages. Tom's story became a symbol of how small acts of kindness and curiosity can lead to widespread beauty and unity.""" # Replace 'story_image.jpg' with the actual filename of the uploaded image image_path = "story_image.jpg" video_url = "https://ai.invideo.io/watch/nSqTRdL6O2D" # Function to load image def load_image(path): img = Image.open(path) return img # Gradio interface with gr.Blocks() as demo: gr.Markdown("# The Peddler's Magic Seeds - Summary and Video") # Display the story summary gr.Markdown("### Story Summary") gr.Markdown(summary) # Display the story image gr.Markdown("### Story Image") story_image = load_image(image_path) gr.Image(story_image) # Display the video gr.Markdown("### Watch the Story Video") video_html = f'' gr.HTML(video_html) demo.launch()