Spaces:
Runtime error
Runtime error
Commit
·
a1e4316
1
Parent(s):
fc4eaf7
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,10 @@
|
|
1 |
-
import gradio as gr
|
|
|
2 |
import torch
|
3 |
-
from diffusers import StableDiffusionPipeline
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
iface = gr.Interface(fn=diffusion, inputs="text", outputs="image")
|
13 |
-
iface.launch()
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
3 |
import torch
|
|
|
4 |
|
5 |
+
def txt2img(prompt):
|
6 |
+
image = pipe(prompt, height=768, width=768, guidance_scale = 10).images[0]
|
7 |
+
# image.save("sd_image.png")
|
8 |
+
return image
|
9 |
+
|
10 |
+
gr.Interface(txt2img, gr.Text(), gr.Image(), title = 'Stable Diffusion 2.0 Colab with Gradio UI').launch(share = True, debug = True)
|
|
|
|
|
|