mashdemy commited on
Commit
7f8f108
1 Parent(s): b1a5697

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from diffusers import DiffusionPipeline
2
+ import gradio as gr
3
+
4
+ model_id = "CompVis/ldm-text2im-large-256"
5
+
6
+ # load text input to diffusion pipeline
7
+ ldm = DiffusionPipeline.from_pretrained(model_id)
8
+
9
+ def generate_image(Prompt):
10
+
11
+ images = ldm([Prompt], num_inference_steps=50, eta=.3, guidance_scale=6)
12
+ return images.images[0]
13
+
14
+ interface = gr.Interface(fn = generate_image,inputs = "text",outputs = "image",title = "Mashdemy Demo Image Generator App", description = "Type in a text and click submit to generate an image:", examples = ["a clown riding a lion", "a mouse using a laptop"])
15
+ interface.launch(share = True)