Skip to content

Instantly share code, notes, and snippets.

View elizatlawy's full-sized avatar
:shipit:

Eli Zatlawy elizatlawy

:shipit:
View GitHub Profile
@tsvikas
tsvikas / generate_images.py
Last active July 4, 2024 01:38
generate images with dall-e
"""
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