---
title: "Ideogram - Expand image"
method: POST
path: "/v1/ai/image-expand/ideogram"
tags: ["image-expand"]
---

# Ideogram - Expand image

`POST /v1/ai/image-expand/ideogram`

## Request

- Base URL: `https://api.magnific.com`
- URL: `https://api.magnific.com/v1/ai/image-expand/ideogram`
- Auth: API key in header `x-magnific-api-key`

This endpoint allows you to expand an image using the Ideogram AI model. The image will be expanded based on the provided pixel values for each side.
If no prompt is provided, the model will auto-generate one based on the image content.

### Output size

`left`, `right`, `top` and `bottom` define the **aspect ratio** of the result,
not its pixel dimensions. The canvas is built as
`input_width + left + right` by `input_height + top + bottom`, and the model
then renders it at **approximately 1 megapixel**, picking the closest match
from its own fixed list of supported resolutions (all multiples of 32). The
pixel values you send are therefore not preserved:

| Requested canvas | Actual output |
| --- | --- |
| 896x1172 | 832x1088 |
| 1396x672 | 1472x704 |
| 896x896 | 1024x1024 |
| 4992x4768 | 1024x960 |

As the last row shows, a very large expansion does not produce a larger image:
it only changes the shape. If you need specific output dimensions, resize the
result yourself after generation.

`left`, `right`, `top` and `bottom` are all required. At least one of them
must be greater than `0`, otherwise the request returns a `400`; the other
three may be `0`.

## Request body

- ImageExpandIdeogramRequest
  - `webhook_url` string, uri: Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.
  - `image` string, byte, required: Base64 image to expand
  - `prompt` string: Optional text prompt describing the desired expanded content. If not provided, the AI model will auto-generate a prompt based on the image.
  - `left` integer, required: Number of pixels to expand on the left side
  - `right` integer, required: Number of pixels to expand on the right side
  - `top` integer, required: Number of pixels to expand on the top side
  - `bottom` integer, required: Number of pixels to expand on the bottom side
  - `seed` integer: Optional seed for reproducibility

## Response `200`

OK - The task exists and the status is returned

- InlineObject4
  - `data` TaskDetail1, required
    - `task_id` string, uuid, required: Task identifier
    - `status` 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED', required: Task status
    - `generated` string[], required

## Other responses

- `400`: Bad Request - The server could not understand the request due to invalid syntax.
- `401`: Unauthorized - The client must authenticate itself to get the requested response.
- `500`: Internal Server Error - The server has encountered a situation it doesn't know how to handle.
- `503`: Service Unavailable

---

[API](https://skmtc.dev/magnific/apis/magnific-api.md) · [All operations](https://skmtc.dev/magnific/apis/magnific-api/llms.txt) · [OpenAPI document](https://skmtc.dev/magnific/apis/magnific-api/revisions/60711fb082c7?raw)
