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
""" | |
Generate images using Dall-E, save the parameters and the output easily to file. | |
Usage: | |
```python | |
import os; os.environ["OPENAI_API_KEY"] = "SECRET_KEY" # set your API key | |
from generate_images import GeneratedImage, GeneratedImagesFile # import this code | |
img = GeneratedImage.generate("Astronaut") # generate an image | |
img # display the generated image + metadata in Jupyter | |
img.save_image("astronaut.png") # save a specific image |