Flux Pro - Expand image
This endpoint allows you to expand an image using the AI Flux Pro model. The image will be expanded based on the provided parameters.
Input size
The image you send must be at least 256 pixels on each side and no larger than 20 megapixels (width * height <= 20,000,000). Neither side is capped on its own and there is no aspect ratio restriction: a 30000x600 image is accepted, while a 255x70500 one is rejected because one of its sides is below 256, even though it is only 18 megapixels.
File size is irrelevant — what counts is the decoded pixel count, so a heavily compressed 60 megapixel photo is rejected just the same. An image outside these bounds is rejected with an error naming the rule it broke.
Sending more than 20 megapixels buys you nothing anyway: the output is capped at roughly 1.6 megapixels regardless of how large the input was, so resize before uploading.
Output size
left, right, top and bottom describe the expansion you are asking for, but this model does not guarantee that exact output size. The requested canvas is input_width + left + right by input_height + top + bottom, and two rules are then applied to it:
- Maximum output size of roughly 1.6 megapixels. If the requested canvas is larger, the whole image is scaled down proportionally until it fits. The aspect ratio is preserved, so there is no single maximum width or height: the cap applies to the total pixel count. A 1200x400 image expanded by 400 pixels on each edge asks for a 2000x1200 canvas and comes back as 1632x976.
- Each side is rounded to the nearest multiple of 16. A requested 916x692 comes back as 912x688; a requested 936x712 comes back as 944x720.
Both rules apply on every request, including small ones, so an output that matches your requested pixels exactly is the exception rather than the rule.
Omitting an edge applies its default (512 left, 512 right, 256 top, 256 bottom). Sending 0 leaves that edge unexpanded; sending 0 on all four edges returns a 400, since there is nothing to expand.
That said, this is the expand endpoint that stays closest to the pixel values you request: below the 1.6 megapixel cap, the rounding to 16 is the only deviation. Expanding an 896x672 image by 500 pixels on the top edge alone asks for 896x1172 and returns 896x1168. The other two expand endpoints diverge much further: ideogram always renders at about 1 megapixel and only preserves the aspect ratio, and seedream-v4-5 scales any canvas below 3.7 megapixels up. If you need exact output dimensions, resize the result yourself after generation.
Request
- Base URL: https://api.magnific.com
- URL: https://api.magnific.com/v1/ai/image-expand/flux-pro
- Auth: API key in header x-magnific-api-key
Request body
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.