Spaces:
Runtime error
Runtime error
import gradio as gr | |
import transforms | |
import requests | |
import io | |
from PIL import Image | |
from transformers import pipeline | |
from torchvision import transforms | |
title = "Fine Tuned SD Model - Authoral stylization" | |
description = "Generate images trained in an authoral illustration model." | |
article = "<p style='text-align: center'><a href='https://news.machinelearning.sg/posts/beautiful_profile_pics_remove_background_image_with_deeplabv3/'>Blog</a> | <a href='https://github.com/eugenesiow/practical-ml'>Github Repo</a></p>" | |
gr.Interface.load( | |
"spaces/Cacau/heart-of-painting", | |
demo = gr.Interface( | |
fn=greet, | |
inputs=gr.Textbox(lines=2, placeholder="Name Here..."), | |
outputs="text", | |
) | |
with gr.Blocks(theme=gr.themes.Glass()) as demo: | |
inputs=[gr.Textbox(label="Prompt", source="input box")] | |
output=[gr.Ima] | |
).launch() | |
def query(payload): | |
response = requests.post(API_URL, headers=headers, json=payload) | |
return response.content | |
image_bytes = query({ | |
"inputs":gr.Textbox(lines=2, placeholder="Your prompt here..."), | |
}) | |
# You can access the image with PIL.Image for example | |
import io | |
from PIL import Image | |
image = Image.open(io.BytesIO(image_bytes)) | |
return "This is your generated image:" + image "**Save it in your files!" | |
demo.launch() |