Hi
I am running this lab in my MacBook Pro.
After running this piece of code:
import gradio as gr
#A helper function to convert the PIL image to base64
#so you can send it to the API
def base64_to_pil(img_base64):
base64_decoded = base64.b64decode(img_base64)
byte_stream = io.BytesIO(base64_decoded)
pil_image = Image.open(byte_stream)
return pil_image
def generate(prompt):
output = get_completion(prompt)
result_image = base64_to_pil(output)
return result_image
gr.close_all()
demo = gr.Interface(fn=generate,
inputs=[gr.Textbox(label=“Your prompt”)],
outputs=[gr.Image(label=“Result”)],
title=“Image Generation with Stable Diffusion”,
description=“Generate any image with Stable Diffusion”,
allow_flagging=“never”,
examples=[“the spirit of a tamagotchi wandering in the city of Vienna”,“a mecha robot in a favela”])
demo.launch(share=True)
The program run ok, but two problems occurs (tried locally on Safari, remotely on Edge and Chrome):
Problem 1:When I click in any of the examples sentences, it don’t appear in Your prompt box. I need to type;
Problem 2: Appear a big and red Error message in place of the image. I’ve been tested several different texts in addition of this two examples with the same result.
All suggestions are welcome !
Tks,
Fábio