Precise edit with Ideogram 4.5
Edit an image with Ideogram 4.5 and get the result back at that image’s
exact width and height. Upload the image as image using
multipart/form-data, with optional reference_images and a mask.
Returns results directly by default; set async or supply a
webhook_url to get a generation_id and poll
GET /v2/generations/{generation_id}.
context_window confines the edit to one region of the image, so a
large image keeps its detail: pass y_min,x_min,y_max,x_max, or auto
together with a mask. The result always keeps the image’s own width
and height.
Authentication
API key for access control. Use in the header with the name “Api-Key”
Query parameters
When true, the request is validated and priced but not run: nothing is
generated, stored, or billed, and no safety review is performed. The
response is a PriceQuote object instead of the usual response for this
endpoint. Send exactly the request you would send to generate, so the
quote reflects the same options.
Request
A request to edit an image with Ideogram 4.5 at that image’s own size. Send it as multipart/form-data with the image to edit and any reference_images and mask.
The edit instruction, in natural language or as a structured JSON prompt. Natural language is automatically converted into a structured prompt; valid structured JSON is used as is.
The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if image_asset_identifier is also supplied. The output always matches this image’s width and height, and pixels the edit did not meaningfully change are copied exactly from it.
Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only image is. Multipart requests only; ignored if reference_image_asset_identifiers is also supplied. A request with a mask can include at most three, because the mask takes up one reference slot.
An optional mask that limits the edit to part of image (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images.
Which region of the image to edit.
none, the default, edits the whole image. A large image may come back smaller than it was sent.
auto requires a mask and automatically selects an appropriate context region around the masked area.
y_min,x_min,y_max,x_max names the region explicitly, by its corners. Rows come first, matching the bbox ordering used elsewhere in this API, and the values are the edited image’s own pixels with the origin at its top-left corner. For example 512,1024,2048,3072 is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures x_max - x_min by y_max - y_min. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A mask may select only pixels inside it.
With auto or an explicit region, only that region changes and the output keeps the image’s own width and height.
The rendering quality to use. very_low is the fastest and cheapest, and high takes longer and is priced higher.
Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with is_image_safe: false.
When false (the default), the request waits until the images are ready and returns them in data. When true, the request returns as soon as it is accepted; poll GET /v2/generations/{generation_id} with the returned generation_id for the result.
HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
JSON POST to this URL once all images for the request have finished
generating. The body mirrors the synchronous generate response:
request_id, created, and a data array
containing every generated image (url, prompt, resolution, seed,
is_image_safe). Each delivery is signed with Ed25519 and verifiable
against the public keys at https://api.ideogram.ai/v1/.well-known/jwks.json. Must be HTTPS;
private and loopback hosts and the cloud metadata service are rejected.
Response
The edited images (synchronous requests), or an acknowledgement to poll with GET /v2/generations/{generation_id} (async requests).
The kind of generation identified by generation_id. Both kinds can be polled through GET /v2/generations/{generation_id}.
URL-safe base64 ID of the generation. Use it to poll
GET /v2/generations/{generation_id}.
The edited images, in generation order. Present only for synchronous requests (async omitted or false).