From the course: OpenAI API for Python Developers

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Create an image gallery with DALL·E

Create an image gallery with DALL·E

From the course: OpenAI API for Python Developers

Create an image gallery with DALL·E

- [Instructor] So now the next step will be to create our image gallery. So I'm going to try another generation, image generation. I'm going to try a prompt which is a little bit more elaborated like enchanted forest. I'm going to specify also an old oak tree, for example, and just add another keyword, like sunlight to see what it comes up with. Here we go, so that's not bad, and that's going to be automatically saved to the folder. But the next step will be to be able to display this as a gallery. So let's go back to our project. You'll see that here you have this new picture, which is now saved. So the next step will be to then read from this folder to then display all the images in the gallery. And you see that we already have this function, get_file, so let's go check out actually what it does. Basically, it's going to go look for images with this extension, extension jpg or png, and it's going to create an object with the file and a title for the image. So let's go back and we're…

Contents