Example request to generate an image using Dall-E 3
This commit is contained in:
parent
d150098545
commit
999591b193
17
dall_e.py
Normal file
17
dall_e.py
Normal file
@ -0,0 +1,17 @@
|
||||
from dotenv import load_dotenv
|
||||
from openai import OpenAI
|
||||
|
||||
load_dotenv()
|
||||
|
||||
client = OpenAI()
|
||||
|
||||
response = client.images.generate(
|
||||
model='dall-e-3',
|
||||
prompt='cthulhu, paper craft art, minimal detail',
|
||||
size='1024x1024',
|
||||
quality='standard',
|
||||
n=1,
|
||||
)
|
||||
|
||||
image_url = response.data[0].url
|
||||
print(image_url)
|
Loading…
Reference in New Issue
Block a user