Get Image Generation Result
The get_image_result
endpoint allows you to retrieve the final result of a image generation task that was processed asynchronously. By providing the task ID returned from the create_images
endpoint when async
was set to true
, you can check the status of the task and obtain the generated images once the task is complete.
API Endpoint
To retrieve the image generation result, send a GET
request to the following URL:
GET https://api.genaifactory.ai/v1/get_image_result/{task_id}
Headers
Ensure that your request includes the following header:
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Path Parameters
Name
Type
Required
Description
task_id
string
Yes
The ID of the task you received when you initially made the asynchronous request.
Response Body
Pending Response (Status Code 201)
If the task is still in queue, the response will indicate that the task does not start:
Name
Type
Required
Description
status
string
Yes
A message indicating that the task is still processing, this field will be CREATED.
created_at
string
Yes
The timestamp indicating when the task was created.
tasks_ahead_count
int
Yes
The number of tasks ahead of it will be returned from the time a task is created until it is executed
Running Response (Status Code 202)
If the task is still in progress, the response will indicate that the task is not yet complete:
Name
Type
Required
Description
status
string
Yes
A message indicating that the task is still processing, this field will be RUNNING.
created_at
string
Yes
The timestamp indicating when the task was created.
started_at
string
Yes
The timestamp indicating when the task began processing.
Success Response (Status Code 200)
If the task has completed successfully, the response will include the generated images:
Name
Type
Required
Description
status
string
Yes
The status of the task. For successful completion, this field will be SUCCESS
.
created_at
string
Yes
The timestamp indicating when the task was created.
started_at
string
Yes
The timestamp indicating when the task began processing.
finished_at
string
Yes
The timestamp indicating when the task finished processing.
images
array of strings
No
A list of URLs pointing to the generated images in PNG format. Each URL corresponds to a generated image. The images are retained for a maximum duration of one month.
images_model_names
array of arrays
No
A list of arrays indicating the model names used to generate each image. Each inner array corresponds to one image.
svg_images
array of strings
No
A list of URLs pointing to the generated images in SVG format. Each URL corresponds to a generated image. The images are retained for a maximum duration of one month.
total_cost
string
Yes
The total cost of the task in currency units.
input_parameters
object
Yes
An object containing the parameters used to generate the task, such as image dimensions, style, content details, etc. Refer to the Input Parameters
section below for details.
Failure Response (Status Code 4XX)
If there is an issue with the request, such as an invalid task ID, the response will include an error message:
Name
Type
Required
Description
error
string
Yes
A descriptive error message indicating what went wrong with the request, this field will be
PARTIALLY_SUCCESSFUL
or FAILED
.
images
array of strings
No
A list of URLs pointing to the generated images in PNG format. Each URL corresponds to a generated image.
svg_images
array of strings
No
A list of URLs pointing to the generated images in SVG format. Each URL corresponds to a generated image.
Example Request
Example Pending Response
Example Running Response
Example Successful Response
Example Failure Response
Last updated