File size: 717 Bytes
40fd9d0 dbdd424 40fd9d0 dbdd424 1b1fd4f bc39a69 1b1fd4f dbdd424 |
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 |
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()
|