Using ChatGPT to write a DALL-E 2 application

Leo van der Meulen
7 min readDec 30, 2022

Using ChatGPT to create code to generate images by DALL-E using the OpenAI API.

“A programmer behind his screen using chatGPT to start learning the API of Dall-E” (image generated by Dall-E)

OpenAI provides two of the greatest AI tools of the moment; a Large Language Model trained for conversational speech named chatGPT and text-to-image model Dall-E 2.

ChatGPT is the successor of GTP-3 and is a stateful chat engine. It uses previous interactions in the same chat to determine it answer, giving it a more conversational feeling. More information can be found in the blog post on the website of OpenAI.

The OpenAI API makes it possible to call the Dall-E 2 model for image generation. ChatGPT is not (yet) supported. This article describes how to use the Dall-E 2 API to generate images from prompts.

The normal way to start is to read the API documentation provided. But the owner of the API also has this smart chatbot. So is it possible to develop the code required for image generation with the help of chatGPT?

So let’s try it!

Getting started

My first question to chatGPT was ‘How do I call DALL-E API from Python?’. After a second, chatGPT starts spitting out the answer:

--

--

Leo van der Meulen
Leo van der Meulen

Written by Leo van der Meulen

Dutch open data and public transportation enthousiast. Working for over 15 years in public transport. LinkedIn: https://www.linkedin.com/in/leovandermeulen/

No responses yet