- DALL-E is a neural network based model that can generate graphical data from natural language input.
- Put more simply, you can provide DALL-E with a description and it can generate an appropriate image.
- For example, you might submit the following natural language prompt to DALL-E: A squirrel on a motorcycle
- This prompt could result in the generation of graphical output such as the following image:
- The images generated by DALL-E are original; they are not retrieved from a curated image catalog.
- In other words, DALL-E is not a search system for finding appropriate images - it is an AI model that generates new images based on the data on which it was trained.
- To experiment with DALL-E, use the Images playground to submit prompts and view the resulting generated images.
- When using the playground, you can adjust the settings to specify:
- The resolution (size) of the generated images. Available sizes are 1024x1024 (which is the default value), 1792x1024, or 1024x1792.
- The image style to be generated (such as vivid or natural).
- The image quality (choose from standard or hd).
- Initiate the image generation process by submitting a POST request. The request must contain the following parameters in a JSON body:
- prompt: The description of the image to be generated.
- n: The number of images to be generated. DALL-E 3 only supports n=1.
- size: The resolution of the image(s) to be generated (1024x1024, 1792x1024, or 1024x1792).
- quality Optional: The quality of the image (standard or hd). Defaults to standard.
- style Optional: The visual style of the image (natural or vivid). Defaults to vivid.
- For example, the following JSON could be used to generate an 512 x 512 image of a badger wearing a tuxedo:
{
"prompt": "A badger wearing a tuxedo",
"n": 1,
"size": "512x512",
"quality": "hd",
"style": "vivid"
}
- Using an older generation model such as DALL-E 2, the initial request does not immediately return the results of the image generation process.
- Instead, the response includes an operation-location header with a URL for a callback service that your application code can poll until the results of image generation are ready.
- With DALL-E 3, the result from the request is processed synchronously with the response containing the URL for the generated image. The response is similar to the following JSON:
{
"created": 1686780744,
"data": [
{
"url": "<URL of generated image>",
"revised_prompt": "<prompt that was used>"
}
]
}
- The data element includes the url value, which references a PNG image file generated from the prompt that you can then view or download.
- The response also contains a revised prompt that was used to generate the image, which was updated by the system to achieve the most desirable results.
Lab -https://microsoftlearning.github.io/mslearn-openai/Instructions/Exercises/05-generate-images.html
- You want to use a model in Azure OpenAI to generate images. Which model should you use?
- DALL-E - The DALL-E model is used to generate images based on natural language prompts.
- GPT-35-Turbo
- Text-Davinci
- Which playground in Azure AI Studio should you use to utilize the DALL-E model?
- Completions
- Chat
- Images - The Images playground is used to explore image generation models.
- In a REST request to generate images, what does the n parameter indicate?
- The description of the desired image.
- The number of images to be generated - Correct The number of images to be generated is specified in the n parameter.
- The size of the image to be generated - The size of the desired image is specified in the size parameter