Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def greet(name):
|
4 |
-
|
|
|
|
|
|
|
|
|
5 |
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import torch
|
3 |
+
from diffusers import StableDiffusionPipeline
|
4 |
+
|
5 |
+
model_id = "CompVis/stable-diffusion-v1-4"
|
6 |
+
device = "cuda"
|
7 |
|
8 |
def greet(name):
|
9 |
+
prompt = name
|
10 |
+
image = pipe(prompt).images[0]
|
11 |
+
|
12 |
+
image.save(prompt+".png")
|
13 |
+
return "done"
|
14 |
|
15 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
16 |
iface.launch()
|