Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from diffusers import DiffusionPipeline
|
3 |
|
4 |
-
def generate_image(
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
return image
|
10 |
|
11 |
app = gr.Interface(
|
12 |
fn=generate_image,
|
@@ -14,6 +13,4 @@ app = gr.Interface(
|
|
14 |
outputs="image",
|
15 |
title="Cat Image Generator",
|
16 |
description="Click the button to generate a cute cat image."
|
17 |
-
)
|
18 |
-
|
19 |
-
app.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from diffusers import DiffusionPipeline
|
3 |
|
4 |
+
def generate_image(width):
|
5 |
+
pipeline = DiffusionPipeline.from_pretrained("nroggendorff/cats")
|
6 |
+
pipe = pipeline.to("cuda")
|
7 |
+
image = pipe(image_size=width).images[0]
|
8 |
+
return image
|
|
|
9 |
|
10 |
app = gr.Interface(
|
11 |
fn=generate_image,
|
|
|
13 |
outputs="image",
|
14 |
title="Cat Image Generator",
|
15 |
description="Click the button to generate a cute cat image."
|
16 |
+
).launch()
|
|
|
|