Service: Azure AI Foundry โ Image Generation ๐ง ๐จ
๐งฉ Problem
You need to automatically generate original images from natural language descriptions, for use in marketing, illustration, branding, or similar applications.
๐ Solution with Azure
Use image generation models available in Azure AI Foundry, such as: * ๐จ DALL-E 3 * ๐ผ๏ธ GPT-Image 1
These models allow you to create unique visual content based on text prompts, rather than retrieving existing images.
๐ ๏ธ Componenti richiesti
- Azure AI Foundry portal
- Image generation model (e.g., DALL-E 3)
- Images playground for prompt testing
- REST API or SDKs (OpenAI Python SDK, Azure OpenAI .NET SDK)
- API key for authorization
๐๏ธ Architettura / Sviluppo
๐งช Test using the Images playground
- Set image resolution:
1024x1024
(default)1792x1024
(wide)1024x1792
(tall)- Choose image quality:
standard
orhd
- Choose style:
natural
orvivid
๐ง Build a client app
Submit a prompt to the API with parameters like:
{
"prompt": "A badger wearing a tuxedo",
"n": 1,
"size": "1024x1024",
"quality": "hd",
"style": "vivid"
}
Response (synchronous with DALL-E 3):
{
"created": 1686780744,
"data": [
{
"url": "<URL of generated image>",
"revised_prompt": "<prompt that was used>"
}
]
}
- โ
url
: Link to the generated PNG image - ๐
revised_prompt
: Optimized prompt used by the model
๐ Best practice / Considerazioni
- ๐งพ Use specific, detailed prompts for better results
- โ๏ธ Tune resolution, style, and quality for output that fits the use case
- ๐ผ๏ธ Remember: images are original, not from a database
- ๐ Always include authorization headers when using APIs
- ๐งช Start with Images playground to test before integrating in an app
๐ Domande simulate d'esame
Q1. What model can you use in Azure AI Foundry to generate original images from a prompt? A. DALL-E 3 or GPT-Image 1
Q2. What is the default image size generated by DALL-E 3? A. 1024x1024
Q3. Which parameters can you customize in an image generation API request?
A. prompt
, n
, size
, quality
, style
Q4. What does the revised_prompt
field in the API response indicate?
A. A modified version of your prompt used to improve image output
Q5. Where can you test prompts before integrating them into an application? A. In the Images playground in the Azure AI Foundry portal