Implement computer vision solutions 3.1 Design and implement image- and video-generation solutions
A design app generates marketing images with a gpt-image-2 deployment at high quality…
Study guide skill: Select and apply appropriate generation and editing controls provided by the platform
Question B5-001
A design app generates marketing images with a gpt-image-2 deployment at high quality, and each image takes a while to render. Users should see the picture take shape while it renders instead of waiting for the final result, without lowering the quality. How should you configure the image generation request?
Select one answer.
Answer: D
Streaming returns partial images as they're generated, which gives users faster visual feedback; you turn it on with the stream parameter and use partial_images to choose how many intermediate images come back before the final result. Lower quality does generate faster, but it gives up the quality the app requires. Raising the timeout only waits longer, since the docs recommend streaming to get partial results sooner, and GPT-Image-2 returns images only as base64, with no URL option to poll.
Deep dive
How it works
Image generation can be slow at high quality. The image generation page says complex prompts can take up to 60 seconds. The fix that keeps quality is streaming:
- Set stream to true. The API then returns partial images as they're generated, which gives users faster visual feedback and improves perceived latency.
- Set partial_images to choose how many intermediate images come back before the final result.
Streaming is supported for gpt-image-1 series and gpt-image-2 models. Each partial image arrives as base64 data, so the client decodes and swaps in each frame as it arrives. Quality, size and other parameters stay as you set them; streaming only changes how soon users see something.
The troubleshooting section points the same way. For timeouts, the first suggestion is to use streaming to get partial results sooner.
The other options, and when you'd use them
- Set quality to low: Low is optimized for latency-sensitive use cases, so it would render faster, but the app must keep high quality.
- Raise the client timeout: The API can return something before the final image: that's what streaming partial images is for. A longer timeout only waits longer.
- response_format url and poll: These models output images only in base64. There's no URL option to poll.
Exam tip
"Show the image taking shape" = stream: true + partial_images. Faster but worse = quality low. GPT-image models return base64 only.
References
Last reviewed: