bori0824's picture
Update app.py
bc39a69 verified
raw
history blame contribute delete
717 Bytes
import gradio as gr
from PIL import Image
# Function to display the image
def show_image():
image = Image.open('the_peddlers_magic_seeds.jpg') # Ensure this image is in the repository
return image
# Gradio interface
title_button = gr.Button("The Peddler's Magic Seeds")
image_output = gr.Image()
def display_image():
return show_image()
with gr.Blocks() as demo:
gr.Markdown("""
<h1 style='text-decoration: underline; cursor: pointer;'>The Peddler's Magic Seeds</h1>
<p>Click the title of the story below to look at the image.</p>
""")
title_button.render()
title_button.click(display_image, inputs=None, outputs=image_output)
image_output.render()
demo.launch()