rsadaphule commited on
Commit
b343fac
·
verified ·
1 Parent(s): 5942d5e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from diffusers import AutoPipelineForText2Image
2
+ import torch
3
+
4
+ def generateImage(text):
5
+ pipeline = AutoPipelineForText2Image.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, variant="fp16")
6
+ #pipeline.to("cuda")
7
+ image = pipeline(text)
8
+ return image.images[0]
9
+
10
+
11
+ gr.Interface(fn=generateImage,
12
+ inputs='textbox',
13
+ outputs='image').launch();