Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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();
|