Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from diffusers import StableDiffusionPipeline
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
pipe = StableDiffusionPipeline.from_pretrained("sivar/legostyle1-5", torch_dtype=torch.float16)
|
| 6 |
+
pipe = pipe.to("cuda")
|
| 7 |
+
|
| 8 |
+
def infer(prompt):
|
| 9 |
+
image = pipe(prompt).images[0]
|
| 10 |
+
return image
|
| 11 |
+
|
| 12 |
+
gr.Interface(fn=infer, inputs="text", outputs="image").launch()
|