Spaces:
Running
Running
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from diffusers import DiffusionPipeline
|
| 3 |
-
import torch
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
pipe = DiffusionPipeline.from_pretrained(
|
| 7 |
-
"segmind/tiny-sd",
|
| 8 |
-
torch_dtype=torch.float32
|
| 9 |
-
)
|
| 10 |
-
|
| 11 |
-
pipe = pipe.to("cpu")
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
def generate_image(prompt):
|
| 15 |
-
image = pipe(prompt).images[0]
|
| 16 |
-
return image
|
| 17 |
-
|
| 18 |
-
demo = gr.Interface(
|
| 19 |
-
fn=generate_image,
|
| 20 |
-
inputs=gr.Textbox(label="Enter Prompt"),
|
| 21 |
-
outputs=gr.Image(label="Generated Image"),
|
| 22 |
-
title="Tiny Stable Diffusion Demo"
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|