Created
April 28, 2025 19:34
-
-
Save thomasms/4c1148cb33d52e60028142fd4420db24 to your computer and use it in GitHub Desktop.
gepetie_image
This file contains hidden or 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 python3 | |
import os | |
import argparse | |
from openai import OpenAI | |
def main(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument("prompt") | |
args = parser.parse_args() | |
client = OpenAI(api_key=os.environ.get("OPENAI_KEY")) | |
response = client.images.generate( | |
model="dall-e-3", | |
prompt=args.prompt, | |
size="1024x1024", | |
quality="standard", | |
n=1, | |
) | |
print(response.data[0].url) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment