Sean Laurent commited on
Commit ·
0c75170
1
Parent(s): cfc8d88
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,11 +9,11 @@ openai.api_key = os.environ.get("OPENAI_API_KEY")
|
|
| 9 |
def open_ai_txt2img(prompt):
|
| 10 |
response = openai.Image.create(
|
| 11 |
prompt=prompt,
|
| 12 |
-
n=1,
|
| 13 |
size="1024x1024",
|
| 14 |
-
response_format="url"
|
| 15 |
)
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
# Gradio Interface
|
| 19 |
def generator(prompt):
|
|
|
|
| 9 |
def open_ai_txt2img(prompt):
|
| 10 |
response = openai.Image.create(
|
| 11 |
prompt=prompt,
|
|
|
|
| 12 |
size="1024x1024",
|
| 13 |
+
response_format="url"
|
| 14 |
)
|
| 15 |
+
print("Response:", response)
|
| 16 |
+
return response["data"][0]["url"]
|
| 17 |
|
| 18 |
# Gradio Interface
|
| 19 |
def generator(prompt):
|