AI Expand
Last updated
Last updated
The Image Editing API allows you to expand (or uncrop) an input image.
AI Expand works by seamlessly expanding the background to fill every empty pixel of the result image.
To expand an image, set the argument expand.mode
to the value ai.auto
:
(original image) | (expanded image) |
If you want to give it a try, here's the code to reproduce the example above:
In order to expand an image, you need to either:
set removeBackground
to false
provide a background.imageUrl
expand.seed
If you make several calls to the Image Editing API with the same image, you will notice that it will generate a different expanded background each time.
This is great when you're looking for inspiration, but it might become an issue when you need consistency.
In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument expand.seed
can be any positive integer.
If you provide a value for expand.seed
, then the API should produce similar-looking backgrounds for the same image.