Cacau commited on
Commit
58b46dc
1 Parent(s): 163bc3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -1,17 +1,18 @@
1
- import gradio as gr
2
  import requests
3
  import io
4
  from PIL import Image
 
5
 
6
  title = "Fine Tuned SD Model - Authoral stylization"
7
  description = "Generate images trained in an authoral illustration model."
8
  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>"
9
 
10
- def generate_image(prompt):
11
- model = pipeline("image-to-image", model="Cacau/heart-of-painting")
12
- return model(prompt)[0]
13
-
14
- inputs = gr.inputs.Textbox(label="Prompt", placeholder="Your prompt here...")
15
- output = gr.outputs.Image(label="Generated Image")
16
 
17
- gr.Interface(generate_image, inputs, output, title=title, description=description, article=article).launch()
 
 
 
 
 
 
 
1
  import requests
2
  import io
3
  from PIL import Image
4
+ import gradio as gr
5
 
6
  title = "Fine Tuned SD Model - Authoral stylization"
7
  description = "Generate images trained in an authoral illustration model."
8
  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>"
9
 
10
+ def greet(name):
11
+ return "Hello " + name + "!!"
 
 
 
 
12
 
13
+ iface = gr.Interface(fn=greet,
14
+ inputs=gr.inputs.Textbox(label="Prompt", placeholder="Your prompt here..."),
15
+ outputs=gr.outputs.Image(label="Generated Image")
16
+
17
+ )
18
+ iface.launch()