Spaces:
Sleeping
Sleeping
Javitron4257
commited on
Modificamos para usar stable difusion
Browse files
app.py
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
5 |
|
6 |
-
demo = gr.Interface(fn=
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from diffusers import DiffusionPipeline
|
3 |
+
import torch
|
4 |
|
5 |
+
def stable(prompt):
|
6 |
+
pipeline = DiffusionPipeline.from_pretrained("sd-legacy/stable-diffusion-v1-5", torch_dtype=torch.float32)
|
7 |
+
return pipeline(prompt).images[0]
|
8 |
|
9 |
+
demo = gr.Interface(fn=stable, inputs="text", outputs="image")
|
10 |
demo.launch()
|