Spaces:
Sleeping
Sleeping
from openai import OpenAI | |
from dotenv import load_dotenv | |
import os | |
load_dotenv() | |
client = OpenAI(api_key=os.getenv("openai_api_key")) | |
def generate_image(img): | |
response = client.images.generate( | |
model="dall-e-3", | |
prompt=img, | |
n=1, | |
size="1024x1024" | |
) | |
return response.data[0].url | |