danielgi97 commited on
Commit
84328ed
1 Parent(s): c65a7b8

Create stable-app.py

Browse files
Files changed (1) hide show
  1. stable-app.py +10 -0
stable-app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from diffusers import DiffusionPipeline
3
+ import torch
4
+
5
+ def stable(prompt):
6
+ pipeline = DiffusionPipeline.from_pretrained("runwayml/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()