AI-103: Image and Video Generation and Editing in Foundry — GPT-image, FLUX and Sora 2
Image and video generation in Microsoft Foundry means calling a deployed generative model (a GPT-image series or FLUX model for images, Sora 2 for video) to create media from text prompts and reference images, and then editing that media with masks, prompts and remixes. This lesson covers the AI-103 skills at the level of the actual calls: which image model to deploy and why dall-e-3 is no longer an option, what images.generate returns, which controls change quality, speed, format and transparency, how mask-based inpainting and input fidelity work, when FLUX needs the Black Forest Labs API instead of the images API, and how Sora 2's asynchronous jobs, reference images, remixes and content restrictions behave.
What you’ll learn
- Choose an image model in Foundry by availability, supported sizes and API shape, and migrate off the retired dall-e-3
- Generate images with images.generate and handle the base64 response that GPT-image models always return
- Apply generation controls (size, quality, output_format, output_compression, background, streaming partial images) to a stated requirement
- Configure image edits: prompt-driven edits, mask-based inpainting with a valid PNG mask, multi-image requests and input_fidelity
- Pick the right FLUX model and route (Image API or BFL provider API) and address it with the correct model path
- Implement Sora 2 video generation as an asynchronous job, including size, duration, reference images and storage before expiry
- Edit generated videos with remix and design prompts and references that comply with Sora 2's content restrictions
The 9 parts · about 11 min of reading
- Which models generate images in Microsoft Foundry?Start hereGPT-image-2 is GA with custom sizes up to 3,840 px; the GPT-image-1 series needs limited access, and dall-e-3 is retired.1 min
- How do you generate an image from a text prompt?Call images.generate with the deployment name and a prompt, then decode b64_json: GPT-image models never return an image URL.1 min
- Which controls shape a generated image?Each images.generate control changes one thing: quality trades detail for speed, streaming shows previews, PNG allows transparency.1 min
- How do you edit an image with a prompt or a mask?images.edit takes up to 16 images as multipart uploads; a mask must be a same-size PNG whose transparent area marks the edit.2 min
- When should you use FLUX models, and through which API?FLUX-1.1-pro and FLUX.1-Kontext-pro work through the Image API; FLUX.2 models and parameters like seed need the BFL provider API.2 min
- How does Sora 2 generate a video?A Sora 2 render is an async job: create it, poll until completed, then download the MP4 within 24 hours of creation.1 min
- Which parameters control a Sora 2 video, including reference images?videos.create takes a prompt, size (720x1280 or 1280x720), seconds (4, 8 or 12) and an input_reference image for the first frame.1 min
- How do you edit a generated video?videos.remix applies a new prompt to a completed video while keeping its framing and motion; make one adjustment per remix.1 min
- Why do Sora 2 generation requests fail?Sora 2 rejects real people, human faces in reference images, copyrighted characters and music, and content unsuitable for minors.1 min
Mind map
How the exam tests this
Expect scenario items that describe a company, an image or video deployment in Foundry and a requirement, then ask you to pick the model, call or parameter that meets it. Many items show parameter values or short OpenAI-client calls, so know the exact names: images.generate, images.edit, b64_json, quality, output_format, background, stream with partial_images, input_fidelity, videos.create, videos.retrieve, download_content, videos.remix, size, seconds and input_reference, plus the FLUX routes and model paths. Troubleshooting items describe a request that fails or behaves unexpectedly and ask what to change; some are multi-select.
Key takeaways
- dall-e-3 was retired on 4 March 2026; move to a GPT-image deployment, which uses the same images API but returns b64_json instead of a URL.
- GPT-image-2 is generally available and takes custom sizes (edges in multiples of 16); GPT-image-1, 1.5 and 1-mini need limited-access approval and offer three fixed sizes.
- Lower quality generates faster; streaming with partial_images shows previews sooner but doesn't finish sooner; output_compression only shrinks JPEG files.
- A transparent background needs background="transparent" with output_format="png".
- Edits are multipart/form-data with up to 16 PNG/JPG images under 50 MB; a mask must be a PNG of the same size whose editable area is fully transparent.
- input_fidelity=high preserves faces from input images, but gpt-image-1-mini doesn't support it.
- Only FLUX.1-Kontext-pro and FLUX-1.1-pro use the Image API; provider parameters such as seed, guidance, steps and aspect_ratio need the BFL API (availability varies by model), whose URL uses the model path, not the model ID.
- Sora 2 videos.create returns a queued job: poll, then download_content, and store the MP4 within 24 hours.
- The Sora 2 API lists size 720x1280 or 1280x720 and seconds 4, 8 or 12; input_reference must match size exactly.
- videos.remix edits a completed video while keeping its structure; make one clear adjustment per remix, and remember Sora 2 rejects real people and input images with faces.
Part 1: Which models generate images in Microsoft Foundry?
GPT-image-2 is GA with custom sizes up to 3,840 px; the GPT-image-1 series needs limited access, and dall-e-3 is retired.
Frequently asked questions
What replaces dall-e-3 in Microsoft Foundry?
A GPT-image series model. Microsoft retired dall-e-3 on 4 March 2026, so it can't be deployed and existing deployments no longer serve requests. GPT-image models use the same images API, so an app keeps its images.generate call and points it at the new deployment. The main code change is reading the result: GPT-image models always return base64 data in b64_json rather than an image URL, and response_format isn't supported.
Why is result.data[0].url empty with a GPT-image model?
GPT-image models always return the generated image as a base64 string in b64_json and never return a URL. The response_format parameter that some older image models used to request a URL isn't supported for them. Decode b64_json with base64.b64decode and write the bytes to a file or storage. output_format only changes the encoding (PNG or JPEG), not the delivery.
How do I make a mask for inpainting with GPT-image models?
Create a PNG with exactly the same dimensions as the input image and make the area you want to change fully transparent (alpha 0). Opaque pixels are kept as they are. A JPEG mask can't work because JPEG has no transparency, painting the area a colour marks nothing for editing, and a mask of a different size is rejected. Send the image, prompt and mask as multipart/form-data to the images edits endpoint.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.