Spaces:
Runtime error
Runtime error
Commit
·
7535077
1
Parent(s):
fad24d2
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,18 @@
|
|
1 |
-
import os
|
2 |
import openai
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import openai
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
openai.api_key = 'sk-AAXKXTDNEpUTHQoQUJMHLrErGJyHg89uy71MyuHHEIGBRZ78'
|
5 |
+
|
6 |
+
def generate_images(prompt):
|
7 |
+
images = openai.Image.create(prompt=prompt, n=2, size="1024x1024")
|
8 |
+
return [image.url for image in images]
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=generate_images,
|
12 |
+
inputs="text",
|
13 |
+
outputs="image",
|
14 |
+
title="Car Logo Generator",
|
15 |
+
description="Enter a prompt to generate two car logos",
|
16 |
+
)
|
17 |
+
|
18 |
+
iface.launch()
|