Skip to main content

Tasks

Base URL: https://app.neuroflash.com/api/image-service

Generate images from a text prompt

POST/v1/workspaces/{workspaceId}/image-generation-tasks

Generates new images in the given workspace. The caller is recorded as the owner (createdByUserId) and is the only non-admin user allowed to delete them.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes

Request Body

FieldTypeRequiredDescription
promptstringYesText prompt to generate from.
numImagesintegerNoHow many images to generate.
aspectRatiostringNoAspect ratio options for generated images.
outputFormatstringNo
modelIdstringNoAvailable image generation models.

Response

FieldTypeDescription
imagesarray<object>The created images.
idstringUnique image ID (also the GCS object key).
generationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.
workspaceIdstringOwning workspace ID.
createdByUserIdstringGateway user ID of the image creator.
promptstringPrompt that produced the image (empty for upscales).
modelstringModel used to produce the image.
parametersobjectGeneration parameters (aspect ratio, format, etc.).
inputImageIdsobjectIDs of any input images supplied for image2image / upscale.
imageWidthobjectImage width in pixels.
imageHeightobjectImage height in pixels.
imageSizeobjectImage file size in bytes.
createdAtstringCreation timestamp in UTC.
updatedAtstringLast update timestamp in UTC.
_linksobject
contentstringWorkspace-scoped URL that returns the image binary.
generationIdstringID grouping the images that were created together.
descriptionstringOptional description returned by the upstream provider.
detailobjectNon-fatal warning (e.g. partial quota).

Example

curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-generation-tasks" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
}'

Response:

{
"images": [
{
"id": "string",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"_links": {
"content": "string"
}
}
],
"generationId": "string",
"description": "string",
"detail": {}
}

Edit existing images (prompt-driven image-to-image)

POST/v1/workspaces/{workspaceId}/image-edit-tasks

Consumes one or more existing image URLs and a prompt, and produces new image(s) derived from them. Inputs are persisted alongside outputs for traceability.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes

Request Body

FieldTypeRequiredDescription
promptstringYesEdit prompt that drives the image-to-image generation.
imageIdsarray<string>YesIDs of existing images to edit. The caller must own each image (same workspace and createdByUserId).
numImagesintegerNoHow many images to produce.
aspectRatiostringNoAspect ratio options including 'auto' for image-to-image edits.
outputFormatstringNo
modelIdstringNoAvailable image generation models.

Response

FieldTypeDescription
imagesarray<object>The created images.
idstringUnique image ID (also the GCS object key).
generationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.
workspaceIdstringOwning workspace ID.
createdByUserIdstringGateway user ID of the image creator.
promptstringPrompt that produced the image (empty for upscales).
modelstringModel used to produce the image.
parametersobjectGeneration parameters (aspect ratio, format, etc.).
inputImageIdsobjectIDs of any input images supplied for image2image / upscale.
imageWidthobjectImage width in pixels.
imageHeightobjectImage height in pixels.
imageSizeobjectImage file size in bytes.
createdAtstringCreation timestamp in UTC.
updatedAtstringLast update timestamp in UTC.
_linksobject
contentstringWorkspace-scoped URL that returns the image binary.
generationIdstringID grouping the images that were created together.
descriptionstringOptional description returned by the upstream provider.
detailobjectNon-fatal warning (e.g. partial quota).

Example

curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-edit-tasks" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"imageIds": [],
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
}'

Response:

{
"images": [
{
"id": "string",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"_links": {
"content": "string"
}
}
],
"generationId": "string",
"description": "string",
"detail": {}
}

Upscale an existing image

POST/v1/workspaces/{workspaceId}/image-upscale-tasks

Upscales a single input image with a dedicated upscale model. The input image is persisted alongside the output for traceability.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes

Request Body

FieldTypeRequiredDescription
imageIdstringYesID of the existing image to upscale. The caller must own the image (same workspace and createdByUserId).
modelIdstringYesAvailable image upscaling models.
upscaleFactorintegerYesSupported upscale factors.
outputFormatstringNo

Response

FieldTypeDescription
imagesarray<object>The created images.
idstringUnique image ID (also the GCS object key).
generationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.
workspaceIdstringOwning workspace ID.
createdByUserIdstringGateway user ID of the image creator.
promptstringPrompt that produced the image (empty for upscales).
modelstringModel used to produce the image.
parametersobjectGeneration parameters (aspect ratio, format, etc.).
inputImageIdsobjectIDs of any input images supplied for image2image / upscale.
imageWidthobjectImage width in pixels.
imageHeightobjectImage height in pixels.
imageSizeobjectImage file size in bytes.
createdAtstringCreation timestamp in UTC.
updatedAtstringLast update timestamp in UTC.
_linksobject
contentstringWorkspace-scoped URL that returns the image binary.
generationIdstringID grouping the images that were created together.
descriptionstringOptional description returned by the upstream provider.
detailobjectNon-fatal warning (e.g. partial quota).

Example

curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-upscale-tasks" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"imageId": "string",
"modelId": "string",
"upscaleFactor": 0,
"outputFormat": "string"
}'

Response:

{
"images": [
{
"id": "string",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"_links": {
"content": "string"
}
}
],
"generationId": "string",
"description": "string",
"detail": {}
}