Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,12 +35,12 @@ def call_api(negative_prompt, positive_prompt, api_key):
|
|
35 |
# Save the image as PNG to a buffer
|
36 |
buffer = BytesIO()
|
37 |
image.save(buffer, format="PNG")
|
|
|
38 |
|
39 |
# Return the buffer content to display it directly in the interface
|
40 |
-
buffer.seek(0)
|
41 |
return buffer
|
42 |
else:
|
43 |
-
return "Failed to fetch the image.
|
44 |
|
45 |
# Define Gradio interface
|
46 |
interface = gr.Interface(
|
@@ -52,7 +52,8 @@ interface = gr.Interface(
|
|
52 |
],
|
53 |
outputs="image",
|
54 |
title="Image Generation API Interface",
|
55 |
-
description="Enter the negative and positive prompts to generate an image."
|
|
|
56 |
)
|
57 |
|
58 |
# Launch the interface
|
|
|
35 |
# Save the image as PNG to a buffer
|
36 |
buffer = BytesIO()
|
37 |
image.save(buffer, format="PNG")
|
38 |
+
buffer.seek(0)
|
39 |
|
40 |
# Return the buffer content to display it directly in the interface
|
|
|
41 |
return buffer
|
42 |
else:
|
43 |
+
return f"Failed to fetch the image. Status Code: {response.status_code}, Error: {response.text}"
|
44 |
|
45 |
# Define Gradio interface
|
46 |
interface = gr.Interface(
|
|
|
52 |
],
|
53 |
outputs="image",
|
54 |
title="Image Generation API Interface",
|
55 |
+
description="Enter the negative and positive prompts to generate an image.",
|
56 |
+
debug=True # Enable debug mode
|
57 |
)
|
58 |
|
59 |
# Launch the interface
|