Skip to content

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 or hd
  • Choose style: natural or vivid

๐Ÿ”ง 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