4 4
5Use up to five source images for a single image edit. You can specify images in the order they are sent in the request. By default, the output aspect ratio follows the first input image. You can override this by setting the `aspect_ratio` parameter to a specific ratio, such as `"1:1"` or `"16:9"`.5Use up to five source images for a single image edit. You can specify images in the order they are sent in the request. By default, the output aspect ratio follows the first input image. You can override this by setting the `aspect_ratio` parameter to a specific ratio, such as `"1:1"` or `"16:9"`.
6 6
7Each source image can be a public URL, a base64-encoded data URI, or a `file_id` from the [Files API](/developers/files) — and you can mix kinds within a single request. See [Imagine → Files API Integration](/developers/model-capabilities/imagine/files/inputs) for `file_id` details and examples.7Each source image can be a public URL, a base64-encoded data URI, or a `file_id` from the [Files API](/developers/files) — and you can mix kinds within a single request. See [Files API integration for image & video requests](/developers/model-capabilities/imagine/files/inputs) for `file_id` details and examples.
8 8
9## Related9## Related
10 10
11* [Image Generation](/developers/model-capabilities/images/generation) — Generate images from text prompts11* [Image Generation](/developers/model-capabilities/images/generation) — Generate images from text prompts
12* [Image Editing](/developers/model-capabilities/images/editing) — Edit a source image with natural language12* [Image Editing](/developers/model-capabilities/images/editing) — Edit a source image with natural language
13* [API Reference](/developers/rest-api-reference) — Full endpoint documentation13* [API Reference](/developers/rest-api-reference) — Full endpoint documentation
14* [Imagine API Landing Page](https://x.ai/api/imagine) — Showcase of the Imagine API in action14* [Image & Video API Landing Page](https://x.ai/api/imagine) — Showcase of the image & video API in action