Created
February 28, 2023 18:50
-
-
Save grantwforsythe/9ee9f4a9cb316a942ae15c99adfc467e to your computer and use it in GitHub Desktop.
Save DALL-E Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env | |
curl https://api.openai.com/v1/images/generations \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer $OPENAI_API_KEY" \ | |
-d '{ | |
"prompt": "a photo of a happy corgi puppy sitting and facing forward, studio light, longshot", | |
"n": 1, | |
"size": "1024x1024" | |
}' | | |
python3 -c "import sys, json; sys.stdout.write(json.load(sys.stdin)['data'][0]['url'])" | | |
xargs curl > image.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment