top of page

Creating Art with AI: A Guide to Create Image using Azure OpenAI Service

In the era of artificial intelligence, generating images using text prompts has become a reality. Thanks to the advancements in machine learning and AI, we now have models like DALL-E that can create images from textual descriptions. One of the platforms that offer this service is Azure OpenAI.


Azure OpenAI Service is a cloud-based service provided by Microsoft that allows developers to deploy and use OpenAI models like DALL-E. This service provides an easy-to-use interface for deploying models and generating images. In this article, we will guide you through the process of generating images using Azure OpenAI Service with DALL-E.


The process involves three main steps: creating a resource, deploying a model, and generating an image. We will walk you through each step in detail to ensure you have a clear understanding of how to use this service effectively.


So, let’s get started!


Create Images using Azure OpenAI Service with DALL-E

In this section, we will generate images using Azure OpenAI Service with DALL-E. Before that, you should know about DALL-E and why we use it.


What is DALL-E?

DALL-E is a state-of-the-art AI model developed by OpenAI. It is a variant of the GPT-3 architecture, specifically designed for generating images from text descriptions. DALL-E is capable of producing highly creative and imaginative images based on textual prompts. It can generate images for a wide range of concepts and ideas, even ones that it has never seen before during its training.


Why do we use it?

  • DALL-E taps into AI's capabilities to create challenging and time-consuming images.

  • DALL-E interprets text and transforms it into clear and meaningful pictures.

  • It's a valuable tool for creative tasks like making art, illustrating concepts, or visualizing ideas.

Below are the three simple steps to generate images using Azure OpenAI Services:

  1. Create a Resource: First, create a resource on Azure for OpenAI Services. This resource provides the infrastructure and environment needed to run AI models and services.

  2. Deploy the Model: Once you have the resources, deploy the desired AI model. In this case, we use DALL-E as an example. Deploying the model makes it accessible and ready for use.

  3. Generate Images Using DALL-E: After deploying the model, you can use DALL-E to generate images. Simply input a text prompt that describes the image you want, and DALL-E will create the image based on that description.


STEP 1: Create a Resource

Follow the below steps to create a resource for Azure OpenAI.


STEP 1: Visit the Azure portal (https://portal.azure.com/) and select "Azure OpenAI".

Click on Azure OpenAI

STEP 2: In the Azure OpenAI dashboard, click on "+ Create" to create a new resource for Azure OpenAI Service.

Click "Create" to create a resource for Azure OpenAI service

STEP 3: Now, under the Basics tab, you need to provide the following information:

  1. Subscription: Select your Azure subscription.

  2. Resource Group: Choose or create a resource group where you want to place your OpenAI resource.

  3. Region: Choose the Azure region where you want to deploy your resource.

  4. Name: Give your Azure OpenAI resource a unique name.

  5. Pricing tier: Select the desired pricing tier based on your requirements.

Click "Next".

Azure OpenAI - enter the basic information

STEP 4: Under the "Network" tab, you have three options:

  1. All networks, including the Internet, can access this resource

  2. Selected networks, configure network security for your Azure AI services resource

  3. Disabled, no networks can access this resource. You could configure private endpoint connections that will be the exclusive way to access this resource.

Select the networking option depending on the requirement. For example, I have selected the"All networks, including the internet, can access this resource" option.

Azure OpenAI - select the network security option

This option will allow all networks, including the internet, to access your resource. This option is the default setting. No extra settings are required for this option.


The second option "Selected networks, configure network security for your Azure AI services resource." lets you identify specific networks that can access your resource. When you select this option, the page updates to include the following required fields:

Azure OpenAI - second network security option

The third option "Disabled, no networks can access this resource. You could configure private endpoint connections that will be the exclusive way to access this resource." lets you disable network access to your resource.


When you select this option, the page updates to include the Private endpoint table.

Azure OpenAI - third network security option

To create a private endpoint, click the "+ Create private endpoint" button. This will open the Create private endpoint page.


On the Create private endpoint page, you must specify the following information:

  • Name: The name of the private endpoint.

  • Resource group: The resource group where the private endpoint will be created.

  • Region: The region where the private endpoint will be created.

  • Target sub:** The subnet in your virtual network where the private endpoint's IP address will be allocated.

  • Private DNS integration: Whether or not to integrate the private endpoint with a private DNS zone.

Azure OpenAI - create private endpoint

Once you have specified this information, click Create to create the private endpoint.


Once the private endpoint is created, you will need to connect it to the Azure resource that you want to access privately. This can be done by creating a private link connection between the private endpoint and the resource.


STEP 5: Under the "Tags" tab, you can provide tags (key-value pairs) to help organize and manage your resource. This step is optional. Click Next.

Azure OpenAI - enter tags


STEP 6: Review all the details you have entered in the previous steps to ensure they are correct and then click on "Create".

Azure OpenAI - click create


STEP 2: Deploy the Model

After creating a resource, you have to deploy the model. So, select the model you want to deploy. Some of the models are available in Azure OpenAI Studio.


When you click on "Create" in STEP 6 (in the above section), this will create and also will deploy the model.

Azure OpenAI - deploying

STEP 3: Generate the Image

Now, you have created and deployed the resource. Follow the below steps:


STEP 1: After successfully creating your Azure OpenAI resource, return to the Azure OpenAI dashboard or home page.


You can typically access this by clicking on the Azure OpenAI service in the Azure portal or navigating to the Azure OpenAI service page.

Azure OpenAI - click the resource name

STEP 2: On the Azure OpenAI home page or dashboard, you will see a list of your resources. Look for the resource that you have just created. It should be listed there with the name and details you provided during the resource creation process.


Click on the name of the resource you want to access.


STEP 3: Navigate to Azure OpenAI Studio.


To access Azure OpenAI Studio, you can either click on "Explore" or navigate to the "Azure OpenAI Studio" section, depending on the layout and options available in the Azure portal.

Azure OpenAI - navigate to Azure OpenAI Studio

STEP 4: Look for the "DALL-E Playground" option and click on it to access the DALL-E image generation tool.

Azure OpenAI - click DALL-E playground

STEP 5: In the DALL-E playground, you will see a text input area. Here, you can write a prompt that describes the image you want to generate.


For example, you can enter a prompt like "Create an image of space with all the planets."

Azure OpenAI - example

STEP 6: To further customize the image generation process or understand the underlying code, you can click on "{}".


This will allow you to view the code responsible for generating the image. You can make modifications to the code if needed, but be cautious if you're not familiar with the code structure.


Conclusion

Azure OpenAI Service, with the help of DALL-E, simplifies image creation by interpreting text descriptions. It's a powerful tool for artists, designers, and visionaries, eliminating the manual effort of crafting intricate visuals. This technology showcases AI's limitless potential and reshapes how we approach visual expression. Embrace Azure OpenAI Service to amplify your creativity and explore new horizons in image generation.

bottom of page