Spaces:
Runtime error
Runtime error
Commit
·
af2eaf2
1
Parent(s):
4f52f51
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,13 +17,13 @@ def generate_image(prompt, negative_prompt="Low quality", width=512, height=512)
|
|
| 17 |
image.save(f"squirrel-{idx}.png")
|
| 18 |
end_time = time.time()
|
| 19 |
elapsed_time = round(end_time - start_time, 2)
|
| 20 |
-
return
|
| 21 |
|
| 22 |
# Define the interface
|
| 23 |
iface = gr.Interface(
|
| 24 |
fn=generate_image,
|
| 25 |
inputs=["text", "text", "number", "number"],
|
| 26 |
-
outputs=gr.outputs.Image(label="Generated Image"),
|
| 27 |
layout="vertical",
|
| 28 |
title="Image Generation",
|
| 29 |
description="Generate images based on prompts.",
|
|
@@ -32,4 +32,4 @@ iface = gr.Interface(
|
|
| 32 |
)
|
| 33 |
|
| 34 |
# Launch the interface
|
| 35 |
-
iface.launch()
|
|
|
|
| 17 |
image.save(f"squirrel-{idx}.png")
|
| 18 |
end_time = time.time()
|
| 19 |
elapsed_time = round(end_time - start_time, 2)
|
| 20 |
+
return resized_images[0]
|
| 21 |
|
| 22 |
# Define the interface
|
| 23 |
iface = gr.Interface(
|
| 24 |
fn=generate_image,
|
| 25 |
inputs=["text", "text", "number", "number"],
|
| 26 |
+
outputs=gr.outputs.Image(type="pil", label="Generated Image"),
|
| 27 |
layout="vertical",
|
| 28 |
title="Image Generation",
|
| 29 |
description="Generate images based on prompts.",
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
# Launch the interface
|
| 35 |
+
iface.launch()
|