Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from diffusers import StableDiffusionPipeline
|
| 3 |
-
import torch
|
| 4 |
-
|
| 5 |
-
model_id = "runwayml/stable-diffusion-v1-5"
|
| 6 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
| 7 |
-
pipe = pipe.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 8 |
-
|
| 9 |
-
def generate(prompt):
|
| 10 |
-
image = pipe(prompt).images[0]
|
| 11 |
-
return image
|
| 12 |
-
|
| 13 |
-
iface = gr.Interface(fn=generate, inputs="text", outputs="image")
|
| 14 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|