ChatGPT —Image generation with Python


The Images API is in beta. During this time the API and models will evolve based on your feedback. To ensure all users can prototype comfortably, the default rate limit is 50 images per minute.

The image generations endpoint allows you to create an original image given a text prompt. Generated images can have a size of 256x256, 512x512, or 1024x1024 pixels. Smaller sizes are faster to generate. You can request 1–10 images at a time using the n parameter.

response = openai.Image.create(
prompt="a white tiger",
image_url = response['data'][0]['url']

Link GitHub for this chapter here.

Hope this is helpful!



GeoSense ✅

🌏 Remote sensing | 🛰️ Geographic Information Systems (GIS) | ℹ️