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 a new image from the given prompt.

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 UUID
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
createdByUserIdstringuserId of the account that created this image
promptstringprompt that produced the image (empty for upscales or uploads)
modelstringmodel used to produce the image
parametersobjectgeneration parameters (aspect ratio, format, etc.)
inputImageIdsobjectIDs of any input images supplied for edit-tasks or upscale-tasks
fileNamestringHuman-readable filename (with extension) suitable for downloads. Uploads carry the user-supplied name; generations get an LLM-derived slug; edits/upscales suffix the input's name. Capped at 50 characters.
imageWidthobjectimage width in pixels
imageHeightobjectimage height in pixels
imageSizeobjectimage file size in bytes
createdAtstringcreation timestamp as ISO 8601
updatedAtstringlast update timestamp as ISO 8601
shareKeystringHMAC key authorizing this image's public share link (pass as ?key=)
_linksobject
contentstringtemporary url to the image binary
downloadstringtemporary url that forces a file download (content-disposition: attachment)
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": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "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(s) and a prompt, and produces new image(s) derived from them.

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 UUID
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
createdByUserIdstringuserId of the account that created this image
promptstringprompt that produced the image (empty for upscales or uploads)
modelstringmodel used to produce the image
parametersobjectgeneration parameters (aspect ratio, format, etc.)
inputImageIdsobjectIDs of any input images supplied for edit-tasks or upscale-tasks
fileNamestringHuman-readable filename (with extension) suitable for downloads. Uploads carry the user-supplied name; generations get an LLM-derived slug; edits/upscales suffix the input's name. Capped at 50 characters.
imageWidthobjectimage width in pixels
imageHeightobjectimage height in pixels
imageSizeobjectimage file size in bytes
createdAtstringcreation timestamp as ISO 8601
updatedAtstringlast update timestamp as ISO 8601
shareKeystringHMAC key authorizing this image's public share link (pass as ?key=)
_linksobject
contentstringtemporary url to the image binary
downloadstringtemporary url that forces a file download (content-disposition: attachment)
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": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "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.

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 UUID
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
createdByUserIdstringuserId of the account that created this image
promptstringprompt that produced the image (empty for upscales or uploads)
modelstringmodel used to produce the image
parametersobjectgeneration parameters (aspect ratio, format, etc.)
inputImageIdsobjectIDs of any input images supplied for edit-tasks or upscale-tasks
fileNamestringHuman-readable filename (with extension) suitable for downloads. Uploads carry the user-supplied name; generations get an LLM-derived slug; edits/upscales suffix the input's name. Capped at 50 characters.
imageWidthobjectimage width in pixels
imageHeightobjectimage height in pixels
imageSizeobjectimage file size in bytes
createdAtstringcreation timestamp as ISO 8601
updatedAtstringlast update timestamp as ISO 8601
shareKeystringHMAC key authorizing this image's public share link (pass as ?key=)
_linksobject
contentstringtemporary url to the image binary
downloadstringtemporary url that forces a file download (content-disposition: attachment)
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": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
],
"generationId": "string",
"description": "string",
"detail": {}
}