Image Generation
/v1/images/generationsText-to-image endpoint that generates one image from a text description.
Request parameters
Model ID. Use the stable model ID for regular calls, or a snapshot model ID when you need to reproduce results from a fixed version.
The text description of the image to generate; a non-empty string of at most 4,000 characters.
Content that should not appear in the image; at most 4,000 characters. The examples use the negative tags recommended in the model card.
Image size in the format widthxheight; defaults to 1024x1024. Each side must be 256–2048 and a multiple of 16; the total pixel count must not exceed 2097152.
Number of images to generate; only 1 is supported.
Random seed that controls the randomness of generation and makes results reproducible, from 0 to 2^53−1. If omitted, the system generates one at random.
Number of inference steps, from 1 to 100.
Guidance scale, from 0 to 10; an explicit 0 is honored.
Only url is supported; b64_json is not supported.
Output watermark settings. enabled is a boolean; when omitted, the visible watermark is on by default. Pass {"enabled": false} to turn off the visible watermark; the image still keeps its AIGC metadata.
Return value
On success, the endpoint returns JSON containing the image URL. Currently one PNG is generated per request, and streaming output is not supported.
The creation timestamp in the response.
The list of generated image results.
The URL of the generated image.
The actual image generation usage.
The number of images actually generated.
The actual image width, in pixels.
The actual image height, in pixels.
Error codes
The body is not valid JSON, a field has an invalid type or value, the request contains unsupported parameters, or the model / version cannot be found. Check field names and parameter ranges; do not pass a separate version for a snapshot model.
Authentication failed, or the platform safety review blocked the request.
The generated image asset does not exist. Resubmit the generation request; if it recurs, keep the request identifiers and contact the service provider.
The concurrency or request-rate limit was exceeded.
The upstream result failed structure, model version, or usage validation. Keep the task and trace identifiers and contact the service provider.