Spaces:
Runtime error
Runtime error
add UI
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import diffusers
|
3 |
+
from PIL import Image
|
4 |
+
|
5 |
+
pipe = diffusers.DiffusionPipeline.from_pretrained("kohbanye/pixel-art-style")
|
6 |
+
|
7 |
+
|
8 |
+
def generate_image(prompt: str) -> Image.Image:
|
9 |
+
image = pipe(prompt, num_inference_steps=50, width=512, height=512).images[0]
|
10 |
+
return image
|
11 |
+
|
12 |
+
|
13 |
+
app = gr.Interface(
|
14 |
+
fn=generate_image,
|
15 |
+
inputs="text",
|
16 |
+
outputs="image",
|
17 |
+
title="Pixel Art Generator",
|
18 |
+
)
|
19 |
+
app.launch()
|