File size: 803 Bytes
6f1901f
c54dd0d
 
 
efcf8a5
 
831b048
efcf8a5
 
5c5529d
 
 
efcf8a5
5c5529d
 
00d5eee
5c5529d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
import requests
import io
from PIL import Image

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>"

def generate_image(prompt):
    model = pipeline("image-to-image", model="Cacau/heart-of-painting")
    return model(prompt)[0]

inputs = gr.inputs.Textbox(label="Prompt", placeholder="Your prompt here...")
output = gr.outputs.Image(label="Generated Image")

gr.Interface(generate_image, inputs, output, title=title, description=description, article=article).launch()