05 Generate Images With Azure OpenAI Service
05 Generate Images With Azure OpenAI Service
• The Azure OpenAI service enables you to use large language models (LLMs) to
generate content based on natural language prompts.
• One of these models is the DALL-E image generation model, which is capable
of creating original graphical content based on natural language descriptions
of a desired image.
• In this module, you'll learn how to use the DALL-E model in an instance of the
Azure OpenAI service, and retrieve the images it generates.
What is DALL-E?
• DALL-E is a neural network based model
that can generate graphical data from
natural language input.
• In other words, DALL-E is not a search system for finding appropriate images - it is
an artificial intelligence (AI) model that generates new images based on the data on
which it was trained.
Explore DALL-E in Azure OpenAI
Studio
• To experiment with DALL-E, you
can provision an Azure OpenAI
Service resource in an Azure
subscription that has been
approved for access to the
service, and use the DALL-E
playground to submit prompts
and view the resulting generated
images.
Explore DALL-E in Azure OpenAI
•Studio
When using the playground, you can adjust the settings to specify:
• The resolution (size) of the generated images. Available sizes are 256x256,
512x512, 1024x1024 (which is the default value), or 1024x1792.
• The image style to be generated (such as vivid or natural).
• The image quality (choose from standard or hd).
Use the Azure OpenAI REST API to consume DALL-
•E You
models
can use the Azure OpenAI service REST API to consume DALL-E models from
applications.
• To make a REST call to the service, you need the endpoint and authorization key for
the Azure OpenAI Service resource you have provisioned in Azure.
• You initiate the image generation process by submitting a POST request to the
service endpoint with the authorization key in the header.
• The result from the initial request does not immediately return the results of the
image generation process.
• When the operation has succeeded, a response similar to the following JSON is
returned:
Use the Azure OpenAI REST API to consume DALL-
E models
• In this example, the file might look similar to the following image:
Use the Azure OpenAI REST API to consume DALL-
E models
Exercise - Generate images with a DALL-
E model
Knowledge check
1. You want to use a model in Azure OpenAI to generate images. Which model
should you use?
a) DALL-E
b) GPT-35-Turbo
c) Text-Davinci
2. Which playground in Azure OpenAI Studio should you use to explore image
generation
d) Completions
e) Chat
f) DALL-E
3. In a REST request to generate images, what does the n parameter indicate?