It would be nice if you didn't have to make an account to demo.
But I do already have an openai account with their API.
Using the Dall-E API I get
this
Code to make img:
GeSHi`ed Python code for
dalle.py 1
2
3
4
56
7
8
9
1011
12
13
14
1516
17
18
19
20 |
from openai import OpenAI
import sys
client = OpenAI()
def makeimg(prompt: str) -> str:
response = client.images.generate(
model="dall-e-3",
prompt=prompt,
size="1024x1024", quality="standard",
n=1,
)
image_url = response.data[0].url return image_url
if __name__ == "__main__":
print(makeimg(sys.argv[1]))
|