Domain 2 of 2 · Chapter 3 of 4

Implement AI solutions with computer vision and image-generation capabilities by using Foundry

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing Microsoft Azure AI Fundamentals premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • Three request shapes, one deployment each
  • Deploy a vision-enabled model and test it
  • Get the image into the prompt
  • Options that tune a vision request
  • Generate a new image from a prompt
  • Edit an existing image with a mask
  • Exam patterns for vision and image generation

Three visual request shapes and what changes between them

Decision pointImage in, text outText in, image outImage in, image out
Model you deployVision-enabled (multimodal) model, for example gpt-4.1 or Phi-4-multimodal-instructImage-generation model, for example the gpt-image-1 series or FLUXAn image model that supports the edit operation
What the request carriesA text instruction plus an image, as a URL or a base64 data URLA prompt describing the subject and visual styleA source image, a prompt, and optionally a mask
What comes backWords: a description, an answer, or wording read from the pictureNew image data in the b64_json fieldA modified version of the source image
Python client callclient.responses.create() or client.chat.completions.create()client.images.generate()The images edit operation
Options that matterdetail on the image item, and max_tokens or max_completion_tokensn, size, quality, output_formatmask, alongside the generation options
How it fails visiblyfinish_reason of length, meaning the answer was truncatedForgetting to base64-decode b64_json before saving the fileOmitting the source image, which turns the job back into plain generation

Decision tree

Must the output bean image file?No: wordsYes: an imageDoes the answer hingeon fine visual detail?Must an existing imagebe preserved?YesNoYesNoVision-enabledmodeldetail: highVision-enabledmodeldetail: auto or lowImage editoperationsource image + promptImage-generationmodelimages.generate()Always: a URL or a base64 data URLnever a local file path

Cheat sheet

  • Vision-enabled models answer text questions about images
  • The detail parameter controls vision processing resolution
  • Vision input uses an accessible URL or base64 image data
  • Vision input supports common web image formats
  • A vision user message contains text and image content items
  • A vision request needs an adequate output-token limit
  • Image-generation models create visuals rather than descriptions
  • Image-generation options shape the visual output
  • The image-generation client decodes base64 output
  • Image editing supplies a source image as well as a prompt

Unlock with Premium — includes all practice exams and the complete study guide.

Also tested in

References

  1. Develop a vision-based chat app (Microsoft Learn training unit)
  2. Use a vision-capable model in the Microsoft Foundry portal (Microsoft Learn training unit)
  3. What are image-generation models? (Microsoft Learn training unit)
  4. How to use image generation models in Microsoft Foundry
  5. How to use vision-enabled chat models in Microsoft Foundry
  6. Foundry Models sold by Azure: image generation models
  7. Explore image-generation models in Microsoft Foundry portal (Microsoft Learn training unit)
  8. Create a client application that uses an image generation model (Microsoft Learn training unit)
  9. Azure Content Understanding analyzer reference
  10. What is Azure Content Understanding in Foundry Tools?
  11. Migrate from Azure Vision in Foundry Tools - Image Analysis