image-expand

Seedream V4.5 - Expand image

This endpoint allows you to expand an image using the Seedream V4.5 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

The requested canvas is input_width + left + right by input_height + top + bottom, and this model constrains it in two ways:

  1. Each side is rounded up to the next multiple of 16.
  2. The canvas must contain between 3,686,400 and 16,777,216 pixels. A smaller canvas is scaled up to reach the lower bound, and a larger one is scaled down to the upper bound. Since the lower bound is close to 3.7 megapixels, a small input with a small expansion is upscaled — a 896x672 image expanded by 100px on each edge asks for a 1096x872 canvas and comes back at 2160x1728, close to twice the requested dimensions (measured).

If you need the output to stay close to the pixel values you requested, use POST /v1/ai/image-expand/flux-pro, which only deviates by the rounding to 16 while the result stays under 1.6 megapixels. For exact dimensions, resize the result yourself after generation.

left, right, top and bottom are all required, and at least one of them must be greater than 0.

post/v1/ai/image-expand/seedream-v4-5

Request

  • Base URL: https://api.magnific.com
  • URL: https://api.magnific.com/v1/ai/image-expand/seedream-v4-5
  • Auth: API key in header x-magnific-api-key

Request body

webhook_urlstring 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.

imagestring required

Image to expand. Accepts an HTTPS URL or a Base64-encoded image (max 10MB).

promptstring

Optional text prompt describing the desired expanded content. If not provided, the AI model will auto-generate a prompt based on the image.

leftinteger required

Number of pixels to expand on the left side

rightinteger required

Number of pixels to expand on the right side

topinteger required

Number of pixels to expand on the top side

bottominteger required

Number of pixels to expand on the bottom side

seedinteger

Optional seed for reproducibility

Example request

{
  "webhook_url": "https://www.example.com/webhook"
}

Response

OK - The task exists and the status is returned

Example response

{
  "data": {
    "generated": [
      "https://openapi-generator.tech",
      "https://openapi-generator.tech"
    ],
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "CREATED"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.