Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -9,11 +9,13 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
9 |
|
10 |
|
11 |
# Define the function that generates the image
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
17 |
image_url = response['data'][0]['url']
|
18 |
|
19 |
|
|
|
9 |
|
10 |
|
11 |
# Define the function that generates the image
|
12 |
+
def generate_image(prompt):
|
13 |
+
response = openai.Image.create(
|
14 |
+
prompt=prompt,
|
15 |
+
n=1,
|
16 |
+
size="1024x1024"
|
17 |
+
)
|
18 |
+
|
19 |
image_url = response['data'][0]['url']
|
20 |
|
21 |
|