Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,11 @@ def generate_image(prompt):
|
|
15 |
n=1,
|
16 |
size="1024x1024"
|
17 |
)
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
image_url = response['data'][0]['url']
|
20 |
|
21 |
|
22 |
iface = gr.Interface(
|
|
|
15 |
n=1,
|
16 |
size="1024x1024"
|
17 |
)
|
18 |
+
response.raise_for_status()
|
19 |
+
image_url = response.json()["data"][0]["url"]
|
20 |
+
image = Image.open(BytesIO(requests.get(image_url).content))
|
21 |
+
return image
|
22 |
|
|
|
23 |
|
24 |
|
25 |
iface = gr.Interface(
|