Image Upload
Introduction
Images can be uploaded to be used in other tasks like Image-to-Image, Upscaling or ControlNet preprocessing.
There are 3 things to keep in mind:
- Valid extensions are:
jpeg
,jpg
,png
,webp
,bmp
andgif
. - There is no limit on image size but we save them with a maximum of 2048 pixels in width or height, maintaining the original aspect ratio.
- Images are deleted 30 days after last use. As long as you continue using them, we will continue saving them indefinitely.
Request
Our API always accepts an array of objects as input, where each object represents a specific task to be performed. The structure of the object varies depending on the type of the task. For this section, we will focus on the parameters related to the image upload task.
The following JSON snippet shows the basic structure of a request object. All properties are explained in detail in the next section.
taskType
The type of task to be performed. For this task, the value should be
imageUpload
.taskUUID
When a task is sent to the API you must include a random UUID v4 string using the
taskUUID
parameter. This string is used to match the async responses to their corresponding tasks.If you send multiple tasks at the same time, the
taskUUID
will help you match the responses to the correct tasks.The
taskUUID
must be unique for each task you send to the API.image
Specifies the image to be uploaded. The image can be specified in one of the following formats:
- A data URI string representing the image. The data URI must be in the format
data:<mediaType>;base64,
followed by the base64-encoded image. For example:data:image/png;base64,iVBORw0KGgo...
. - A base64 encoded image without the data URI prefix. For example:
iVBORw0KGgo...
. - A URL pointing to the image. The image must be accessible publicly.
Supported formats are: PNG, JPG and WEBP.
- A data URI string representing the image. The data URI must be in the format
Response
Results will be delivered in the format below.